Repository navigation
fix(codex): recover device login after credential rotation - #1163
Merged
Merged
Conversation
nixuuu
enabled auto-merge (squash)
November 23, 2026 15:37
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A native Codex thread could keep a rejected ChatGPT login after its owner signed in again in a terminal. Canopy could report the new account as signed in while the next turn on the same thread still failed.
Account Refresh and worker reprobes now compare the selected credential file's metadata with the last applied configuration. An affected app-server restarts after its turns and background tasks drain. Unchanged credentials keep the process running. Codex's reused or revoked refresh-token diagnostics lead to the existing sign-in action. A turn started after sign-out reports the selected instance's missing login.
Isolated Codex homes share the device file store’s write lock and keep a valid credential link across the gap between terminal sign-out and sign-in. When device login is selected and available, a detached credential file in a managed home is backed up before restoring the link. Custom homes retain their existing protection.
Codex 0.171 serializes writes after the OAuth exchange. Two independent clients sharing a ChatGPT grant can still request refresh concurrently. A separate instance login gives Canopy its own grant when the terminal is also in use. File sharing on Windows requires file-symlink permission.
Verification
Copy audit
An account error for an unusable login lock explains the failure and asks the owner to check the instance directory and permissions. The existing sign-in action also covers rejected refresh tokens. The new detail has two fixed-length sentences and carries no account identifiers or paths.
Fixes: #696
Related: #1150