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_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗