Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): update shared Codex installs from their owning home #25235

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/25235/headmerged by maria-rcks View on GitHub

maria-rckscommented

Problem

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:changed passed 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 438d62aa16 with 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. 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:

      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 3de45c6254345f968fbdc64db7b149bf4f429855 and 438d62aa16f9ce68acc4c60c30c7778ce5e6b240.

      Files selected for processing: 3
      • apps/server/src/provider/Drivers/CodexDriver.test.ts
      • apps/server/src/provider/Drivers/CodexDriver.ts
      • packages/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.
    2. Approvability

      Verdict: Approved at 438d62a

      Macroscope'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).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB+24 B (+0.5%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+24 B (+2.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB+41 B (+0.2%)29.3 KiB✅
      ClaudeLive turn messages12+1 (+100.0%)8✅

      Baseline: 3de45c6 · PR result: 438d62a · Source CI: success

      Scenario 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.

    4. maria-rckscommented

      Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified in a real dev environment

      verified unchanged head 438d62aa16f9ce68acc4c60c30c7778ce5e6b240 on linux, using repo Playwright and /usr/bin/google-chrome against 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-sol turns through the local proxy ran pwd and git 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

      command transcript

      main: account-home update fails

      pr: update succeeds and both instances refresh

      pr: update all recording

      pr: existing account-a conversation continues after update

      pr: new account-b session runs real shell commands

      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.

    5. maria-rcks merged thisf4147dd

    6. maria-rcks closed this

Sign in to join this conversation.