@@ -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 ? ` ` ` (?: j s o n | t o o l _ c a l l | t o o l ) \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 ( / \[ C o n t i n u e y o u r r e s p o n s e [ \s \S ] * ?\] / gi, '' ) ;
1678+ }
16731679 displayResponseText += displayChunk ;
16741680
16751681 // ── SEAMLESS CONTINUATION ──
0 commit comments