Skip to content

switch has no effect on Codex CLI while the shared app-server daemon is running #162

Closed

Description

@codejunkienick

Environment: codex-auth 0.3.0, codex-cli 0.158.0, Linux x64

Recent Codex CLI versions start a shared background app-server daemon (codex app-server daemon), and new codex TUI sessions attach to it by default (--no-daemon opts out). The daemon loads auth.json once at startup and keeps the account in memory.

So after codex-auth switch:

  • ~/.codex/auth.json and registry.json are updated correctly
  • quitting and relaunching codex, as the README suggests, still uses the old account, because the daemon is still running
  • the switch only takes effect once the daemon restarts (codex app-server daemon restart)

From the user's side it looks like switch silently does nothing.

Repro

  1. Run codex (this starts the daemon), then quit
  2. codex-auth switch <other account>
  3. Run codex again: /status still shows the previous account

Suggestion

When the daemon is running ($CODEX_HOME/app-server-control/app-server-control.sock resolves), print a hint after Switched to ... pointing at codex app-server daemon restart. This is less invasive than killing Codex processes (#149), which would also end every running CLI session.

Related: #85 (same cause, via Codex App remote connections), #149.

Activity

  1. mdbaniani commented on Sep 28, 2026

    @mdbaniani

    apparently running this after a switch would help codex recognize the switched account : codex app-server daemon restart

  2. obackhouse commented on Sep 30, 2026

    @obackhouse

    restarting the daemon doesn't allow me to have more that one active account in separate codex CLI instances; before this i could do that (not sure if that was by design but it was a critical feature for me)

  3. codejunkienick commented on Oct 1, 2026

    @codejunkienick
    Author

    restarting the daemon doesn't allow me to have more that one active account in separate codex CLI instances; before this i could do that (not sure if that was by design but it was a critical feature for me)

    Do you think switching to --no-daemon flag for codex instances themselves will help?

  4. Loongphy commented on Oct 22, 2026

    @Loongphy
    Owner

    Resolved by #164 (merged): switch now applies the selected credentials to the running daemon — non-disruptive auth reload on codex daemons, restart fallback for upstream daemons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions