Repository navigation
feat(chatgpt): support Codex images, review, and public Live routes - #40366
jibanez-staticduo wants to merge 110 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 16 · PR risk: 0/10 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bce8aa1dcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@greptileai @codex review Updated security validation, image file handling, provider placement, and gateway routes; local checks and both deployment probes pass. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58a5657784
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@greptileai Please review 93285ed: provider transformations and FastAPI handlers are separated. Both deployed instances passed real image, review, and voice probes |
|
@greptileai Please review 8e5901e. Live transport now uses model metadata; both deployments and the isolated proxy passed fresh image, review, and voice probes |
|
@greptileai Please review d5f3528. Sideband policy enforcement and supported WebSocket credentials passed real provider probes on both deployments before this update |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5f352823b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@greptileai Please re-review 06b2d76: the ChatGPT provider tests moved into the sharded |
|
@greptileai Please review 94a4929: fixed the shared catalog and Interactions contract tests. Both focused suites and test-quality gates pass locally |
Merge upstream cbe6972 while preserving image, structured review, Realtime, and public Live behavior Deduplicate the eight shared ultrafast catalog schema properties without loosening constraints, and regenerate dashboard types for the optional trace_ref parameter Validated 1588 focused regressions, 163 merge-overlap tests, the catalog regression, and the Redis TTL test against temporary Redis. Full make check passes after resolving catalog duplicates and generated type drift
|
@greptileai Please review this updated tip after merging upstream main, focusing on authorization, Live accounting, signaling, and supervisor cleanup |
5f70abe to
c33110c
Compare
1c3f1bb to
c33110c
Compare
|
@jibanez-staticduo — the Proof of Fix section notes that end-to-end evidence is still pending. Could you add a screenshot or short video showing that this change works as expected (e.g. Codex image input / review and a public Live route working through the proxy)? It really helps reviewers verify the fix quickly. Thanks! |
32eba7a to
82d2d6d
Compare
|
@jibanez-staticduo bumping the proof of fix! |
TLDR
Problem this solves:
How it solves it:
Intentional product change: legacy JSON SDP handles are rejected with HTTP 401 before OAuth lookup or routing. Clients must create fresh session handles; ordinary OpenAI ephemeral credentials keep their existing behavior
User Flow
Before: a developer can generate an image, but editing it fails
gpt-image-2as achatgpt/gpt-image-2deployment using existing ChatGPT OAuth credentialsPOST http://localhost:4000/v1/images/generationswith a blue-circle prompt and receive HTTP 200 with a base64 PNGPOST http://localhost:4000/v1/images/editswith that image in the JSONimagesarray and a red-circle promptaimage_edit() missing 1 required positional argument: 'image'POST http://localhost:4000/v1/realtime/callswith the ordinary proxy key and receive HTTP 401After: the same developer receives the edited image
gpt-image-2as achatgpt/gpt-image-2deployment using existing ChatGPT OAuth credentialsPOST http://localhost:4000/v1/images/generationswith a blue-circle prompt and receive HTTP 200 with a base64 PNGPOST http://localhost:4000/v1/images/editswith that image in the JSONimagesarray and a red-circle promptPOST http://localhost:4000/v1/realtime/callswith the same key, using JSON or multipart regardless of media-type capitalization, and receive HTTP 201; requests outside personal permissions or model budgets are deniedThese flows describe the supported request contract. Fresh real-provider before/after evidence for the current tip is still unavailable
Implementation
Adds ChatGPT OAuth image generation and JSON/file image editing, strict Responses schemas, and voice. Image routes preserve the selected model and quality, nested JSON parameters, and
extra_bodyprecedence. Multipart edits retain their encoding. Provider bodies exclude local ChatGPT authentication options. Cached text and image costs use separate modality rates when reported. Provider configuration stays separate from proxy authentication, and lazy WebSocket imports keep ordinary SDK calls independent of proxy dependenciesConfigured gateway headers and repeated query parameters survive signaling, call state, attachment, and hangup. Configured routing wins over permitted client protocol parameters; call identity and OAuth credentials remain authoritative. Custom key-header selection is consistent across authentication and ownership checks. JSON and multipart media types are case-insensitive. Multipart session authorization uses the model actually signaled, shares parsed forms with custom authentication, invalidates stale body caches, and closes uploads. Generic OpenAI header overrides and ephemeral credentials retain their behavior
A proxy-owned observer starts before SDP is returned and accounts independently of client attachments. V3 signaling transfers its parallel slot to a renewable call-supervisor lease; reconnects retain policy checks without acquiring another slot or duplicating spend. Lost lease ownership terminates the call. Redis Cluster reservations retain ownership and compensate partial acquisition. Legacy attachment counters decrement atomically; signaling with legacy parallel limits requires the V3 limiter and returns HTTP 400 otherwise
Shutdown closes supervisors before draining spend, counters, and logging. Cancellation waits for bounded cleanup, including repeated cancellation. Provider termination has 60 seconds, usage drain five seconds, and logging dispatch its existing 20-second default. Live reserves half the termination window for an independent hangup attempt. Missing terminal usage or invalid duration invalidates reservation counters instead of settling unknown spend to zero. Callback completion does not guarantee persistence if downstream errors are swallowed
Codex offers have an 8 MiB byte limit before parsing, authentication, or temporary-file creation. GPT-Live terminal duration remains authoritative alongside token events and uses the selected deployment's per-second price. Encrypted handles bind deployment identity and supervision state. Legacy JSON SDP handles are rejected before OAuth lookup or routing; generic OpenAI ephemeral credentials remain accepted. Authentication uses upstream's existing
CHATGPT_TOKEN_DIRandCHATGPT_AUTH_FILEPublic GPT-Live routes
This update adds the public Live protocol alongside the existing Codex signaling routes. OpenAI deployments use their configured API key; ChatGPT deployments retain the existing proxy OAuth credentials. Supporting the route contract does not guarantee that every OAuth account or backend supports every operation
/v1/live/sessions/v1/live/sessions/{session_id}/attach/v1/live/sessions/{session_id}/fork/v1/live/sessions/{session_id}/content/v1/live/sessions/{session_id}/accept/v1/live/sessions/{session_id}/reject/v1/live/sessions/{session_id}/refer/v1/live/sessions/{session_id}/hangupThe same routes have
/liveand/openai/v1/livealiases. Public WebRTC creation uses JSON; Codex multipart/raw SDP signaling remains available atPOST /v1/live. Primary WebSockets start withsession.start. Attachment sockets require neither a new start event nor a replayedsession.startedeventSession handles conceal upstream credentials and bind controls to their owner and selected deployment. Managed delegation checks the backend model as well as the voice model. Restricted keys forking a managed session must supply an explicit authorized backend model, since later session updates can make the initial model stale. Client-delegation forks retain their immutable delegation type and may use empty overrides. Sparse sideband updates can retain the current backend model. Keys requiring per-invocation backend budgets or rate limits must use client delegation. Incoming SIP enrollment requires a proxy administrator and an unambiguous configured model alias
Configure Codex through LiteLLM
The ChatGPT provider guide includes LiteLLM deployment examples and Codex configuration for text models, image generation/editing, and voice
Keep the Codex ChatGPT login for client capability checks, use a LiteLLM virtual key to authenticate to the gateway, and configure ChatGPT OAuth separately on the proxy. Qwen text requests use the selected LiteLLM alias; images and voice require their own authorized aliases and capable deployments. Restricted keys and team members must allow every requested alias. Selecting a text model does not make it an image or voice model
Set the root
experimental_realtime_ws_base_urlso voice sideband connections return to the same gateway as signaling. Otherwise, Codex can send the offer through LiteLLM and attempt to attach directly to OpenAI using a proxy-owned call ID.experimental_realtime_webrtc_call_base_urlseparately overrides HTTP signaling when needed. Image requests use the active provider'sbase_urlRelevant issues
Related to #40888; this adds its public route contract but does not claim complete real-provider validation of recording, forks, or SIP
Protocol reference: OpenAI Codex and OpenAI Live
Affected release
Linear ticket
Pre-Submission checklist
At
966b047dd5ff7e67b6afe4156172c1e3d53ba0fa, the branch includes upstream0980f756bd031993329eb0b8b2caa193047e6465and is mergeable.make checkpasses against that upstream snapshot, including Python lint and type budgets, test quality, E2E types, dashboard lint, and API-type synchronization. Coverage thresholds, lint budgets, and signature verification remain unchangedFinal local validation passes 570 focused tests and seven SDP regression tests. The SDP regression tests cover rejection before OAuth lookup or routing and preserve generic OpenAI ephemeral credentials. The former High-severity legacy-handle finding is fixed in this tip
Current-tip
codecov/patchand Veria pass. The remoteproxy-behaviorjob fails only while uploading Lens coverage: Codecov CLI 11.3.1 cannot import its GPG key and reportsNo public key, matching codecov-action#1876. An attempted workflow rerun was rejected because it requires repository-admin rights. Therust-testcheck is cancelled rather than passed, so required CI remains incompleteGreptile's visible 5/5 belongs to
8c9367ba8d, not this tip. Current-tip Greptile confirmation is unavailable, and Bugbot has no visible result. Maintainer review has not been requestedScreenshots / Proof of Fix
Fresh before/after captures against the merge base and this exact public tip are unavailable. Local regression checks and live deployment smoke checks do not replace headful Codex, image-edit, and voice-session evidence
Type
New Feature, Bug Fix, Documentation, Test
Caveats (if any)
Severe
Medium
Low
Final Attestation