Codex Cli/App "Connections" Issues (Unable to send message to remote project getting access token refresh error)
What version of the Codex App are you using (From “About Codex” dialog)?
26.422.30944 (2080)
What subscription do you have?
Plus
What platform is your computer?
Darwin 25.3.0 arm64 arm
What issue are you seeing?
The issue is using the remote connections on the codex app on macos and linux vm (ubuntu 22.04) installed with codex cli latest version using npm install -g @openai/codex@latest today. After logging in with device auth code or headless login. Even after successfully login, the codex macos app working in remote project giving error message "Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again."
What steps can reproduce the bug?
1) set remote_connections=true to enable connections in the macos codex app
2) install codex cli latest using npm install -g @openai/codex@latest.
3) Do codex login --device-auth
4) Login will be successful and cli works normally on vm
5) When you come back on codex app and try to send message to continue work in remote project for that vm. The below error message is shown
"Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again."
6) Tried with different account and even deleted the codex auth json and relogin performed but still same issue.
What is the expected behavior?
It worked yesterday as normal but as of 25 April 2026, this issue remains unresolved and connections are not working due to this.
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I hit what looks like the same failure on
codex-cli 0.128.0onDarwin 24.3.0 arm64 arm.User-facing error:
With auth tracing enabled, the key log line was:
I dug through
codex-rs/login/src/auth/manager.rsand found two related issues:account_id. If cached ChatGPT auth has noaccount_id, Codex skips reloading auth from storage entirely, even when the on-disk auth is valid or has been refreshed by another Codex process. That can strand the process on stale cached auth and produce the misleading account/logout error.UnauthorizedRecoveryStep::RefreshTokenpath callsrefresh_token_from_authority()directly. That means after the first recovery reload step, there is still a race where another Codex process can refresh storage before this process tries to refresh using stale cached auth.I tested a local patch that:
account_id, thenchatgpt_user_id, then emailrefresh_token()so it performs the guarded reload again before hitting the token endpointtokens, becausecodex login statuscan otherwise say “Logged in using ChatGPT” even though the auth file is unusableRegression coverage added:
account_idis missing/oauth/tokenwith stale cached credentialsLocal verification:
cargo fmt --check -p codex-logincargo test -p codex-logincodex exec --sandbox danger-full-access --json -smoke test returnedOKBecause external PRs are invitation-only per
docs/contributing.md, I’m not opening an unsolicited PR, but I can submit the patch if maintainers want it.I hit what appears to be the same failure when using Codex Desktop on Windows against remote Linux hosts over SSH.
Symptom:
codex login --device-authon the remote host succeeds.codex exec ...on the remote host works after login.What fixed it for me was clearing the stale remote
app-server/ desktop SSH bridge processes, then logging in again on the remote host before reconnecting from Codex Desktop:Then close/reopen or reconnect the remote project in Codex Desktop.
In my case the old remote processes included commands like:
Those processes seemed to keep using stale auth state even after a fresh
codex login. After killing them and reauthenticating on the remote, Codex Desktop started a fresh remote app-server and the error disappeared.This also matches the pattern described in openai/codex-plugin-cc#281 where direct
codex execworks but app-server-mediated flows keep failing with the stale auth error.