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
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ Read this list first. Every item has a full section below.
154
154
-**Tests: three dimensions** — Coherence + tool correctness + response quality. Never count alone
155
155
-**Never tailor changes to pass tests** — Tests reveal real behavior. Don't teach to the test
156
156
-**Never revert without explaining why pre-fix state was working** — A revert is not a fix
157
-
-**Hardware-agnostic always** — Never target a specific machine, GPU, or model size
157
+
-**Hardware-agnostic always** — Never target a specific machine, GPU, or model size. Never hardcode a context size number (e.g. `contextSize: 8192`) — always compute from actual available RAM/VRAM at runtime. Hardcoded resource numbers are a hardware-specific violation even if they "work" on the dev machine. **Corollary — do NOT use `{min, max}` range-based context selection for `qwen35` SSM/Mamba hybrid architectures**: node-llama-cpp's binary-search estimator inflates KV cache requirements by 100x for these models (uses `trainContextSize=262144` as base), returning near-minimum context even on 32GB RAM machines. Always use explicit computed size + `ignoreMemorySafetyChecks: true` + `failedCreationRemedy: {retries:8, autoContextSizeShrink:0.5}` so actual hardware capacity drives the result.
158
158
-**Production software** — Every fix must work for 4GB GPU users AND 128GB workstation users
159
159
-**No cloud APIs as primary** — This is a local-first product. Cloud is not the answer
160
160
-**Read CHANGES_LOG.md before proposing any fix** — Context resets. The log is the anchor
continuationMsg=`${taskHint}${fileManifest}[Continue the tool call JSON from exactly where it was cut. Output ONLY the JSON continuation. Do NOT restart the tool call. Continue from:\n${tailForModel}]`;
1766
+
1767
+
// ── Salvage-and-Append: when a write_file call is truncated mid-content,
1768
+
// salvage the partial file, write it to disk, then switch the model to
1769
+
// append_to_file for the remaining content. This prevents the model from
continuationMsg=`${taskHint}${fileManifest}[File "${salvagePath}" has been written successfully (${lineCount} lines). This file is COMPLETE — do NOT rewrite or append to it. Continue with your original task — create the remaining files that were requested. Use write_file for each new file.]`;
1829
+
}else{
1830
+
// File is mid-content — tell model to append
1831
+
continuationMsg=`${taskHint}${fileManifest}[File "${salvagePath}" has been written with ${lineCount} lines so far. The file is NOT complete — more content is needed. Use append_to_file (NOT write_file) with filePath="${salvagePath}" to continue adding content from where the file ends. Here are the last 10 lines of the file:\n\`\`\`\n${lastLines}\n\`\`\`\nCall append_to_file now to add the next section starting after line ${lineCount}.]`;
1832
+
}
1833
+
1834
+
// Counteract iteration-- from above: salvage is a new agentic pass
continuationMsg=`${taskHint}${fileManifest}[Continue the tool call JSON from exactly where it was cut. Output ONLY the JSON continuation. Do NOT restart the tool call. Continue from:\n${tailForModel}]`;
1849
+
}
1743
1850
}else{
1744
1851
_pendingPartialBlock=responseText;// enable overlap detection for ALL continuation types
Copy file name to clipboardExpand all lines: main/constants.js
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,8 @@ If your output is cut off mid-generation, the system will automatically continue
67
67
- Use web_search when the answer may have changed since your training (current doc versions, real-time info, recent events, anything that varies over time). Do not use for static programming knowledge you can answer directly.
68
68
- If a tool fails, analyze the error and retry once with corrected parameters — never give up on the first failure
69
69
- Never claim a task is done before calling the tool that does it — writing a file requires write_file, searching requires web_search, running a command requires run_command
70
+
- If the user asks for multiple files, create ALL of them. Call write_file for EACH file — do not stop after the first file. Do not claim a file was created unless you received a success result from write_file for that specific file. Do not summarize until every requested file exists.
71
+
- Always use the exact filename the user specifies.
70
72
- When read_file fails with ENOENT, call find_files to locate the file by name
71
73
- **Never output full file content as code blocks in chat.** Always use the appropriate tool: write_file for new files, edit_file for modifications, append_to_file for additions, read_file before editing. Code blocks are only for brief snippets or explanations.
72
74
- edit_file: call read_file first to get the exact current text, then supply precise oldText
0 commit comments