Skip to content

fix: responses api streaming mocks - #12

Open
supreme-gg-gg wants to merge 1 commit into
kagent-dev:mainfrom
supreme-gg-gg:fix/responses-streaming
Open

fix: responses api streaming mocks#12
supreme-gg-gg wants to merge 1 commit into
kagent-dev:mainfrom
supreme-gg-gg:fix/responses-streaming

Conversation

@supreme-gg-gg

Copy link
Copy Markdown
Contributor

Implements the correct event lifecycle and schema for Responses API. The previous version works for some simple clients, but is rejected by a strict stateful consumer like Codex (which Kagent runs e2e test on).

Specific problems fixed:

  • response.created omitted the required response.
  • Text deltas arrived before response.output_item.added and response.content_part.added
  • Text events omitted item_id, output_index, and content_index.
  • Function-call deltas used arguments instead of delta.
  • Function-call events omitted item IDs and output indices.
  • It emitted nonexistent response.function_call_output.delta/done events.
  • It omitted item/content completion events.
  • It split text by bytes, potentially corrupting UTF-8.
  • SSE frames lacked the event: <type> line.

Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
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