Skip to content

WebSocket upgrade succeeds then server closes with 1008 Policy (falls back to HTTPS) #13041

@kali113

Description

@kali113

Codex WebSocket fallback report (sanitized)

Summary

Codex websocket transport to wss://chatgpt.com/backend-api/codex/responses upgrades successfully and is then immediately closed by server policy (1008), leading to reconnect loop and fallback to HTTPS.

Environment

  • OS: Arch Linux (x86_64), kernel 6.18.9-arch1-2
  • Codex CLI: 0.106.0 (also reproduced on 0.107.0-alpha.5)
  • Node: v25.7.0
  • npm: 11.10.1
  • Auth: ChatGPT login mode
  • Features enabled:
    • responses_websockets_v2 = true
    • realtime_conversation = true
    • voice_transcription = true

Repro

codex exec -C /home/arch --skip-git-repo-check --json "Reply with exactly: WS_FINAL_CHECK"

Expected

Websocket transport should remain open and stream should proceed without fallback.

Actual

  • Reconnecting retries (2/5..5/5)
  • Fallback message:
    • Falling back from WebSockets to HTTPS transport. stream disconnected before completion...

Key sanitized evidence

INFO  connecting to websocket: wss://chatgpt.com/backend-api/codex/responses
INFO  successfully connected to websocket: wss://chatgpt.com/backend-api/codex/responses
DEBUG Received close frame: Some(CloseFrame { code: Policy, reason: Utf8Bytes(b"") })
... reconnect loop ...
Falling back from WebSockets to HTTPS transport ...

What was ruled out

  • Reproduces on stable + alpha codex CLI.
  • Reproduces on responses_websockets_v2 and legacy responses_websockets.
  • No HTTP_PROXY/HTTPS_PROXY env vars configured.

Attachments (sanitized)

  • Evidence is posted inline in issue comments (no local-file dependency).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions