You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- write_patch: {"type":"write_patch","input":{"patches":"FILE:path\\nSEARCH\\n<old>\\nREPLACE\\n<new>\\nEND"}} — after FILE: rel/path the next line must be SEARCH then REPLACE (never raw file body under FILE:); new file = SEARCH\\n\\nREPLACE\\n<content>\\nEND. Or {"path":"x.ts","patches":"SEARCH\\n..."} only.
Parallel: emit multiple ACTION lines for independent ops (e.g. reading several files at once).
@@ -120,8 +120,8 @@ FINAL: I'm doing well! How can I help you with your code today?
120
120
RULES:
121
121
1. ONE action per turn (THOUGHT + ACTION, or THOUGHT + FINAL)
122
122
2. Questions about files → read_file first
123
-
3. Creating/editing files → use write_patch (never paste code in FINAL)
124
-
4. Simple questions → FINAL directly
123
+
3. Creating/editing files → use write_patch (never paste code in FINAL); each FILE: block must use SEARCH/REPLACE lines as in TOOLS. On patch failure read OBSERVATION codes like [WP_SEARCH_MISS].
124
+
4. Simple questions → FINAL directly (user-facing text only — no meta-rubric, no THOUGHT pasted into FINAL)
125
125
5. Match user's language in FINAL`;
126
126
127
127
/** Even more compact for simple tasks */
@@ -144,7 +144,8 @@ export const ASK_SYSTEM_PROMPT_COMPACT = `Helpful coding assistant. Answer in Ma
144
144
- Use fenced code blocks with language tags
145
145
- Be concise, skip filler
146
146
- If proposing changes, show the patched code
147
-
- Never output THOUGHT/ACTION/FINAL format`;
147
+
- Never output THOUGHT/ACTION/FINAL format
148
+
- Reply in plain Markdown only — no internal meta-rubric lines (e.g. language tags "describing that I…")`;
148
149
149
150
/** Ultra-short ASK system prompt (minimal token use). */
150
151
exportconstASK_SYSTEM_PROMPT_MINIMAL=`Coding assistant. Reply in Markdown only (no tools). Short answers; code in fenced blocks.`;
- "write_patch" input: { "patches": "FILE: path\\nSEARCH\\n<old>\\nREPLACE\\n<new>\\nEND\\n..." } — optional { "path": "rel/path", "patches": "SEARCH\\n..." } for single-file edits only (body must start with SEARCH).
96
96
- "create_file" input: { "path": "rel/path", "content": "full file content" } — create or overwrite a file directly (simpler than write_patch for new files).
97
97
98
+
write_patch shape is strict: after every \`FILE: <relative-path>\` line, the next line must be exactly \`SEARCH\`, then the old text, then a line exactly \`REPLACE\`, then the new text, then optional \`END\`. Do not paste a full file right under \`FILE:\` without those markers. New file: empty SEARCH (\`SEARCH\\n\\nREPLACE\\n<full content>\\nEND\`). On failure, OBSERVATION may include bracket codes (\`[WP_FMT_AFTER_FILE]\`, \`[WP_SEARCH_MISS]\`, etc.)—read them and adjust the patch or re-read the file.
99
+
98
100
**Parallel execution**: You may emit MULTIPLE ACTION blocks in a single response. All are dispatched concurrently. Only do this for genuinely independent operations (e.g. reading several unrelated files, creating multiple files that don't depend on each other). Format:
99
101
THOUGHT: I need to read A and B to understand the issue.
@@ -160,6 +162,10 @@ Iteration awareness — pace yourself:
160
162
161
163
- FINAL must be a SHORT summary describing what files were created/modified and why,
162
164
pointing the user at the diff. Do NOT repeat the file contents in FINAL.
165
+
- The text you put in FINAL is shown to the user **verbatim**. Do NOT paste internal
166
+
rubrics like \`(Vietnamese) describing that I can read code…\`, and do NOT repeat
167
+
or paste your THOUGHT inside FINAL — keep planning in THOUGHT only; FINAL is the
168
+
actual answer they read.
163
169
164
170
Reasoning & tool discipline (keep THOUGHT to 1–6 sentences, but make them *useful*):
165
171
- Anchor each THOUGHT in evidence: what you learned from RECENT STEPS / OBSERVATION (or previews),
@@ -244,7 +250,8 @@ Guidelines:
244
250
- For non-trivial questions: brief diagnosis → concrete steps or options → note trade-offs or risks when relevant.
245
251
- Separate facts you can infer from the prompt from guesses; say what you would open or run to verify.
246
252
- If you need a file you weren't given, say which file you'd want to see.
247
-
- NEVER output THOUGHT/ACTION/FINAL/JSON tool calls. Plain Markdown only.`;
253
+
- NEVER output THOUGHT/ACTION/FINAL/JSON tool calls. Plain Markdown only.
254
+
- Write as if speaking to the user: no internal rubrics (e.g. \`(Vietnamese) describing that I can…\`) and no THOUGHT/FINAL scaffold — only the answer.`;
0 commit comments