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
fix: repair orphaned toolUse in last session message during restore
_fix_broken_tool_use skipped the last message with an explicit guard,
relying on the agent-class fallback (_has_tool_use_in_latest_message).
That fallback only works within the same process. When a new process
restores a session that ended with an orphaned toolUse (e.g. after a
runtime timeout), the guard causes the broken history to be sent to
the model, producing a ValidationException.
Remove the guard and handle the last-message case by appending a
synthetic toolResult with status 'error'. The tool execution context
is already lost at restore time, so letting the model decide how to
proceed is the correct behavior.
Updates the test that asserted the old (incorrect) behavior.
0 commit comments