Skip to content

Commit 9cffc69

Browse files
author
Brendan Gray
committed
v1.7.4: multi-file preamble fix + bare JSON label strip in chat renderer
1 parent 4f5a5dc commit 9cffc69

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

main/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const DEFAULT_COMPACT_PREAMBLE = `You are a local AI coding assistant with tools
8484
## Behavior
8585
- **Your tools are real and execute in the live environment.** Call them — do not describe what you would do instead of doing it.
8686
- **When your response would contain a complete file (code, markup, config, data) — call write_file. File content belongs in the filesystem, not in chat.**
87+
- **For tasks that require creating multiple files: write ONE file per tool call — do not enumerate all files or steps first, and do not output file content as prose. Call write_file immediately for the first file; after it succeeds, write the next file, and so on, one file per turn.**
8788
- **Never say you created, saved, ran, or navigated to something unless you called a tool that did it.**
8889
- **Never claim you searched for something, looked it up, or checked a source unless you actually called web_search or fetch_webpage in this response.**
8990
- **You do not know today's date or current real-world state. If asked for the date, time, or any live or time-sensitive information — call web_search immediately. Never state a current date, time, or real-world value from memory.**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "guide-ide",
3-
"version": "1.7.3",
3+
"version": "1.7.4",
44
"description": "guIDE - AI-Powered Offline IDE with local LLM, RAG, MCP tools, browser automation, and integrated terminal",
55
"author": {
66
"name": "Brendan Gray",

src/utils/chatContentParser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ export function stripToolArtifacts(text: string): string {
6363
cleaned = cleaned.replace(/<think(?:ing)?>\s*[\s\S]*?<\/think(?:ing)?>/gi, '');
6464
cleaned = cleaned.replace(/<\/?think(?:ing)?>/gi, '');
6565
// (model output filters removed — model text is shown verbatim)
66+
// Strip bare code-fence language labels leaked by the model without backtick fences
67+
// e.g. the model outputs `json\n{"tool":...}` instead of ```json\n{...}\n```. These labels
68+
// are visual garbage — the JSON below them is already suppressed by the tool-call parser.
69+
cleaned = cleaned.replace(/^(json|html|css|javascript|typescript|python|bash|sh|xml|yaml)\s*\n(?=\s*\{)/gim, '');
6670
// Strip orphaned JSON fragments — e.g. `params": {"filePath":...}}` left when a tool
6771
// call's opening brace was consumed by the parser but the params field leaked as text.
6872
cleaned = cleaned.replace(/^\s*"?params"?\s*"?\s*:\s*\{[\s\S]*?\}\}?\s*$/gm, '');

0 commit comments

Comments
 (0)