Skip to content

auth.json automatically reuses the previous provider - Codex

Quick fix

Turn off the "keep the official login when switching to a third party" option in settings.

Error output
auth.json会自动复用上一个供应商的,导致添加新的供应商无法使用
English translation

auth.json automatically reuses the previous provider, so a newly added provider will not work

In cc-switch v3.16.1 and later, the Codex integration module has an auth state isolation defect. Clearing auth.json in the UI, or switching to or adding a provider, fails to reset or persist the empty state underneath — instead it wrongly caches and reuses the API key and login credential of the previous provider. The mechanism is closely tied to the "keep the official login when switching to a third party" feature: with it on, a new instance inherits the old credential, causing a broken login or an auth conflict.

  1. Open the cc-switch settings panel, find the "codex enhancement: keep the official login when switching to a third party" option, and turn it off.

  2. Quit the Codex process completely and restart it, then go into the plugin interface and log in again to apply a clean auth state.

ToolCodex
VersionUnknown
PlatformsWindows
Does turning that option off affect everyday use?
It does not affect core functionality. The switch controls only the auth caching behaviour when switching providers; with it off, each provider manages its own auth.json independently and credentials cannot cross over.
Does the problem still occur with the routing feature on?
Yes. Users report that with routing enabled, a newly added provider still reuses the old credential whether the switch is on or off. Turn routing off temporarily to investigate, or wait for upstream to fix the auth isolation in the routing module.
Does deleting the contents of auth.json by hand resolve it for good?
It works temporarily, but restarting Codex or switching providers again lets the faulty caching write the old credential back. The real fix is still turning the switch off in the settings panel.

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.