After switching, opening codex still uses the old account — Codex
Quick fix
After switching OAuth accounts, fully restart the Codex background service. For CLI, run codex app-server daemon stop, then reopen Codex.
Symptom
Section titled “Symptom”切换后打开 codex 继续用旧账号。After switching, opening codex still uses the old account.
Codex's resident `app-server` caches the OAuth token in memory. After CC Switch switches accounts and writes to `~/.codex/auth.json`, the already-running background service does not reread the file, so it continues using the old account. The maintainer explained that v4.0.6 can only prompt users to restart and cannot yet apply the switch automatically.
The thread also identified another mechanism: if the target account is absent from `~/.cc-switch/codex-login-stash.json` and exists only in the official profile record in `cc-switch.db`, the switching process may not write it to `auth.json`. This differs from the original report, where `auth.json` switched correctly. First check whether the login information on disk has changed, then determine whether the cause is background caching or a write-back failure. A Windows user on v4.0.9 also encountered a restart error because the daemon executable was not found.
After switching accounts, first check whether `~/.codex/auth.json` now contains the target account. If it has not changed, the problem is not merely background token caching; the target account may be missing from the login stash.
If `auth.json` switched correctly, run `codex app-server daemon stop` in a terminal, then reopen Codex so the new process reads the target account.
You can also run `pkill -f "codex app-server"` to terminate the existing background service. A macOS reporter confirmed that this immediately restored normal operation.
On Windows, if the old Codex process is still running, manually end it in Task Manager, then reopen Codex.
For the desktop app or editor plugin, fully quit and reopen it as prompted.
If v4.0.9 reports `daemon executable not found`, try running `codex app-server daemon start` in a terminal. The thread confirms only that the command runs successfully, not that it ultimately resolves the account-switching problem.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
- Why does v4.0.6 have no “Confirm restart” button and only show “Switch successful. Restart the client for the change to take effect”?
- The thread explains that this version was not designed with a restart button and only prompts users to restart manually. The maintainer also stated that this is only a mitigation and cannot make the switch take effect automatically.
- What information should I provide if the old account is still used after restarting as prompted?
- The maintainer requested the Codex version, usage type (command line, desktop app, or editor plugin), and the `cli_auth_credentials_store` setting.
- How can I apply the switched account on Windows?
- One user reported that the Codex process had to be closed manually in Task Manager. The maintainer said v4.0.6 prompts users to restart the background service, but the desktop app and editor plugin still need to be fully closed and reopened.
- What should I do if `daemon executable not found` appears, but `codex app-server daemon start` runs successfully?
- A v4.0.9 user reported this behavior, but the thread does not yet provide a confirmed final fix. You can first run the start command manually and continue monitoring the still-open issue.
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.