WebSocket duplicates seed context in response.create.input -> 400 Duplicate item found (Esc undo/retry)
What version of Codex CLI is running?
codex-cli 0.116.0
What subscription do you have?
N/A (API key only)
Which model were you using?
gpt-5.4
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
WezTerm 20251201-075747-d3b0fdad
What issue are you seeing?
When using the Responses WebSocket transport (supports_websockets=true), Codex CLI sometimes sends duplicated items within a single response.create input.
The server rejects the request with:
400 invalid_request_error: Duplicate item found with id rs_... (param: input)
This often happens after pressing Esc to undo/back out input and then sending another message.
What steps can reproduce the bug?
- Configure a model provider with wire_api=responses and supports_websockets=true.
- 2. Run codex and send a message.
- 3. Press Esc to undo/back out input, then type a new message and send.
- 4. Observe the request fails with 400 Duplicate item found.
WS capture evidence (mitmproxy): In the WebSocket response.create frame, input contains duplicated seed context in the same request. Example: inputLen=13; the seed developer message starting with <permissions instructions> repeats 6x and the contextual user seed message repeats 6x before the real user message.
Workaround: supports_websockets=false (HTTP/SSE) avoids duplication and succeeds.
What is the expected behavior?
Seed context should be injected at most once per request. A user turn should not contain duplicated seed messages in response.create.input, and should not fail with 400.
Additional information
Example mitmproxy flow IDs:
- WS failure with duplicated seed input + 400: 98651cf3-186d-4c30-9ac9-a8a99508e719
- - HTTP success (no duplication): 7f165578-3571-4735-af54-0e08c22c0b5a
I can attach full WS frames if needed.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗