Context
Mirrors upstream bug: openai#1481
On first message after codex login, users get repeated streaming errors:
"stream error: stream disconnected before completion: stream closed before response.complete; retrying …"
Hypothesis
Initial session/bootstrap call or first streaming request handling has a race or transport retry edge case. Reported across macOS/Windows and various Node versions (per upstream thread).
Acceptance Criteria
- Repro steps documented and automated repro added
- Root cause identified (transport, retry policy, auth bootstrap, or model routing)
- Fix implemented with resilient retry/backoff and correct terminal feedback
- Tests cover first-message path and regression on reconnects
- Verified on macOS and Linux; Windows sanity check
Refs: #6, upstream: openai#1481
Context
Mirrors upstream bug: openai#1481
On first message after
codex login, users get repeated streaming errors:"stream error: stream disconnected before completion: stream closed before response.complete; retrying …"
Hypothesis
Initial session/bootstrap call or first streaming request handling has a race or transport retry edge case. Reported across macOS/Windows and various Node versions (per upstream thread).
Acceptance Criteria
Refs: #6, upstream: openai#1481