Skip to content

Commit 8604b16

Browse files
author
Brendan Gray
committed
v1.7.7: remove IPC truncation cap, strip stray JSON fences from display, fix CUDA partial-layer fallback, strip echoed continuation prompt
1 parent c6c5a01 commit 8604b16

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

main/agenticChat.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,8 +1338,8 @@ function register(ctx) {
13381338
// Step 2: stream the accumulating content to the renderer
13391339
if (_tStart !== -1 && _tName && mainWindow && !mainWindow.isDestroyed()) {
13401340
const raw = _tb.slice(_tStart);
1341-
// Cap at 3000 chars for IPC efficiency; frontend further caps at 1500 for display
1342-
const paramsText = raw.length > 3000 ? raw.slice(0, 3000) + '\n…[truncated]' : raw;
1341+
// Pass full raw JSON — no truncation
1342+
const paramsText = raw;
13431343
mainWindow.webContents.send('llm-tool-generating', {
13441344
callIndex: _tIdx,
13451345
functionName: _tName,
@@ -1665,11 +1665,17 @@ function register(ctx) {
16651665
// Strip tool-call JSON fences from the user-visible copy before accumulating.
16661666
// fullResponseText (fed back to the model for context) keeps the raw text.
16671667
// displayResponseText (committed to the chat message) should only have natural language.
1668-
// Targets: ```tool_call```, ```tool```, and ```json``` whose root object is a tool call.
1669-
// Tool-call fenced blocks are left in displayChunk so they appear as formatted code
1670-
// blocks in the chat bubble rather than being silently stripped to nothing.
1671-
const displayChunk = responseText
1668+
// Targets: ```tool_call```, ```tool```, and ```json``` blocks (duplicate visible text —
1669+
// proper tool call UI is rendered via the 'tool-executing' IPC channel instead).
1670+
let displayChunk = responseText
1671+
.replace(/\n?```(?:json|tool_call|tool)\b[\s\S]*?```\n?/g, '')
16721672
.replace(/\n{3,}/g, '\n\n');
1673+
// Strip echoed continuation prompt — small models sometimes echo our bracketed
1674+
// instruction back as output instead of continuing. This is NOT a user-input classifier;
1675+
// it detects only our own constant continuation prompt string being reflected by the model.
1676+
if (continuationCount > 0) {
1677+
displayChunk = displayChunk.replace(/\[Continue your response[\s\S]*?\]/gi, '');
1678+
}
16731679
displayResponseText += displayChunk;
16741680

16751681
// ── SEAMLESS CONTINUATION ──

main/llmEngine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ class LLMEngine extends EventEmitter {
391391
// Previously only skipped when auto=0 — but auto can return a small nonzero count (e.g. 6)
392392
// that is still well below what a computed partial offload gives (e.g. 14).
393393
const _partialFallback = gpuModes.find(m => typeof m === 'number');
394-
if (tryGpuMode === 'auto' && _partialFallback !== undefined && gpuLayers < _partialFallback) {
395-
console.log(`[LLM] Auto returned ${gpuLayers} GPU layers (< partial fallback ${_partialFallback}) — trying explicit partial offload`);
394+
if ((tryGpuMode === 'auto' || tryGpuMode === 'cuda') && _partialFallback !== undefined && gpuLayers < _partialFallback) {
395+
console.log(`[LLM] ${tryGpuMode} returned ${gpuLayers} GPU layers (< partial fallback ${_partialFallback}) — trying explicit partial offload`);
396396
continue;
397397
}
398398
} catch (loadErr) {

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.6",
3+
"version": "1.7.7",
44
"description": "guIDE - AI-Powered Offline IDE with local LLM, RAG, MCP tools, browser automation, and integrated terminal",
55
"author": {
66
"name": "Brendan Gray",

0 commit comments

Comments
 (0)