Repository navigation
fix(codex): migrate windows login hard links - #1150
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 23, 2026 10:27
nixuuu
added a commit
that referenced
this pull request
Nov 23, 2026
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 - On Linux, Codex CLI 0.171.0 refreshed a synthetic ChatGPT login twice against a local OAuth endpoint, first from the isolated home and then from the device home. Both rotations reached the selected source file. - Focused worker tests exercised logout/login, lock identity, nested bot homes, legacy recovery and notification classification. Gateway↔worker integration covered both private and linked logins, in-flight work and a successful next turn on the original thread. - Worker typecheck, edited-file lint and diff checks passed locally. CI runs the store tests on Windows and macOS too. Interactive sign-in to a real ChatGPT account was outside local 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
nixuuu
added a commit
that referenced
this pull request
Nov 23, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 23, 2026
## Change The built-in `codex/native` instance now uses the device’s existing Codex CLI home by default on Windows, macOS and Linux. Upgrading the worker is enough for existing device-login setups with no saved home selection. Users can retry a failed turn in the same ordinary thread. This fixes the case where Windows denies the file links previously required to use the terminal login. Codex reads the selected CLI store and refreshes its own credentials. The thread process also uses the CLI configuration, including instructions, MCP servers and hooks. An explicit **Isolated** choice in the definition or worker override is respected. Additional Codex instances default to **Isolated** and can select **Use CLI home**. Own login, proxy connections and disabled device login use the private home. The worker resolves the default when applying existing configuration. Older workers keep their original default and require an update for explicit **Use CLI home**. Web, desktop and mobile display the default and preserve an implicit choice when saving unrelated settings. The private Canopy SQLite index keeps ordinary threads resumable with their original history. New direct sessions are bound to their CLI home. Existing imported copies require **Isolated** for native continuation. With **Use CLI home**, new imports keep their timeline and can continue in a new thread. Bots and automatic titles use isolated environments and still require file links for CLI-based authentication. ## Verification - Reproduced an existing thread blocked by a conflicting private login lock across a real gateway and worker with a synthetic CLI. Replacing the worker with the same stored configuration version and no home selection let the thread complete a turn using the terminal login. Selecting **Isolated** reproduced the original link conflict. - Covered implicit profiles, legacy multi-provider configurations, simulated keyring status, explicit isolation, own login, proxy, disabled device login and imports. Native CI now exercises the default on Windows and macOS. - Exercised Codex 0.164.0 and 0.171.0 on Linux against local model fixtures, including archived private history and unload. The pinned 0.164.0 passed the connection-switch cases. On 0.171.0 a separate connection-switch test also fails on the unchanged base revision when the CLI rejects changing the model provider on resume. - Checked settings persistence, inheritance, linked-computer sync and worker delivery. Regenerated contract comments. Scoped lint and gateway, worker, web and mobile type checks passed during implementation. - Checked defaults, persistence and overrides in Chromium at wide and narrow widths. Checked selection and inheritance on an Android emulator. Real Windows or macOS account login and a full save from a paired phone were not exercised locally. ## Copy audit The instance selector describes the CLI settings and new session files affected. Its isolated option identifies the home used by imported copies. Login-link errors identify the failed operation and give the user a next step. Checked labels, wrapping, inheritance and status cues against the copy checklist. Fixes: #1150
nixuuu
added a commit
that referenced
this pull request
Nov 24, 2026
Acquire the selected profile's login through local app-server RPC. Bind renewal to the admitted user and workspace and require matching credential destinations before using the isolated process's ephemeral store. Fixes: #1150
nixuuu
added a commit
that referenced
this pull request
Nov 24, 2026
Authenticate isolated Codex bots with the selected local profile and preserve session history on Windows. Fixes: #1150
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.
Fixes: #732
Codex CLI 0.171.0 rejects atomic credential replacement when
auth.jsonhas another hard link. If the source was already replaced, worker and bot homes can still hold the old file.Verification
git diff --checkpassed.Copy audit
The existing account error now explains that Canopy could not use the device login and names Windows Developer Mode as the action. The detail uses two sentence-case sentences, contains no account data, and conveys the action in text.