Agents: flush pending tool results on drop

This commit is contained in:
Shakker
2026-02-02 23:46:34 +00:00
committed by Shakker
parent e6fdac7bfb
commit befa421a57
2 changed files with 99 additions and 48 deletions

View File

@@ -101,6 +101,9 @@ export function installSessionToolResultGuard(
if (role === "assistant") {
const sanitized = sanitizeToolCallInputs([message]);
if (sanitized.length === 0) {
if (allowSyntheticToolResults && pending.size > 0) {
flushPendingToolResults();
}
return undefined;
}
nextMessage = sanitized[0];