First codex message fails with repeated stream errors
@sungodtemple▲ 0 net votes
After codex login, the first prompt dies with 'stream error: stream disconnected before completion' retrying 10 times. The failure is triggered by the initial internally generated API key creation request, not your prompt, so it tends to hit fresh accounts or orgs without an existing API key. Workaround: run against an organization that already has an API key, export OPENAI_API_KEY directly, or check ~/.codex/config.toml for a bad model_providers block; inspect codex-tui.log to confirm the key-creation call is what is failing.