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
_pendingPartialBlock=_partialFenceContent;// save so next iter MCP can reconstruct
1720
-
_continuationUserMsg=`[You were generating a tool call and the context window was exhausted mid-JSON. The partial output is shown below — output ONLY the remainder of the JSON continuing from exactly where it ends, then close the object and the code fence. Do NOT restart the tool call from the beginning. Do NOT add any preamble or explanation. Continue from:\n\n${_partialFenceContent}]`;
1725
+
_pendingPartialBlock=_partialFenceContent;// save full block so MCP can reconstruct
1726
+
const_tail=_partialFenceContent.length>200
1727
+
? '\u2026'+_partialFenceContent.slice(-200)
1728
+
: _partialFenceContent;
1729
+
_continuationUserMsg=`[Continue the tool call JSON from exactly where it was cut. Output ONLY the JSON continuation — the remainder of the current value, any remaining keys, closing brace, and code fence. Do NOT restart the tool call. Do NOT add preamble. Continue from:\n${_tail}]`;
1721
1730
}else{
1722
1731
// maxTokens hit mid-text — original behaviour
1723
1732
_continuationUserMsg='[Continue your response exactly where you left off. If you were listing steps or planning, STOP — do not add more steps. Call the first tool now to begin execution. If you were in the middle of a tool call, call that tool now to complete the task — do not output tool content as raw text. Output only the continuation — no preamble, no summary, no repeated content.]';
@@ -1730,6 +1739,18 @@ function register(ctx) {
1730
1739
}
1731
1740
// Natural stop or max continuations reached — reset counter for next response
1732
1741
if(!_wasTruncated)continuationCount=0;
1742
+
// FIX-A: Send done:true for the text-mode generating bubble ONLY when NOT continuing.
1743
+
// When continuing (above), the bubble must stay alive so the user sees the ongoing stream.
1744
+
// In the happy path, onToolExecuting on the renderer already clears the bubble;
1745
+
// this handles edge cases where the tool call was written but execution was skipped.
0 commit comments