Recently, while using Codex, I encountered a very annoying problem: every time I execute /new, it first tries to reconnect 5 times before finally starting to respond normally after a long wait.
After searching around, I finally found a solution and will document it here.
Solution Steps
1. Locate the Configuration File
Navigate to the Codex installation directory and find:
config.toml

2. Modify the Configuration
Open config.toml and add the following content (note the use of English quotes):
Add at the very top of the file:
model_provider = "openai_https"
Add at the very bottom of the file:
[model_providers.openai_https]
name = "OpenAI"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false3. Restart Codex
After saving the file, restart Codex for the changes to take effect.
Explanation of the Cause
By default, Codex uses the WebSocket protocol for communication:
- It first attempts to connect via WebSocket.
- If it fails, it automatically reconnects 5 times.
- Each timeout is approximately 20 seconds.
Finally, it falls back to HTTP.
This is why you experience the "long wait before responding" situation.
The configuration above essentially does the following:
✅ Forces the use of HTTP (disables WebSocket)
Important Notes
There will be a minor side effect after the modification:
- Your history records will appear "missing" (though they are not actually deleted).
The reason is:
- Codex distinguishes between built-in providers and custom providers.
- History records are bound to their respective providers.
We have essentially added a new provider.
Solution:
- To view your history → simply remove this configuration section to restore it.
Reference Documentation
GitHub Issue:
https://github.com/openai/codex/issues/14297