Codex unavailable: reconnect failed 5 times
Quick fix
After switching providers, verify and re-enter the current provider's API Key; API Key overwrite reports continued in v3.16.3.
Symptom
Section titled “Symptom”Codex无法使用,重连5次失败。Codex unavailable; reconnect failed 5 times.
On Windows, after Codex switches to third-party providers such as DeepSeek, OpenRouter, or Xiaomi MiMo and local routing is enabled or disabled, the current provider's API Key may be overwritten by another provider's Key, preventing Codex from connecting. A maintainer said this should be fixed in v3.16.2, but users later reported the same behavior in v3.16.2 and v3.16.3, so the fix status is inconsistent.
The same cluster also includes reports where Zhipu GLM shows “query failed” while the API works. The discussion suggests that usage queries default to Coding Plan; users without Coding Plan may see query failures while direct API tests work. One user also reported that deleting and re-adding the Zhipu configuration restored access.
After switching providers or enabling or disabling routing, open the current provider configuration and confirm that its API Key has not changed to another provider's Key.
If the API Key was overwritten, re-enter the current provider's API Key. One report says it must be re-entered after every provider switch.
If Zhipu GLM only shows “query failed,” check “Enable usage query” in “Configure usage query” and its default Coding Plan request. If direct API tests work, this message does not necessarily mean the API is unavailable.
If the Zhipu GLM configuration cannot be used, delete it and add it again. One user reported that this restored access.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- Can this still happen after upgrading to v3.16.2?
- Users reported that it still occurred after upgrading to v3.16.2; there was also an API Key overwrite report in v3.16.3.
- Can the API still work when Zhipu GLM shows “query failed”?
- One report says using the same API Key and model name through curl returned normally; the discussion notes that the default usage query may request Coding Plan.
- Can deleting and re-adding Zhipu GLM solve it?
- One user reported that reinstalling cc-switch did not help, but deleting and re-adding the Zhipu configuration worked.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.