[Feature]: Temporarily prefer HTTP/SSE for subsequent Codex pool requests after repeated upstream WebSocket disconnects
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start by tracing the canonical ChatGPT/Codex upstream transport selection in account-pool mode and the existing retryOnReset handling described in issue #4191. The change needs route and account scoped cooldown state, expiry probing, and transport reason logging while preserving replay and account selection rules. Done means eligible later requests prefer HTTP/SSE after repeated qualifying disconnects, then probe WebSocket after expiry; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Description
Area
Canonical ChatGPT/Codex upstream transport in account-pool mode.
What are you trying to accomplish?
Keep WebSocket available for connection reuse and native mid-turn steering where the route is healthy, while avoiding repeated WebSocket failures on the same route. The transport decision should apply to a later, independently submitted request and preserve the pool's existing account selection and replay rules.
Observed behavior
On macOS with Codex Desktop, OpenCodex 2.100.4, a pinned Pro pool account, and GPT-6.2 Sol in Fast mode, three requests from the same long-running conversation had this result:
| Client request body | Upstream transport | Upstream / relayed events | Pong replies | Close | Gateway result |
|---|---|---|---|---|---|
| 8,517,884 bytes each | WebSocket | 0 / 0 | 0 after 6 pings | 1011 | 502 after about 83–86 s each |
After setting providers.openai.upstreamWebsocket=false, the same conversation, account and model recorded 138 successful requests in a roughly 12-minute observation window on the same OpenCodex version. Of those, 33 had client request bodies at least as large as the failed requests. This is a before/after observation from normal work, with different request contents and no controlled proxy-node comparison. The actual source of the reset and any size threshold remain undetermined. On 2.100.5, the provider-wide switch still selects HTTP/SSE.
What should OpenCodex do?
- Consider an opt-in transport cooldown scoped to the selected account and upstream route/egress. After repeated upstream WebSocket disconnects that occur after send and before any response event, prefer HTTP/SSE before dispatching subsequent requests on that route. Leave other accounts and routes on their usual transport.
- When the cooldown expires, let one otherwise eligible new request probe WebSocket and resume normal selection after a successful exchange. Keep the explicit provider-wide HTTP/SSE override authoritative.
- Log the selected upstream transport and the cooldown reason, including failure stage and close code where available. Preserve the existing decision on whether an already-sent request can be replayed. A missing response event alone cannot tell us whether upstream accepted the request.
#4191 closed after adding a conditional single HTTP/SSE replacement for an eligible current request under retryOnReset. A comment on that issue independently describes a temporary SSE preference for subsequent requests. This proposal is for that transport selection policy, with another observed case and no change to account switching or cross-account cache isolation.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 814
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
bug gui platform
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#9172 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log linePossibly taken @EnesKartal claimed this 4 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#9057 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersPossibly taken @sedoll claimed this 6 days ago. Opencatalog provider provider-compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lidge-jun/opencodex#9037 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug cli
Difficulty 4/5 3-5 days Newbie friendliness 52/100
lidge-jun/opencodex#9171 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
account-pool enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
ranxianglei/billion-context#7860 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
agent-oc-find-bugs api complexity → simple payment-methods recurring contributions reviewed stripe
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencollective/opencollective#9177 ·