Skip to content

Commit 5ab4948

Browse files
author
Brendan Gray
committed
v1.8.8: Fix duplicate tool display, CONTEXT_OVERFLOW after nudge, collapsed code blocks
- Remove duplicate tool-executing IPC send (inline loop at lines 1320-1325 was redundant with sendToolExecutionEvents at line 1359) - Nudge now strips raw code dump from history before retry (clears fullResponseText, resets session, rebuilds prompt) to prevent CONTEXT_OVERFLOW - CodeBlock: tool call results start expanded instead of collapsed to 6 lines (isToolCall flag respected) - copilot-instructions.md: clarified that reading means following
1 parent 87559a2 commit 5ab4948

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ When the user says "read your instructions", "read the instructions", "read copi
3737
- It does NOT matter if you think you remember them.
3838
- You MUST read every single character, every single line, every single time the user says it.
3939
- After reading, explicitly acknowledge every section by name and state which rules apply to the current task.
40+
- "Reading" means FOLLOWING. Reading the instructions without following them is the same as not reading them. Every rule read must be applied to the current task immediately.
4041
- There are NO exceptions to this rule. None. Ever.
4142

4243
---

.gitignore

168 Bytes
Binary file not shown.

main/agenticChat.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,9 +1303,14 @@ function register(ctx) {
13031303
(/<\w+[\s>]/.test(responseText) && (responseText.match(/<\w+/g) || []).length > 10));
13041304
if ((hasCodeBlocks || hasUnclosedLargeBlock || hasRawCodeDump) && nudgesRemaining > 0 && iteration < MAX_AGENTIC_ITERATIONS - 1) {
13051305
nudgesRemaining--;
1306+
// Strip the raw code dump from accumulated response to free context budget.
1307+
// The model will regenerate the content properly via write_file.
1308+
fullResponseText = '';
1309+
try { await llmEngine.resetSession(true); } catch (_) {}
1310+
sessionJustRotated = true;
13061311
currentPrompt = {
1307-
systemContext: currentPrompt.systemContext,
1308-
userMessage: '[SYSTEM: You wrote code directly in chat. Use write_file tool to save it. Format: ```json\n{"tool":"write_file","params":{"filePath":"filename.ext","content":"..."}}\n```]',
1312+
systemContext: buildStaticPrompt(),
1313+
userMessage: buildDynamicContext(Math.floor(maxPromptTokens * 0.10)) + '\n' + message + '\n\n[SYSTEM: You wrote code directly in chat. Use write_file tool to save it. Format: ```json\n{"tool":"write_file","params":{"filePath":"filename.ext","content":"..."}}\n```]',
13091314
};
13101315
continue;
13111316
}
@@ -1316,13 +1321,6 @@ function register(ctx) {
13161321

13171322
lastIterationResponse = responseText;
13181323

1319-
// Send live tool execution indicators
1320-
if (mainWindow) {
1321-
for (const tr of toolResults.results) {
1322-
mainWindow.webContents.send('tool-executing', { tool: tr.tool, params: tr.params });
1323-
}
1324-
}
1325-
13261324
if (isStale()) break;
13271325

13281326
// Accumulate tool results

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.8.7",
3+
"version": "1.8.8",
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/components/Chat/ChatWidgets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export const CodeBlock: React.FC<{ code: string; language: string; onApply: () =
330330
const [copied, setCopied] = useState(false);
331331
const lineCount = code.split('\n').length;
332332
const isLong = lineCount > COLLAPSE_LINE_THRESHOLD;
333-
const [expanded, setExpanded] = useState(!isLong); // Start collapsed if long
333+
const [expanded, setExpanded] = useState(!isLong || !!isToolCall); // Tool call results start expanded
334334

335335
const handleCopy = () => {
336336
navigator.clipboard.writeText(code);

0 commit comments

Comments
 (0)