WebSocket client ignores x-codex-turn-state in codex.response.metadata
Maintainer thường phản hồi trong vòng 1 ngày
@akhil9tiet đang làm issue này rồi.
Từ ngày 28/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- cli, networking
Hướng nghiên cứu
Bắt đầu với parser guard trong codex-rs/codex-api/src/sse/responses.rs và hợp đồng định tuyến trong cùng lượt trong codex-rs/core/src/client.rs. Mở rộng fixture trong codex-rs/core/tests/suite/turn_state.rs để sự kiện metadata sử dụng codex.response.metadata, sau đó chạy test đó. Hoàn tất khi token được phát lại trong cùng lượt, được đặt lại ở lượt tiếp theo và hành vi hiện có của response.metadata vẫn vượt qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 136k
- Fork
- 21.6k
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 999
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/codex
-
bug CLI subagent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI exec subagent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI subagent
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: codex exec --json silently drops SendMessage, FollowupTask, InterruptAgent, and ListAgents collab_tool_call itemsCó thể đã có người làm @akhil9tiet đã nhận hôm nay. Đang mởbug CLI exec subagent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openai/codex#64533 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
nightly-cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
max-sixty/worktrunk#4939 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursĐang mởflaky
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
stacks-network/stacks-core#7918 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
New Mutants FoundĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rust-bitcoin/rust-bech32#339 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
databendlabs/openraft#2554 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
autofixer: follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tursodatabase/turso#12683 ·
Maintainer thường phản hồi trong vòng 1 ngày