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
Issue #26 comment #2 notes that when stream_events lands, state.tool_calls can be stale relative to response_object after a terminal event (response.completed). The terminal event overwrites response_object with the authoritative payload, but does not rebuild state.tool_calls — so tool_calls reflects incrementally accumulated deltas while response_object.output reflects the terminal truth.
Currently tool_dispatch reads exclusively from state.tool_calls via std::mem::take(&mut state.tool_calls).
Proposed fix
Derive tool calls from response_object["output"] at dispatch time (option 1 from the comment — single source of truth). Fall back to tool_calls when response_object has no output (backward compat for pre-stream_events paths).
Blocked by
Filter 6: stream_events #25 (stream_events) — until terminal events populate response_object, the fallback path is the only one exercised
Context
Issue #26 comment #2 notes that when
stream_eventslands,state.tool_callscan be stale relative toresponse_objectafter a terminal event (response.completed). The terminal event overwritesresponse_objectwith the authoritative payload, but does not rebuildstate.tool_calls— sotool_callsreflects incrementally accumulated deltas whileresponse_object.outputreflects the terminal truth.Currently
tool_dispatchreads exclusively fromstate.tool_callsviastd::mem::take(&mut state.tool_calls).Proposed fix
Derive tool calls from
response_object["output"]at dispatch time (option 1 from the comment — single source of truth). Fall back totool_callswhenresponse_objecthas no output (backward compat for pre-stream_eventspaths).Blocked by
stream_events) — until terminal events populateresponse_object, the fallback path is the only one exercisedReferences