WebSocket client ignores x-codex-turn-state in codex.response.metadata
Los mantenedores suelen responder en 1 día
@akhil9tiet ya está trabajando en esto.
Desde el 28/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 88/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- cli, networking
Línea de trabajo
Comienza con el guard del parser en codex-rs/codex-api/src/sse/responses.rs y el contrato de enrutamiento del mismo turno en codex-rs/core/src/client.rs. Amplía el fixture en codex-rs/core/tests/suite/turn_state.rs para que el evento de metadatos use codex.response.metadata, y luego ejecuta esa prueba. Estará terminado cuando el token se reproduzca dentro del mismo turno, se reinicie en el siguiente turno y el comportamiento existente de response.metadata siga pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 136k
- Forks
- 21.6k
- Merge medio
- 1 min
- PR fusionados (30 d)
- 999
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openai/codex
-
bug CLI subagent
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug CLI exec subagent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug CLI subagent
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Bug: codex exec --json silently drops SendMessage, FollowupTask, InterruptAgent, and ListAgents collab_tool_call itemsPosiblemente ocupada @akhil9tiet la tomó hoy. Abiertobug CLI exec subagent
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openai/codex#64533 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug CLI
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
Todos los issues de openai/codex
Issues similares
-
nightly-cleanup
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
max-sixty/worktrunk#4939 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursAbiertoflaky
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
stacks-network/stacks-core#7918 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
New Mutants FoundAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rust-bitcoin/rust-bech32#339 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
databendlabs/openraft#2554 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
autofixer: follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tursodatabase/turso#12683 ·
Los mantenedores suelen responder en 1 día