Skip to content

feat(openai): add session-scoped Responses WebSocket transport - #26

Merged
danielkov merged 2 commits into
mainfrom
feat/openai-responses-websocket
Sep 23, 2026
Merged

danielkov merged 2 commits into
mainfrom
feat/openai-responses-websocket

Conversation

@danielkov

Copy link
Copy Markdown
Owner

Summary

Add opt-in WebSocket transport to the OpenAI Responses provider, with session-scoped connection reuse and shared HTTP/WebSocket response decoding. Bump agentkit-provider-openai from 0.10.9 to 0.10.10.

Impact

HTTP/SSE remains the default. Applications can select WebSocket or Auto through OpenAIResponsesConfig::with_transport; Auto switches the session to HTTP after a handshake HTTP 426.

Technical details

Connection lifecycle and retry safety

Each session permits one active WebSocket turn and returns a completed connection for reuse. Cancellation, unfinished-turn drop, interrupted authentication refresh, and protocol failures discard the connection. Authentication remains credential-bound; requests with ambiguous delivery or accepted responses are not automatically replayed.

Shared response semantics

Both transports use the existing response event decoder, preserving tool calls, reasoning, images, usage, and continuation validation. WebSocket requests use flattened response.create messages without HTTP-only stream or background fields. Message limits and deadline handling bound transport work.

Initial scope

Requests still send the full transcript; incremental previous_response_id delivery is deferred until lossless prefix compatibility can be established. WebSocket upgrades use a dedicated reqwest HTTP/1 client and the existing TLS stack; custom Http clients continue to apply only to HTTP/SSE.

@danielkov
danielkov merged commit 15358ec into main Sep 23, 2026
1 check 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.

1 participant