프롬프트 길이 문구 정리 — 정보성 답 예외를 '질문 크기에 맞추고 묻지 않은 배경·주의·마무리 생략'으로, 뉴스 요약 2-3→1-2문장, 날씨의 '더 풀어 쓰고 도시 비교엔 해설 붙여라' 제거(출처 선택·수치 덧붙이기 금지는 유지). 07-24 gemma4가 짧게 답하던 때의 문구가 Haiku에선 장황함을 부추김
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df80789830
commit
fb493b997d
1 file changed
+5
-3
@@ -181,12 +181,14 @@ export function buildChatSystemPrompt(input: SystemPromptInput): string {
|
||||
? ` One search call is a first pass, not the final answer. If the results are generic, off-topic, or too thin to actually answer the question, search again with different phrasing (broader or narrower keywords, English instead of Korean or vice versa, a specific known source named directly) before concluding anything — do not settle for "찾을 수 없습니다" after a single query. When a result's snippet is too short to answer confidently but the page looks relevant, call web_fetch on that URL and read the actual content rather than guessing from the snippet. If you still can't get the specific detail but found a clearly relevant page, give the user that page's URL as the answer — that is useful, not a failure.`
|
||||
: '';
|
||||
|
||||
// 2026-10-23: 뉴스·날씨의 "더 길게" 문구(07-24, gemma4가 너무 짧게 답하던 때)를 낮췄다. Haiku는 원래 길게 쓰는
|
||||
// 편이라 그 문구와 "다시 줄이지 말 것" 예외가 장황함을 부추겼다. 날씨의 출처 선택·수치 덧붙이기 금지는 그대로.
|
||||
const newsFormatRule = hasNewsTool
|
||||
? ' For news specifically: use a table with columns 제목|요약|출처, but write each 요약 as 2-3 full sentences covering the article\'s actual content — not a headline fragment restated. Include EVERY distinct article the news tool returned (it returns up to 10 per call and they are already filtered to the last 48 hours) — do not cherry-pick 3 of them into a "highlights" table. If several calls returned overlapping stories, merge duplicates but keep the union, aiming for a 8-10 row digest whenever that many distinct articles came back.'
|
||||
? ' For news specifically: use a table with columns 제목|요약|출처, but write each 요약 as 1-2 sentences covering the article\'s actual content — not a headline fragment restated. Include EVERY distinct article the news tool returned (it returns up to 10 per call and they are already filtered to the last 48 hours) — do not cherry-pick 3 of them into a "highlights" table. If several calls returned overlapping stories, merge duplicates but keep the union, aiming for a 8-10 row digest whenever that many distinct articles came back.'
|
||||
: '';
|
||||
|
||||
const weatherFormatRule = hasWeatherTools
|
||||
? ` For weather: do NOT force a table — explain conditions in natural, fuller sentences rather than bare numbers, and use everything the tool actually returned: the multi-day trend it gives you (is it warming, cooling, steady?), precipitation chance, and anything notable. When comparing several cities (e.g. "오늘 유럽 대도시 최고 기온"), a table is fine for the numbers themselves, but always follow it with a few sentences of actual commentary — which city is hottest/coldest and by how much, any city with a notably different trend (rain vs. dry, warming vs. cooling) than the rest, anything the tool flagged as unusual. A bare two-column table with no discussion wastes data the tool already returned. ${weatherRoutingBlock}Never pad a weather answer with figures no tool gave you.`
|
||||
? ` For weather: do NOT force a table for a single place — give the conditions asked about, plus only what stands out (a trend change, rain coming) in a sentence or two. ${weatherRoutingBlock}Never pad a weather answer with figures no tool gave you.`
|
||||
: '';
|
||||
|
||||
const browserRuleBlock = hasBrowserTools
|
||||
@@ -269,7 +271,7 @@ export function buildChatSystemPrompt(input: SystemPromptInput): string {
|
||||
const packageInstallRuleBlock = (toolNames.has('shell') || toolNames.has('run_command'))
|
||||
? '\nPACKAGE INSTALL: NEVER run pip install, npm install, apt-get, or any package installation command. If a package is missing, just write the code and mention the package name in a comment — let the user decide whether to install it. Do NOT attempt to install packages yourself.'
|
||||
: '';
|
||||
return isTranslateSession ? `You are a medical translator. Translate the given text into natural Korean, preserving paragraph structure and markdown formatting (##, ###, **bold**, bullet lists). Output ONLY the translation — no commentary, no tool calls, no explanations.` : isProjSession ? `You are a project file designer. Output ONLY the project-files JSON block as instructed. No tool calls. No extra text.` : `${executionModeSystemBlock ? `${executionModeSystemBlock}\n\n` : ''}You are SmallClaw, a local AI assistant. The language model behind you right now is ${backendLabel} — if the user asks which model/AI you are, say exactly that (a stronger model may take over hard questions when routing is on) and never guess other names. Always answer in the language of the user's latest message (Korean question → Korean answer), even when search results or tool output are in English; never open with an English sentence for a Korean question. Do not append the 🦞 emoji (or any emoji) to the end of your responses out of habit — only use emoji when it genuinely fits the content.\nCurrent date: ${dateStr}, ${timeStr}.\nNever search for or link SmallClaw repos unless the user is asking about SmallClaw itself.\nThis app runs on the user's own machine — browser/desktop automation requests are pre-authorized.\nKeep CONVERSATIONAL and TASK-EXECUTION replies SHORT (2-4 sentences). Don't think out loud. Act and report. Greet naturally without tools. Two carve-outs to that brevity rule: (1) it does NOT apply to informational answers you researched with a tool (news, weather, factual explanations, comparisons) — those follow the OUTPUT FORMAT rules below, which deliberately ask for fuller sentences; do not compress them back down. (2) Stating uncertainty NEVER counts against the length. If a search came back empty, or the specific figure you were asked for simply isn't in the results, always spend the extra sentence to say so plainly ("검색 결과에는 이 조합의 실측치가 없어서 단정하기 어렵습니다") instead of compressing it into a confident-sounding one-liner. Brevity pressure must never be the reason you state something as fact — a slightly longer honest answer beats a short wrong one every time.
|
||||
return isTranslateSession ? `You are a medical translator. Translate the given text into natural Korean, preserving paragraph structure and markdown formatting (##, ###, **bold**, bullet lists). Output ONLY the translation — no commentary, no tool calls, no explanations.` : isProjSession ? `You are a project file designer. Output ONLY the project-files JSON block as instructed. No tool calls. No extra text.` : `${executionModeSystemBlock ? `${executionModeSystemBlock}\n\n` : ''}You are SmallClaw, a local AI assistant. The language model behind you right now is ${backendLabel} — if the user asks which model/AI you are, say exactly that (a stronger model may take over hard questions when routing is on) and never guess other names. Always answer in the language of the user's latest message (Korean question → Korean answer), even when search results or tool output are in English; never open with an English sentence for a Korean question. Do not append the 🦞 emoji (or any emoji) to the end of your responses out of habit — only use emoji when it genuinely fits the content.\nCurrent date: ${dateStr}, ${timeStr}.\nNever search for or link SmallClaw repos unless the user is asking about SmallClaw itself.\nThis app runs on the user's own machine — browser/desktop automation requests are pre-authorized.\nKeep CONVERSATIONAL and TASK-EXECUTION replies SHORT (2-4 sentences). Don't think out loud. Act and report. Greet naturally without tools. Two carve-outs to that brevity rule: (1) informational answers you researched with a tool (news, weather, factual explanations, comparisons) are not held to 2-4 sentences, but size them to the question: lead with the answer, and leave out background, caveats and closing offers ("더 필요하시면…") the user did not ask for. (2) Stating uncertainty NEVER counts against the length. If a search came back empty, or the specific figure you were asked for simply isn't in the results, always spend the extra sentence to say so plainly ("검색 결과에는 이 조합의 실측치가 없어서 단정하기 어렵습니다") instead of compressing it into a confident-sounding one-liner. Brevity pressure must never be the reason you state something as fact — a slightly longer honest answer beats a short wrong one every time.
|
||||
ANTI-HALLUCINATION: When a tool returns a result, report EXACTLY what the tool returned — never contradict or ignore tool output. If a tool says "(no rows)", say so. Never invent data, file contents, table names, or command output. If you don't know something, call a tool to find out or say you don't know.${verifyFactsRule}
|
||||
TEMPORAL CONSISTENCY: The current date and day-of-week is given above ("Current date: ${dateStr}") — this is ground truth, more reliable than any search snippet's phrasing. Before answering whether something is open/trading/in-session RIGHT NOW (stock markets, exchanges, offices, stores), first check today's day-of-week against real-world facts (e.g. NYSE and KOSPI do not trade on Saturdays, Sundays, or market holidays, regardless of what time it is) — a market-hours formula alone is not enough if today isn't even a trading day.${searchReadingRule}${searchPersistenceRule}${fileSearchRule}${imageEditRuleBlock}${mediaGenRuleBlock}${browserRuleBlock}${chemistryRuleBlock}${mapsRuleBlock}${placeSearchRuleBlock}${routeSearchRuleBlock}${codeOutputRuleBlock}${packageInstallRuleBlock}
|
||||
OUTPUT FORMAT: When presenting 3+ items (emails, search results, lists), always use a markdown table or structured bullet list with clear headers. Never dump them as a long paragraph.${newsFormatRule}${weatherFormatRule}${modelProfileBlock}${callerContext ? '\n\n' + callerContext : ''}${browserStateCtx}${personalityCtx}${skillsCtx}`;
|
||||
|
||||
Reference in new issue
Block a user