Pure helpers for reconnect-with-consolidation.
The event stream has no replay: on (re)connect a consumer lists past events
and must (a) drop ones it already processed and (b) re-drive any tool call left
unanswered across the disconnect, or the session deadlocks waiting on it. These
functions are pure so the orchestration layer (e.g. ReqManagedAgents.Session)
or any custom loop can call them.
Summary
Functions
Split events into the ones not in seen and return the grown seen-set.
Return the stop_reason map of the last requires_action idle event if it was
never followed by another terminal idle (i.e. still pending), else nil.
Return agent.custom_tool_use events that have no matching user.custom_tool_result.
Functions
Split events into the ones not in seen and return the grown seen-set.
Return the stop_reason map of the last requires_action idle event if it was
never followed by another terminal idle (i.e. still pending), else nil.
Return agent.custom_tool_use events that have no matching user.custom_tool_result.