You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Add HTTPS-only Transport Option #27381
I'm getting random Codex freezes for 4 minutes when it's not doing anything after a prompt.
After some debugging seems like it's caused by websockets somehow, i.e. with this bit of config I never have freezes.
However the problem is that it messes with codex resume TUI -- it doesn't display my previous sessions, seems like sessions are tied to a model_provider. Even though you can resume explicitly by session id and it works fine with new provider.
Would be great to have an option to disable websockets.
Reacted by jskorlol, Răzvan Ionescu and DreamPiggy
+1 for an official HTTPS/SSE-only transport option.
Concrete data point from a recent Codex CLI session:
Codex CLI 0.142.2
WSL2 Ubuntu via Windows Terminal
Built-in OpenAI provider / ChatGPT auth, model gpt-5.5, high reasoning
No explicit HTTP_PROXY / HTTPS_PROXY env vars in the shell when inspected
In this setup, the WebSocket path intermittently fails with:
stream disconnected before completion: failed to send websocket request: IO error: Broken pipe (os error 32)
The important part: HTTP/SSE fallback succeeds, but only after the TUI spends several minutes on Reconnecting... 5/5. In one affected high-context session, the turn had ~4m56s time to first token and ~6m27s full duration. The local transcript was about 623 MB / 12,050 JSONL lines, with roughly 222k input tokens against a 258,400 context window.
For that kind of session, the retry budget is a very expensive tax on every affected turn. We would use a built-in option immediately, for example:
codex --transport=https
transport = "https" in config
or supports_websockets = false for the built-in OpenAI provider
The custom-provider workaround is not a great fit when the existing setup uses the built-in OpenAI provider / ChatGPT auth and shared project config. A first-class HTTPS-only switch would make Codex much more usable in environments where WebSockets are flaky but HTTPS/SSE works reliably.
+1 to this issue from the gateway/proxy angle, plus offering a patch. (against Codex CLI 0.152.0)
We route Codex through a local enterprise gateway. The only way to keep Codex's built-in openai provider - which we need, because the provider id is recoded per-thread and drives resume/picker listing - is openai-base-url. That provider is WebSocket-capable, our gateway doesn't implement the Responses WebSocket transport, so every session pays the full backoff (to HTTP) cost: ~5-7sec. Users see ERROR codex_api::endpoint::responses_websocket seven times and then a warning attributing it to OpenAI demand, which is misleading.
Accepted silently, no effect (stage removed, per #38638)
Answering the upgrade 404 rather than 500
Still 7 attempts; only the warning text changes
Per @karlicoss 's comment above, we can define a custom provider with supports_websockets = false and hit exactly the problem they described: threads get tagged with the custom provider id in ~/.codex/state_5.sqlite, and since selection filters on model_provider (there's an index on it), pre-existing sessions vanish from codex resume --last and the picker. Resume by explicit id still works and loads full history; it's the listing that filters.
Therefore, the current tradeoff today is fast startup or your session history showing up, not both.
Suggested fix
Matching what this issue already suggests: allow model_providers.openai to override onlysupports_websockets and nothing else. This pattern has already been demonstrated with field-limited overide in amazon-bedrock providers for merged_configured_model_providers.
validate_openai_provider_override enforces the single-field limit, wired into both the merge path and validate_model_providers so a bad override fails at config write/load rather than during merge
supports_websockets becomes Option<bool> with a supports_websockets() accessor, matching the existing request_max_retries() pattern on that struct. This matters: as a plain bool with #[serde(default)], an empty or misspelled [model_providers.openai] table is indistinguishable from supports_websockets = false and would silently disable the transport
Tests: explicit false disables, explicit true keeps it, empty table and misspelled key leave it untouched, any other field is rejected. Verified end-to-end against a loopback listener: 0 upgrade attempts with the override, 7 without
Activity
cyrusmg commentedon Jun 18, 2026
This also happens on my Hetzner VM. Having a way to disable websockets transport would be great.
karlicoss commentedon Jun 24, 2026
I'm getting random Codex freezes for 4 minutes when it's not doing anything after a prompt.
After some debugging seems like it's caused by websockets somehow, i.e. with this bit of config I never have freezes.
However the problem is that it messes with
codex resumeTUI -- it doesn't display my previous sessions, seems like sessions are tied to a model_provider. Even though you can resume explicitly by session id and it works fine with new provider.Would be great to have an option to disable websockets.
simfor99 commentedon Jun 26, 2026
+1 for an official HTTPS/SSE-only transport option.
Concrete data point from a recent Codex CLI session:
gpt-5.5, high reasoningHTTP_PROXY/HTTPS_PROXYenv vars in the shell when inspectedIn this setup, the WebSocket path intermittently fails with:
stream disconnected before completion: failed to send websocket request: IO error: Broken pipe (os error 32)The important part: HTTP/SSE fallback succeeds, but only after the TUI spends several minutes on
Reconnecting... 5/5. In one affected high-context session, the turn had ~4m56s time to first token and ~6m27s full duration. The local transcript was about 623 MB / 12,050 JSONL lines, with roughly 222k input tokens against a 258,400 context window.For that kind of session, the retry budget is a very expensive tax on every affected turn. We would use a built-in option immediately, for example:
codex --transport=httpstransport = "https"in configsupports_websockets = falsefor the built-in OpenAI providerThe custom-provider workaround is not a great fit when the existing setup uses the built-in OpenAI provider / ChatGPT auth and shared project config. A first-class HTTPS-only switch would make Codex much more usable in environments where WebSockets are flaky but HTTPS/SSE works reliably.
karlicoss commentedon Jun 26, 2026
Follow up for this: #27381 (comment)
After some debugging, seemed like the problem was with ipv6 specifically for some reason. I solved that by pinning ipv4 addresses in
/etc/hosts.bbednarski9 commentedon Sep 2, 2026
+1 to this issue from the gateway/proxy angle, plus offering a patch. (against Codex CLI 0.152.0)
We route Codex through a local enterprise gateway. The only way to keep Codex's built-in
openaiprovider - which we need, because the provider id is recoded per-thread and drives resume/picker listing - isopenai-base-url. That provider is WebSocket-capable, our gateway doesn't implement the Responses WebSocket transport, so every session pays the full backoff (to HTTP) cost: ~5-7sec. Users seeERROR codex_api::endpoint::responses_websocketseven times and then a warning attributing it to OpenAI demand, which is misleading.Per @karlicoss 's comment above, we can define a custom provider with supports_websockets = false and hit exactly the problem they described: threads get tagged with the custom provider id in
~/.codex/state_5.sqlite, and since selection filters on model_provider (there's an index on it), pre-existing sessions vanish from codex resume--lastand the picker. Resume by explicit id still works and loads full history; it's the listing that filters.Therefore, the current tradeoff today is fast startup or your session history showing up, not both.
Suggested fix
Matching what this issue already suggests: allow
model_providers.openaito override onlysupports_websocketsand nothing else. This pattern has already been demonstrated with field-limited overide inamazon-bedrockproviders formerged_configured_model_providers.I have this implemented and tested against tag rust-v0.152.0 and can open a PR if the shape sounds right — branch: https://github.com/bbednarski9/codex/tree/ask-b-ws-override
validate_openai_provider_overrideenforces the single-field limit, wired into both the merge path andvalidate_model_providersso a bad override fails at config write/load rather than during mergesupports_websocketsbecomesOption<bool>with asupports_websockets()accessor, matching the existingrequest_max_retries()pattern on that struct. This matters: as a plain bool with#[serde(default)], an empty or misspelled[model_providers.openai]table is indistinguishable fromsupports_websockets = falseand would silently disable the transportNotes
openai_base_urlshould imply no WebSocket support. That would silently downgrade endpoints that do support the transport, and I take @etraut-openai's point in Responses WebSocket connect failures wait through all stream retries before HTTP fallback #19821 that the default should stay WebSocket-first.jfscoertzen commentedon Sep 17, 2026
ionescu77 commentedon Sep 18, 2026
This is really annoying problem for me too. OpenAI backend is barely usable this week.
I am considering switching back to Claude for my Nanoclaw project.
Never had this problems with the Nanoclaw Claude SDK based transport.
chenjianjx commentedon Oct 1, 2026
This should be high priority, Sir. Lots of people have to use a proxy.