fix(server): update shared Codex installs from their owning home #25235
main fromrefs/pull/25235/head·merged by maria-rcks View on GitHubProblem#
Codex accounts can share a standalone executable while using separate configuration homes. T3 passes the account home to codex update, which then fails to detect the installation.
Change#
Derive the updater's CODEX_HOME from the executable's real path, falling back to its resolved path for linked standalone trees. Preserve path spelling and root separators, and keep account/auth homes unchanged. Reuse main's existing sibling refresh after updates.
Verification#
- Two regressions failed on current main before the fix; 84 focused driver, resolver, and maintenance-runner tests pass through Blacksmith.
vp run check:changedpassed format, lint, knip, generated GraphQL checks, typechecks for 21 affected packages, and 66 adjacent tests. Lint reports one existing empty-pattern warning.- Native Linux upgrade in disposable directories: the actual Codex driver resolver definition plus the production maintenance resolver select the installation home, and native Codex upgrades from 0.163.0 to 0.164.0. The account home reproduces the detection failure. This harness bypasses driver lifecycle and the client/RPC path.
- GitHub CI passed, including build/typecheck, lint, web tests, and all eight server test shards.
- Two independent GPT-6.1-Sol reviews cleared
438d62aa16with no findings.
before version: codex-cli 0.163.0
account home: exit 1, Could not detect the Codex installation method
production resolver: CODEX_HOME=<install>/standalone-home
resolved updater: exit 0, Updating Codex CLI from 0.163.0 to 0.164.0
after version: codex-cli 0.164.0
- Unverified: the full client Update all interaction, packaged desktop, native macOS and Windows execution. No UI or wire contract changes. CodeRabbit did not review because of its organization rate limit; both independent reviews and Macroscope correctness/approvability checks passed.
Takeover#
Replaces #19253, with thanks to @shivamhwp for the original implementation.
Built with GPT-6.1-Sol in the Codex harness on T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
438d62aMacroscope's review found this PR approvable — This is a focused server-side bug fix that makes Codex updates use the owning standalone installation home when accounts share an executable. Existing provider behavior and defaults remain unchanged, and targeted regression tests cover the new path.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB +7 B (+0.1%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +7 B (+0.6%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB +24 B (+0.5%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +24 B (+2.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB +41 B (+0.2%) 29.3 KiB ✅ Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅ Baseline:
3de45c6· PR result:438d62a· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
verified unchanged head
438d62aa16f9ce68acc4c60c30c7778ce5e6b240on linux, using repo Playwright and/usr/bin/google-chromeagainst real dev servers. main and the pr ran separately, with one dev server at a time. projects, provider instances, threads, and turns were created through the app. no mocks or seeded data.- on
github/main(9ebca5f71c), two account homes shared a real standalone codex 0.163.0 executable. settings > providers > shared codex a > update now failed with exit 1: "could not detect the codex installation method". - on the pr, settings > providers > update all upgraded that standalone install to 0.165.0. both account rows refreshed to 0.165.0 and remained available with their separate configuration homes. the unrelated npm-wrapper codex slot was disabled before update all, since it cannot be updated by t3.
- real
gpt-6.1-solturns through the local proxy ranpwdandgit rev-parse --is-inside-work-tree. account a worked before the update and continued its existing conversation afterward. a new account-b session used the 0.165.0 executable. all six shell commands exited 0. runtime process inspection confirmed the separate account homes and the old/new executable paths. - 84 focused driver, resolver, and maintenance-runner tests passed through blacksmith. current ci: 29 successful, 0 failing, 0 pending. no code changes were needed.
main: codex update -> exit 1, could not detect installation method pr: update all -> standalone 0.163.0 to 0.165.0 account a: existing conversation continued; shell commands exit 0 account b: new 0.165.0 session; shell commands exit 0




Not verified#
packaged electron desktop, native ios/android, macos/windows path execution, relay/tunnel connections, and separate chatgpt oauth identities were not exercised on this linux vm. both account homes used the task's real codex proxy. the standalone tree and executable were real. initial npm-ownership variables inherited from the verifying codex process were removed before the main reproduction and pr run.
- on
maria-rcks merged thisf4147dd
maria-rcks closed this
Sign in to join this conversation.
Warning
Review limit reached#
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 17 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 10 included reviews currently available.
Learn how review limits work.
Review configuration:
feff556c-f976-4e9b-afa6-cd417f316f0cReviewing files that changed from the base of the PR and between 3de45c6254345f968fbdc64db7b149bf4f429855 and 438d62aa16f9ce68acc4c60c30c7778ce5e6b240.
apps/server/src/provider/Drivers/CodexDriver.test.tsapps/server/src/provider/Drivers/CodexDriver.tspackages/provider-core/src/server/maintenanceResolver.ts- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.