Skip to content

Fix/streaming protocol fixes#29

Merged
john-zhh merged 3 commits intofeat/v3.0.1from
fix/streaming-protocol-fixes
Mar 12, 2026
Merged

Fix/streaming protocol fixes#29
john-zhh merged 3 commits intofeat/v3.0.1from
fix/streaming-protocol-fixes

Conversation

@john-zhh
Copy link
Copy Markdown
Contributor

No description provided.

john-zhh and others added 3 commits March 11, 2026 22:42
…cking

- stream.go: extract id/model from nested response object in
  response.created/in_progress events (was reading wrong top-level key)
- stream.go: capture call_id/name from response.output_item.added so
  first tool_calls delta includes proper id and function.name header
- stream.go: emit full tool call header (id, type, function.name,
  first args) on first delta; subsequent deltas carry args only
- server.go: sseUsageExtractor.processChunk now handles Responses API
  response.completed events and OpenAI Chat final chunks (no "type"
  field, usage at top level with prompt_tokens/completion_tokens)
- tests: assert id and model fields in streaming chunks; add
  response.output_item.added to tool call test; cover Responses API
  and OpenAI Chat usage extraction in sseUsageExtractor tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…i-chat stream

Both response.created and response.in_progress events triggered the
initial role delta emit. Add roleSent guard so only the first of these
events emits the chunk; subsequent ones still update id/model.

Add TestTransformResponsesAPIToOpenAIChat_NoDuplicateRoleChunk to
verify only one role:assistant chunk appears when both events arrive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…i-chat stream

Both response.created and response.in_progress events triggered the
initial role delta emit. Add roleSent guard so only the first of these
events emits the chunk; subsequent ones still update id/model.

Add TestTransformResponsesAPIToOpenAIChat_NoDuplicateRoleChunk to
verify only one role:assistant chunk appears when both events arrive.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@john-zhh john-zhh merged commit 4d47973 into feat/v3.0.1 Mar 12, 2026
4 checks passed
@john-zhh john-zhh deleted the fix/streaming-protocol-fixes branch March 12, 2026 01:45
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.

1 participant