Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ Sign in with your **ChatGPT Plus/Pro account**, not an OpenAI API account. The
token file includes the extracted `chatgpt_account_id` so the proxy can set the
`ChatGPT-Account-Id` header on every upstream call.

When no proxy-owned credential exists, the proxy can bootstrap from the native
Codex CLI's `~/.codex/auth.json`. Treat that as a migration convenience, not a
long-term shared credential: OAuth refresh tokens can rotate, so two concurrent
writers can strand one another. If native Codex and this proxy run on the same
machine, complete `codex auth login` or `codex auth device` once so the proxy has
its own OAuth session.

#### `codex auth device`

Same OAuth flow, but for headless machines. Prints a short user code and a URL;
Expand Down Expand Up @@ -727,7 +734,22 @@ affecting other keys.
Codex uses the WebSocket Responses transport by default. Set
`CCP_CODEX_TRANSPORT=http` to use the older HTTP SSE transport for debugging or
compatibility, or `CCP_CODEX_TRANSPORT=auto` to try WebSocket with HTTP fallback
only when setup fails before a request is sent upstream.
after any retryable WebSocket transport failure.

`auto` also acts as a completion-gated reliability mode: it buffers a complete
WebSocket response before sending Anthropic events to Claude Code and safely
falls back from WebSocket to HTTP after a retryable WebSocket failure, then
retries statusless transport failures up to three times with jittered exponential
backoff while nothing has reached the client. Retry and exhaustion events are
written as structured `buffered_transport_retry*` log records. This prevents
duplicate tool calls after a partial upstream stream, at the cost of delaying
visible reasoning, text, and tool events until the Codex response finishes. Use
`auto` when unattended completion matters more than live token streaming. A
WebSocket transport failure keeps that proxy instance on HTTP for 60 seconds,
and the complete buffered operation has a 10-minute wall-clock limit. Incoming
request bodies also have a 30-second read deadline so an abandoned upload cannot
leave a proxy request wedged indefinitely.

`CCP_CODEX_PREVIOUS_RESPONSE_ID=1` enables opt-in WebSocket continuation for
append-only turns. Continuation keeps in-memory state keyed by Claude Code
session id, reuses a session WebSocket while it remains open, and sends
Expand Down
Loading