Skip to content

WSL中switch不生效,codex退出后后台存在 codex app-server daemon进程 #161

Closed

Description

@shelpy

WSL环境中,执行codex-auth switch之后,codex /exit重新进入还是之前的account,/exit之后ps可以看到有codex app-server 进程存活

Activity

  1. shelpy commented on Sep 28, 2026

    @shelpy
    Author

    codex cli版本 0.157.1

  2. wywwzjj commented on Oct 3, 2026

    @wywwzjj

    codex features disable daemon_auto_start
    codex app-server daemon stop

    可以先关掉缓解一下

  3. Loongphy commented on Oct 24, 2026

    @Loongphy
    Owner

    Fixed by #164, shipped in v0.3.2-alpha.2. It is not on the latest tag yet, so install the pre-release from npm:

    npm install -g @loongphy/codex-auth@next
    codex-auth --version   # should print 0.3.2-alpha.2

    Since Codex 0.160.0, switch only rewrites auth.json and the registry; a running codex app-server daemon keeps serving the previously selected account. Pass --restart-daemon to apply the selection to the running daemon:

    codex-auth switch 02 --restart-daemon
    codex-auth switch <query> --restart-daemon
    • Plain switch still leaves the daemon untouched, but now prints a stderr hint telling you to rerun with --restart-daemon.
    • If the Codex version supports in-place reload, credentials are reloaded without interrupting attached sessions; older daemons are restarted, which can interrupt them.
    • --restart-daemon cannot be combined with --live.
    • The workaround above still works if you prefer no daemon at all: codex features disable daemon_auto_start and codex app-server daemon stop.

    Closing as resolved. Feel free to reopen if --restart-daemon still reports the old account.

    See docs/commands/switch.md for details.

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