Skip to content

feat(openai): add responses websocket transport#29477

Merged
rekram1-node merged 23 commits into
devfrom
websocket-support
May 27, 2026
Merged

feat(openai): add responses websocket transport#29477
rekram1-node merged 23 commits into
devfrom
websocket-support

Conversation

@rekram1-node

@rekram1-node rekram1-node commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Responses WebSocket transport for OpenAI/Codex requests with per-session socket reuse and SSE-compatible streamed output.
  • Preserve HTTP behavior for ineligible requests and safely replay over HTTP when WebSocket fails before output starts.
  • Handle connection timeouts, idle timeouts, socket rotation, cancellation, busy lanes, and websocket_connection_limit_reached reconnect/fallback behavior.
  • Gate the temporary rollout: enabled by default on local, dev, and beta; latest and prod require OPENCODE_EXPERIMENTAL_WEBSOCKETS=true.
  • Document the transport flow in packages/opencode/src/plugin/openai/README.md.

Remaining work (will complete in follow up PRs)

  • previous_response_id continuation.
  • more robust retry/connection handling
  • ideally killing of ws dep
  • making websockets the default

Relates to: #29079

Closes: #14891

@Chasewhip8

Copy link
Copy Markdown

legend 🙏🏻

@rekram1-node rekram1-node changed the title openai websocket support feat(openai): add responses websocket transport May 27, 2026
@rekram1-node rekram1-node merged commit 62da1e7 into dev May 27, 2026
11 of 12 checks passed
@rekram1-node rekram1-node deleted the websocket-support branch May 27, 2026 20:02
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
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.

[FEATURE]:Add Support for Realtime API with WebSocket from OpenAI

2 participants