Repository navigation
feat(openai): add session-scoped Responses WebSocket transport - #26
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-openaifrom 0.10.9 to 0.10.10.Impact
HTTP/SSE remains the default. Applications can select
WebSocketorAutothroughOpenAIResponsesConfig::with_transport;Autoswitches 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.createmessages without HTTP-onlystreamorbackgroundfields. Message limits and deadline handling bound transport work.Initial scope
Requests still send the full transcript; incremental
previous_response_iddelivery is deferred until lossless prefix compatibility can be established. WebSocket upgrades use a dedicated reqwest HTTP/1 client and the existing TLS stack; customHttpclients continue to apply only to HTTP/SSE.