codex icon indicating copy to clipboard operation
codex copied to clipboard

Remote Control repeatedly shows HTTP 400: Responses WebSocket messages must have type response.create

Open Ryanm218 opened this issue 6 days ago • 3 comments

Summary

Remote Control repeatedly shows an HTTP 400 Responses WebSocket protocol error, approximately every five minutes during use. This is a user-reported recurring problem; the interval has not been independently measured.

Exact error

Transcribed from the supplied screenshot:

{"type":"error","status":400,"error":{"type":"invalid_request_error","message":"Responses WebSocket messages must have type response.create."}}

Observed sequence

  1. Use Remote Control.
  2. The error above appears.
  3. Continue using Remote Control; the same error reportedly recurs approximately every five minutes.

The precise triggering action (including whether it follows steering, a reconnect, or an idle interval) has not been isolated.

Expected behavior

Remote Control should continue working without recurring Responses WebSocket protocol errors.

Environment

Local host inspected when preparing this report:

  • Codex app: 26.1117.41037, build 29803.
  • Bundled CLI: codex-cli 0.171.0-alpha.13.
  • macOS: 27.2, build 26B5091g.

Remote-client version and subscription tier have not been collected. The installed versions above are not proof of the server-side component responsible.

Related issue and diagnostic limits

Related: https://github.com/openai/codex/issues/52221 reports the identical error during desktop follow-ups and question-card replies. This report concerns recurring errors during Remote Control; a shared cause has not been established.

No outgoing WebSocket payload capture or controlled reproduction is available, so this report does not attribute the error to a particular message type, heartbeat, or timeout. The screenshot's full error is included above; private chat content, credentials, and raw session logs are omitted.

Ryanm218 avatar Nov 27 '26 23:11 Ryanm218

I'm interested in working on this — please assign it to me.

akhil9tiet avatar Nov 28 '26 01:11 akhil9tiet

I traced this to the client sending a frame the Responses WebSocket endpoint rejects.

Root cause: during Remote Control use, any mid-response interrupt sends {"type": "response.interrupt", ...} over the Responses WebSocket, and the server accepts only response.create on that socket — hence the recurring HTTP 400 invalid_request_error "Responses WebSocket messages must have type response.create".

Failing path (verified against main):

  • codex-rs/codex-api/src/endpoint/responses_websocket.rs, stream_responses_websocket(): after send_create() flushes and once response_id is known, the interrupt arm builds and queues {"type": "response.interrupt", "response_id": <id>, "mode": "discard_partial_items"} via ws_stream.queue_request() (~lines 1127–1140). This is the ONLY non-response.create message sent on this socket — the only other send site is send_create().
  • codex-rs/codex-api/src/common.rs: the ResponsesWsRequest enum (serde tag = "type") has a single variant, #[serde(rename = "response.create")] ResponseCreate(...), confirming the client models this socket as create-only.
  • The server-side error text matches exactly: the endpoint accepts only response.create, so the interrupt frame is rejected with HTTP 400.

Why it recurs: any mid-response interrupt (user steering, follow-up, or cancel while a response is in flight, i.e. response_id.is_some() && send_outcome == Flushed) fires this arm. That fits both this report (Remote Control steering) and #52221 (follow-ups / question-card replies interrupting an in-flight response).

Proposed fix (small, localized, one send site): in stream_responses_websocket() in codex-rs/codex-api/src/endpoint/responses_websocket.rs, do not send the response.interrupt frame on the Responses WebSocket — handle the interrupt client-side instead (drain/retire the socket without sending the frame, as the Cancel/Drain paths in common.rs ResponseInterrupt already distinguish), or gate the send on server support for response.interrupt. No other call site needs to change; send_create() is unaffected.

One caveat: the ~5-minute recurrence interval was not independently measured — the mechanism (interrupt frame → 400) is what I verified, not the exact trigger action in the reporter's session.

akhil9tiet avatar Nov 28 '26 01:11 akhil9tiet

Additional diagnostics from 2026-11-29 for the same exact protocol error. These are local Desktop runtime observations; they do not establish that every Remote Control occurrence has the same cause.

Environment rechecked: Codex Desktop 26.1117.41037, build 29803; bundled runtime 0.171.0-alpha.13; macOS 27.2, build 26B5091g.

A read-only query of retained codex_core::session::turn telemetry found 14 exact error occurrences across 9 threads on November 24, 27, and 29. This is a count within the retained local logs, not a measured recurrence interval.

Three occurrences on November 29 (UTC):

Time Model / effort Session
17:06:55 gpt-6.2-astra / medium Child agent
19:05:12 gpt-6-astra / medium Child agent
19:20:06 gpt-6-astra / high Main session

All three immediately followed completed tool calls and logged this continuation state before the error:

model_needs_follow_up=true
has_pending_input=true
needs_follow_up=true
full_context_window_limit_reached=false
token_limit_reached=false

Each then failed with:

{"type":"error","status":400,"error":{"type":"invalid_request_error","message":"Responses WebSocket messages must have type response.create."}}

Fresh and resumed gpt-6.2-astra Desktop child sessions subsequently completed native desktop tasks successfully, and independent CLI Astra requests also completed. The failure is intermittent and affects both parent and child sessions.

This corroborates the pending-input/continuation correlation in #52221. The current default-branch source also contains the response.interrupt send path described in the comment above: responses_websocket.rs, lines 1127-1143 (retrieved November 29, file blob b4d30345a2ac5cc5c696ca55938752bd124e147a). That is a plausible explanation, but the rejected outgoing frame from these installed-runtime failures was not captured, so this update does not prove its message type or a deterministic trigger.

No credentials, raw session logs, private conversation content, host identifiers, or session/response IDs are included. No local authentication, endpoint, model-routing, or WebSocket configuration was changed to obtain these observations.

Ryanm218 avatar Nov 29 '26 19:11 Ryanm218