Skip to content

refactor: finalize streamed tool calls on boundaries#330

Merged
GCWing merged 1 commit intoGCWing:mainfrom
wsp1911:main
Apr 2, 2026
Merged

refactor: finalize streamed tool calls on boundaries#330
GCWing merged 1 commit intoGCWing:mainfrom
wsp1911:main

Conversation

@wsp1911
Copy link
Copy Markdown
Collaborator

@wsp1911 wsp1911 commented Apr 1, 2026

  • replace brace-closure based tool-call completion with boundary-driven accumulation
  • add shared pending tool accumulator for streaming and non-stream aggregation
  • finalize tool arguments on new tool, finish reason, stream end, and shutdown
  • keep invalid streamed tool calls marked as errors for downstream execution handling
  • preserve legacy send_message() behavior by dropping invalid finalized tool calls
  • update stale stream processor comments and tighten invalid tool error messages
  • add regression tests for mixed tool/usage chunks and same-chunk finish finalization

- replace brace-closure based tool-call completion with boundary-driven accumulation
- add shared pending tool accumulator for streaming and non-stream aggregation
- finalize tool arguments on new tool, finish reason, stream end, and shutdown
- keep invalid streamed tool calls marked as errors for downstream execution handling
- preserve legacy `send_message()` behavior by dropping invalid finalized tool calls
- update stale stream processor comments and tighten invalid tool error messages
- add regression tests for mixed tool/usage chunks and same-chunk finish finalization
@GCWing GCWing merged commit 7f11cf3 into GCWing:main Apr 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants