Repository navigation
fix(bots): use the selected codex profile for isolated bot login - #1213
Merged
Merged
Conversation
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
Use the cached account-session list on supported Codex versions. Exercise the native bot authentication path through a single local mock endpoint and report fixture failures without exposing credential or path details.
nixuuu
marked this pull request as ready for review
November 24, 2026 14:48
Member
Author
|
The native Windows regression passed at Merge is blocked on the GitHub account configuration. GitHub rejected the author’s noreply address for squash auto-merge and currently lists no noreply address as an available commit email. The maintainer needs to make their GitHub noreply address available for web commits, then enable squash auto-merge. Auto-merge is off. |
This was referenced Nov 24, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 26, 2026
## Changes - Preserve the directory entry when resolving a Codex login. On macOS, Bun can return the path of another hard link to the same inode during concurrent lookups. Bot migration now detaches the managed link while protecting the source login, including a source reached through a symbolic link. - Lock the thread before marking `StartTurn` and `SteerTurn` as delivered. This matches archival and prevents the sandbox profile trigger from deadlocking against command expiry. - Wait for the gateway's persisted turn context in the linked-agent fixture. Give the Tailscale and Windows Codex fixtures separate process and test budgets with useful failure diagnostics. Run one native packaging test per macOS architecture and log the slow `actool` and Swift phases. - Retry failed Release jobs once for a scheduled nightly when GitHub annotated each failed job with a hosted runner disconnect or an exhausted `CreateArtifact` request timeout. The retry uses the same run and revision and preserves the existing Push CI and publication gates. ## Verification - Bun 1.4.5 on Apple Silicon passed 24 Codex migration and bot login tests and 12 desktop packaging tests through `check:tmp`. A 50,000-iteration race reproduced 23,655 missed links with the previous lookup and zero after the fix. - PostgreSQL 18 reproduced `40P01` with the old outbox lock order. The regression passed five repetitions after the fix. All 31 targeted archive, linked-agent and sandbox integration tests passed. - Tailscale passed 60 repeated executions. Both pinned Codex versions passed the live login fixture on macOS. Codex 0.172.0 also passed with an injected 24-second credential probe startup delay. - Worker and integration typechecks, focused lint and formatting, `actionlint`, and `git diff --check` passed. Tested the recovery script with real historical GitHub job data and a stubbed POST for runner loss, the `CreateArtifact` timeout that blocked [v0.11.0-nightly.1](https://github.com/itsoltech/canopy/actions/runs/45770577786/attempts/1), an ordinary CI failure, and a prior rerun. - GitHub CI covers the native Windows and macOS Intel changes. Live recovery requires a future scheduled Release with one of the recognized GitHub infrastructure failures. Fixes: #1213 Fixes: #1114
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.
Change
Codex bots authenticate through the selected native provider profile on the worker. A fresh local app-server resolves the profile's login. The bot uses an ephemeral credential store in its private home and keeps its conversation, tool restrictions and instructions. On resume the bot asks for the thread handle while Codex loads the full history internally. Bot startup and renewal no longer create credential links or require Windows Developer Mode.
The worker checks effective inference, account and catalog routes before providing credentials. On supported Codex releases it checks the active stored workspace and user before requesting the access token again. ChatGPT renewal stays bound to that same identity and can reuse recently renewed access. The selected profile keeps the refresh token. API-key logins use the same local transport. Unsupported authentication and incompatible routing stop the turn.
Upstream Codex can independently renew stale credentials during app-server startup. Codex 0.164 and 0.165 lack the cached account preflight and can also renew during the status read. The worker verifies the identity of returned credentials before using them in the bot.
Startup cleans verified obsolete bot aliases. An unrecognized login file is preserved under a private backup name before the bot starts. Ordinary isolated instances that still require a link preserve their previous login path when replacement is denied. The default Use CLI home thread path and the title generator keep their existing behavior.
When the default Windows bot home leaves too little room for a SQLite journal, Canopy supplies a shorter private SQLite directory scoped to the same bot, conversation and provider instance. Existing conversation databases are snapshotted with their committed WAL data before the new directory is published. The native rollout stays in place. Explicit SQLite locations configured in the profile or worker environment or Codex configuration retain their normal precedence.
Verification
3078abbac: 71 focused tests passed across 12 files. Coverage includes login migration, WorkerHost profile selection and restart, gateway bot turns, conversation isolation and a live-WAL migration fixture, explicit database locations and the ordinary CLI home. Worker typecheck, targeted lint, formatting and diff checks passed.7b82a430b: both CLI versions authenticated successfully but failed to open the history database on cold resume (SQLite 14). The database path was 254 characters before SQLite appended a journal suffix. Windows diagnosticsa5f69d1e6: both real Codex releases passed the long-path login and cold-resume regression. The WorkerHost and WAL snapshot tests passed as well. Windows job3078abbac: both pinned Codex releases completed the full login and cold-resume regression with long paths. Profile selection, login recovery, explicit database locations and the WAL snapshot tests passed. Windows verificationFixes: #1150