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}]`;
1721
+
}else{
1722
+
// maxTokens hit mid-text — original behaviour
1723
+
_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.]';
userMessage: '[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.]',
1727
+
userMessage: _continuationUserMsg,
1705
1728
};
1706
1729
continue;
1707
1730
}
@@ -1880,8 +1903,10 @@ function register(ctx) {
1880
1903
};
1881
1904
}else{
1882
1905
// ── LEGACY TEXT PARSING PATH ──
1906
+
// Use _stitchedForMcp (partial block from previous iter + this iter) so MCP can
1907
+
// parse the reconstructed complete tool call when a fence was truncated mid-JSON.
0 commit comments