GeezerVison is showing github.com — fix(server): relay ChatGPT/Codex App voice via POST /v1/live by Wibias · Pull Request #379 · lidge-jun/opencodex
Conversation
Wibias
commented
Jul 24, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Accept
POST /v1/live before the /v1/* JSON-404 guard so ChatGPT / Codex App voice (GPT-Live) works when Design B injects ocx as base_url (Proxy the live voice endpoint #371).
- Relay to ChatGPT forward or an OpenAI API-key provider; rewrite API multipart → backend
/realtime/calls JSON when the upstream is backend-api.
- Pass through
Location + content-type; return a clear 400 when no OpenAI upstream is configured (not 404). Sideband WS for /v1/live/{callId} left as a possible follow-up.
Test plan
-
bun run typecheck
-
bun test tests/server-live.test.ts (multipart rewrite, API-key path, no-provider 400, GET still 404, pool token override)
- Manual: ChatGPT / Codex App voice with ocx as injected base URL and ChatGPT login (or openai-apikey)
Summary by CodeRabbit
-
New Features
- Added
/v1/live and /v1/realtime/calls relaying for live requests to OpenAI and ChatGPT-compatible providers.
- Validates credentials, applies data-plane auth, blocks cross-origin requests, and forwards selected response headers with structured JSON errors.
-
Documentation
- Updated architecture “Request flow” endpoint list formatting for English and Chinese references.
-
Bug Fixes
- Extended CORS allow-headers to include
ChatGPT-Account-Id for voice preflight requests.
-
Tests
- Added end-to-end coverage for multipart rewriting, provider selection, CORS preflight, unavailable upstreams, and routing behavior.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Maintainer triage review (2026-07-24). The voice relay is incomplete as-is — two functional blockers:
High — the sideband WebSocket is missing. Only the POST call-create is relayed; /v1/live/{call_id} falls into the unknown-route 404 (src/server/index.ts:502-504,531-536). Upstream Codex always opens the sideband WebSocket with that call_id after call-create (codex-rs realtime_websocket/methods.rs:729-792,948-980), so the first request would flip from 404 to 201 and the actual voice session would still fail.
High — the ChatGPT-backend call-create query contract is missing. The PR creates bare /realtime/calls (src/server/live.ts:43-46,170-173), but current upstream Codex explicitly appends intent=quicksilver&architecture=avas for the backend + Frameless Bidi path (codex-rs realtime_call.rs:213-223). The tests only assert the path, so this gap is invisible (tests/server-live.test.ts:152-160).
Medium — buffering defeats the size limit. The request body is fully buffered unbounded (live.ts:99-102) and the response is fully read via arrayBuffer() before the 16 MiB check (live.ts:210-214) — incremental limiting is needed for the cap to protect memory.
Notes: the data-plane auth + origin checks and the admission-secret upstream block are correct (server/index.ts:512-516, auth-cors.ts:154-156). Since this is an auth/credential boundary, the rebuild also needs an explicit security review and a real Codex App voice E2E. Docs: ko/ja/ru architecture pages need the same update as en/zh.
Please rebuild on current dev with the sideband WebSocket relay + query contract, then re-request review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Avoid JSON 404 under Design B injection by forwarding call-create to ChatGPT
backend or an OpenAI API-key provider, rewriting API multipart to backend
realtime/calls JSON when needed (#371).
Accept /v1/realtime/calls, point API-key upstream at realtime/calls, allow
optional session and ChatGPT-Account-Id CORS, and record outcomes before
capping oversized live responses.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Rebuild /v1/live for maintainer triage: append intent=quicksilver&architecture=avas
on ChatGPT/API call-create, relay Frameless/Realtime sideband WebSockets, cap
request and response bodies incrementally, and sync architecture docs across locales.
Rebuild complete (maintainer triage)
Rebased onto current dev and addressed the blockers:
- Sideband WebSocket —
GET upgrade on /v1/live/{callId}, /v1/realtime/calls/{callId}, and /v1/realtime?call_id= now transparent-relays to the ChatGPT/OpenAI upstream (Frameless path append / Realtime query join).
- AVAS query contract — ChatGPT backend + keyed call-create now hit
...?intent=quicksilver&architecture=avas.
- Body caps — inbound request and upstream response both use incremental 16 MiB capped reads (not post-
arrayBuffer checks).
- Docs — en + zh-cn + ko + ja + ru architecture pages updated.
- Security review — no medium+ findings on auth/SSRF/callId injection/credential forwarding.
Tests: bun run typecheck + bun test tests/server-live.test.ts (10 pass), including bidirectional sideband relay.
Still recommended before merge: a real Codex App / ChatGPT voice E2E on a machine with ChatGPT login (not automated here).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 10, 2026
agentHits
pushed a commit
to agentHits/opencodex
that referenced
this pull request
Sep 17, 2026
…e voice relay + sideband WebSocket
Relay ChatGPT/Codex App voice (GPT-Live / Frameless Bidi) call-create and the
Frameless/Realtime sideband WebSocket so voice works under Design B injection (lidge-jun#371).
Verified green on top of dev: typecheck + live/auth tests + contract match vs codex-cli.
Reviewers
lidge-jun
Awaiting requested review from lidge-jun
lidge-jun is a code owner
Ingwannu
Awaiting requested review from Ingwannu
Ingwannu is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
bug
Something isn't working
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|