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
{{ message }}
Repository navigation
A failed tool-call scheduler leaves the session history invalid; every subsequent turn is rejected 400 by the provider
#6530
When startCall throws β for example the TOOL_RUNTIME_SCHEDULER lookup returning undefined β appendToolCall has already persisted the assistant message containing tool_calls, but appendToolResult never runs. The session history is left with a tool_calls assistant message and no matching tool-role responses. On every later turn this invalid history is replayed to the provider, which rejects it:
An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. (insufficient tool messages following tool_calls message)
code: INVALID_REQUEST, status 400
The session then becomes permanently unusable β retrying never recovers; only starting a new session works, and the already-recorded work in that session can no longer be continued.
Reproduced locally in a single session log (turn/end events): turn 1 ends with the scheduler TypeError, and turns 2 and 3 both end with the 400 above.
Suggested fix
In the catch / schedulerFailure path of runGroup, roll back (or synthesize tool-result placeholders for) the appendToolCall entries that were written but never dispatched, so the persisted history stays provider-valid and the session can still be resumed. As a secondary guard it would help for the failing turn's error path to mark the session as "history repaired" rather than leaving it to fail again on the provider side.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
When
startCallthrows β for example theTOOL_RUNTIME_SCHEDULERlookup returningundefinedβappendToolCallhas already persisted the assistant message containingtool_calls, butappendToolResultnever runs. The session history is left with atool_callsassistant message and no matching tool-role responses. On every later turn this invalid history is replayed to the provider, which rejects it:The session then becomes permanently unusable β retrying never recovers; only starting a new session works, and the already-recorded work in that session can no longer be continued.
Reproduced locally in a single session log (
turn/endevents): turn 1 ends with the schedulerTypeError, and turns 2 and 3 both end with the 400 above.Suggested fix
In the
catch/schedulerFailurepath ofrunGroup, roll back (or synthesize tool-result placeholders for) theappendToolCallentries that were written but never dispatched, so the persisted history stays provider-valid and the session can still be resumed. As a secondary guard it would help for the failing turn's error path to mark the session as "history repaired" rather than leaving it to fail again on the provider side.All reactions