SSH remote sessions keep using stale auth after switching accounts until the connection is restarted
What version of the Codex App are you using (From “About Codex” dialog)?
0.130.0-alpha.5
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64; WSL Ubuntu via Codex App SSH remote connection
What issue are you seeing?
After switching accounts in Codex App / Codex CLI, local Codex sessions work, but SSH remote sessions into WSL keep failing with:
Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.
The fix is not signing in again. The SSH remote connection has to be restarted manually from Settings -> Connections -> [connection menu] -> Restart. After that, the remote session works again.
It looks like the SSH remote connection keeps stale auth state after the local account changes. Codex should either refresh/restart the remote connection automatically, or show an actionable message telling the user to restart the connection.
What steps can reproduce the bug?
What happened?
On Windows + WSL using Codex App SSH remote connections, switching accounts in Codex App / Codex CLI can leave an existing SSH remote connection using stale authentication state.
After switching accounts, local Codex App sessions work correctly. However, starting a Codex session through the SSH remote connection fails with:
Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.
The confusing part is that signing in again, reinstalling the app, or refreshing the local CLI auth does not make the remote session work. The remote connection has to be restarted manually from:
Settings -> Connections -> [remote connection menu] -> Restart
After restarting the connection there, SSH remote sessions work again.
Steps to reproduce
-
Use Codex App on Windows with a WSL/SSH remote connection configured.
-
Sign in to Codex App / Codex CLI.
-
Switch to another account or otherwise refresh the local Codex auth.
-
Start a new local Codex App session. It works.
-
Start a new session through the existing SSH remote connection.
-
The remote session fails with:
Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again. -
Go to Settings -> Connections, open the menu for the SSH remote connection, and click Restart.
-
Start the SSH remote session again. It works.
Expected behavior
When the Codex account changes, SSH remote connections should either:
- automatically refresh/restart their auth state, or
- show an actionable message telling the user to restart the remote connection from Settings -> Connections.
The current error suggests the user needs to sign in again, but the actual fix is restarting the existing remote connection.
Actual behavior
The SSH remote connection appears to keep using stale auth until it is manually restarted.
Workaround
Open Codex App settings, go to Connections, open the remote connection menu, and click Restart.
Environment
- OS: Windows
- Remote target: WSL via SSH remote connection
- Components involved: Codex App, Codex CLI, SSH remote connections, auth/account switching
What is the expected behavior?
No response
Additional information
No response
I hit the same stale-auth pattern with Windows Codex Desktop and remote Linux SSH hosts.
In addition to using Settings -> Connections -> Restart, this command-line reset on the remote host fixed it for me:
# on the remote SSH host
pkill -u "$USER" -x codex
rm -f "${CODEX_HOME:-$HOME/.codex}/app-server-control/desktop-ssh-websocket-v0.sock"
codex logout
codex login --device-auth
codex login status
Then reconnect/reopen the remote project from Codex Desktop.
The key observation was that the remote host had stale Desktop-created app-server / SSH bridge processes such as:
codex app-server --listen unix://.../desktop-ssh-websocket-v0.sock
codex app-server proxy --sock .../desktop-ssh-websocket-v0.sock
Those processes seemed to keep using the old auth state even after a fresh login. Once killed, Codex Desktop started a new remote app-server and picked up the new auth correctly.
So the actionable message probably needs to mention restarting the SSH remote connection or killing/restarting the remote app-server, not just signing in again.
Additional report of the same error on Windows + WSL. The underlying cause and the account-switch trigger described in the original report have not been confirmed in this case.
Environment
- Windows desktop app package:
OpenAI.Codex 26.1111.2228.0 - WSL distribution:
Ubuntu-22.04 - Projects stored in the WSL filesystem and opened in the Windows Codex app.
Observed behavior
Submitting prompts in WSL project chats is blocked by:
Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.
Impact and requested recovery
Other tasks are running in the same application. Recovery needs to preserve those tasks and their chat state. A global logout or application restart is not an acceptable workflow for recovering a single affected environment.
Please provide a way to refresh or reauthenticate the affected WSL connection/session, then retry the failed prompt without interrupting unrelated running tasks. If a scoped connection restart is required, the error should identify that action and explain its impact on active tasks.
Verification limits
Global logout, application restart, and the connection-restart workaround in this issue have not been tested in this case, to avoid disrupting ongoing work. We are not claiming that logout necessarily terminates every task or that these workarounds fail.
Separate Windows and WSL auth.json files were observed, but this does not establish which credential store the failing process uses or prove an authentication-state mismatch. The exact execution/connection path also remains unverified.
Could the maintainers confirm whether recovery without interrupting other running tasks is supported, and investigate this occurrence alongside the stale-auth behavior reported here?