WebSocket client ignores x-codex-turn-state in codex.response.metadata
I maintainer di solito rispondono entro 1 giorno
@akhil9tiet ci sta già lavorando.
Dal 28/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- cli, networking
Direzione di ricerca
Inizia dalla guard del parser in codex-rs/codex-api/src/sse/responses.rs e dal contratto di routing dello stesso turno in codex-rs/core/src/client.rs. Estendi il fixture in codex-rs/core/tests/suite/turn_state.rs in modo che l’evento di metadati usi codex.response.metadata, quindi esegui quel test. È completo quando il token viene riproposto nello stesso turno, viene reimpostato al turno successivo e il comportamento esistente di response.metadata continua a superare il test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What version of Codex CLI is running?
Reproduced with codex-cli 0.172.0 on Linux using a synthetic WebSocket provider on loopback. The same parser guard is present on main at 065e18b04021008e2e7d504db8dc50275f589f73. The fixture uses no subscription or API credentials.
What issue are you seeing?
A codex.response.metadata event can supply an x-codex-turn-state header. ResponsesStreamEvent::turn_state() only reads headers on response.metadata, so the WebSocket client discards the token and omits it from client_metadata on the same-turn tool continuation. It replays the same synthetic token when only the event type changes to response.metadata.
What steps can reproduce the bug?
Use a loopback Responses WebSocket fixture with no turn-state header on the upgrade response. Send this event before the first generation's synthetic tool call, then let the tool call complete and inspect the next response.create on the same socket.
{"type":"codex.response.metadata","headers":{"x-codex-turn-state":"synthetic-turn-state"}}
Repeat in a fresh session with the event type changed to response.metadata. Both runs completed over one socket. There were two generation requests per run after excluding prewarm.
| Incoming metadata event | Turn state on the outgoing tool continuation |
|---|---|
response.metadata |
synthetic-turn-state |
codex.response.metadata |
Absent |
The in-tree websocket_turn_state_persists_within_turn_and_resets_after test provides an equivalent regression fixture. Add a variant that replaces the first turn's response.metadata event with codex.response.metadata and keeps the existing replay and next-turn reset assertions.
What is the expected behavior?
Accept turn state from the WebSocket metadata event and replay the first token on subsequent requests within the same turn. Preserve the existing behavior for response.metadata and clear state at the next turn boundary.
Additional information
- Current parser guard
- Same-turn routing contract
- Related to #30536, which tracks the missing header on the WebSocket upgrade. This repro targets the parser when the token arrives after the upgrade. It makes no claim about the cause of an intermittent cache miss.
- Lingua principale
- Rust
- Stelle
- 136k
- Fork
- 21.6k
- Merge medio
- 1m
- PR unite (30g)
- 999
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openai/codex
-
bug CLI subagent
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug CLI exec subagent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug CLI subagent
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Bug: codex exec --json silently drops SendMessage, FollowupTask, InterruptAgent, and ListAgents collab_tool_call itemsForse già presa @akhil9tiet l’ha presa oggi. Apertabug CLI exec subagent
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openai/codex#64533 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug CLI
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openai/codex
Issue simili
-
nightly-cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
max-sixty/worktrunk#4939 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursApertaflaky
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stacks-network/stacks-core#7918 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
New Mutants FoundAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rust-bitcoin/rust-bech32#339 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
databendlabs/openraft#2554 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
autofixer: follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tursodatabase/turso#12683 ·
I maintainer di solito rispondono entro 1 giorno