Repository navigation
fix(codex): stop prompting a Codex restart when only its home changed - #25421
Conversation
A Codex terminal that outlived the move to ~/.codex was blocked behind "This Codex session is using an outdated configuration" until the user restarted it, which starts a fresh codex and ends the conversation. That terminal keeps working on Orca's old Codex home, which is refreshed from ~/.codex, so the change did not need the user's answer; the prompt also never appeared for Codex in Git Bash terminals, whose process tree Orca cannot see through. The restart prompt now covers only an account switch, which the user caused. The pane record keeps its home route, which the retained-home refresh and the shared-server check still read; only the prompt and the custom-home downgrade that existed to keep it from guessing are gone.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughCodex pane home routing no longer records custom-home override provenance, and legacy custom-home records are read as shared-home. Stale-pane detection now compares recorded and active account IDs. Home-route changes alone no longer produce stale panes or restart notices. Restart notice data and rendering now use account-switch information, and matching accounts clear notices and pending restarts. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue was established in the selected changes. The PR is mergeable after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 52.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 21 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Record a pane's own CODEX_HOME override as-is. The filter that kept only overrides Orca could re-derive existed for the removed route comparison; its one remaining reader, the shared-server check, returns null for the shared-home route those panes record either way. - Treat custom-home like shared-home in resolveCodexPaneHome: the removed downgrade only wrote it without an override, so it never named a home. - Inline the restart notice key; its route/account prefix was its only job. - Delete the two pane-local override tests, including a POSIX-only one that still expected custom-home and would have failed on Linux and macOS CI. - Cover the account recheck branches the deleted route-recheck file was the last to exercise: main reporting a pane current, and main not answering.
- Read an older build's custom-home record as shared-home, which it always was, and drop custom-home from the route type and every check. - Delete shellStartupCodexHomeOverrideMatches and its comparison helper; nothing re-checks a recorded override any more. - Build the pane launch record in one return: the route is always set, and only a resumed launch differs, in how it picks the account. - Drop the restart dialog's notice key; its focus effect now depends on the pane and both account labels directly. - Give the account recheck test a typed window stub, so CI's type-assertion gate passes, and remove timing entries for deleted test files.
The pane record kept a pane's CODEX_HOME override so the removed route prompt could re-check it later. Its one other reader, the shared-server check, only looked at it for a real-home pane, and a custom CODEX_HOME always routes a pane to Orca's mirror, so it was never used. Drop both record fields, their validators, equality checks and spawn plumbing. getCustomCodexHomeOverrideForLaunch folds into the existing hasCustomCodexHomeOverrideForLaunch, and real-home resolves to ~/.codex. Records from older builds still parse; the parser keeps only known keys. The fish test's decoy no longer sets CODEX_HOME, so the boolean check still fails if the launch env XDG_CONFIG_HOME is ignored.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Full-PR review. There is no prior Pullfrog review and no incremental diff: the only commit since the trigger's before_sha is a merge of main, so the whole authored delta was in scope.
- Dropped the home-route staleness check —
listStaleCodexPanesnow reports a pane stale only when its launch account differs from the selected account; thereasonfield andactiveHostHomeRouteplumbing through IPC, preload, and renderer are gone. - Retired
custom-homeand the pane-local override fields —shellStartupHomeOverride/environmentHomeOverride,recordComparableHomeRoute, and the re-check helpers are removed; an older build'scustom-homerecord is normalized toshared-homeon read, and old records still parse becausehomeRoutewas never validated. - Simplified override detection —
getCustomCodexHomeOverrideForLaunchfolded into the booleanhasCustomCodexHomeOverrideForLaunch, and areal-homepane now resolves straight to~/.codexin the shared-server check. - Removed the dialog surface — the "Codex setup changed" copy, its four strings in every locale, the notice-key module, and the route-recheck test; a new account-switch recheck test replaces the latter.
Verified locally: tc:node exits 0; the touched main codex suites (66 tests) and renderer codex restart suites (71 tests) all pass. Grep confirms no remaining reference to the removed symbols, and no caller still passes launchEnv/activeHostHomeRoute/reason.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…#25421) * fix(codex): stop prompting a Codex restart when only its home changed A Codex terminal that outlived the move to ~/.codex was blocked behind "This Codex session is using an outdated configuration" until the user restarted it, which starts a fresh codex and ends the conversation. That terminal keeps working on Orca's old Codex home, which is refreshed from ~/.codex, so the change did not need the user's answer; the prompt also never appeared for Codex in Git Bash terminals, whose process tree Orca cannot see through. The restart prompt now covers only an account switch, which the user caused. The pane record keeps its home route, which the retained-home refresh and the shared-server check still read; only the prompt and the custom-home downgrade that existed to keep it from guessing are gone. * refactor(codex): drop what the home-route prompt left behind - Record a pane's own CODEX_HOME override as-is. The filter that kept only overrides Orca could re-derive existed for the removed route comparison; its one remaining reader, the shared-server check, returns null for the shared-home route those panes record either way. - Treat custom-home like shared-home in resolveCodexPaneHome: the removed downgrade only wrote it without an override, so it never named a home. - Inline the restart notice key; its route/account prefix was its only job. - Delete the two pane-local override tests, including a POSIX-only one that still expected custom-home and would have failed on Linux and macOS CI. - Cover the account recheck branches the deleted route-recheck file was the last to exercise: main reporting a pane current, and main not answering. * refactor(codex): retire custom-home and the last re-check helpers - Read an older build's custom-home record as shared-home, which it always was, and drop custom-home from the route type and every check. - Delete shellStartupCodexHomeOverrideMatches and its comparison helper; nothing re-checks a recorded override any more. - Build the pane launch record in one return: the route is always set, and only a resumed launch differs, in how it picks the account. - Drop the restart dialog's notice key; its focus effect now depends on the pane and both account labels directly. - Give the account recheck test a typed window stub, so CI's type-assertion gate passes, and remove timing entries for deleted test files. * fix(codex): drop the removed dialog strings main added to es.json * refactor(codex): stop recording a pane's custom CODEX_HOME The pane record kept a pane's CODEX_HOME override so the removed route prompt could re-check it later. Its one other reader, the shared-server check, only looked at it for a real-home pane, and a custom CODEX_HOME always routes a pane to Orca's mirror, so it was never used. Drop both record fields, their validators, equality checks and spawn plumbing. getCustomCodexHomeOverrideForLaunch folds into the existing hasCustomCodexHomeOverrideForLaunch, and real-home resolves to ~/.codex. Records from older builds still parse; the parser keeps only known keys. The fish test's decoy no longer sets CODEX_HOME, so the boolean check still fails if the launch env XDG_CONFIG_HOME is ignored. * test(codex): drop setup the yes/no CODEX_HOME checks no longer need --------- Co-authored-by: Orca Worker <orca-worker@localhost> (cherry picked from commit a68ee67)

ELI5
When Orca moved Codex on Windows onto your own
~/.codexfolder (#24356), Codex terminals that were already open kept using Orca's old copy of that folder. Orca then covered each of them with a dialog, "This Codex session is using an outdated configuration", and blocked typing until you restarted. Those terminals work fine on the old copy, and restarting ends the conversation, so this PR removes that dialog. The dialog for switching Codex accounts stays.What Changed
Before: after updating, every Codex terminal that was open before the update could be locked behind "Codex setup changed / This Codex session is using an outdated configuration" with Keep current session and Restart. Typing in the terminal was blocked until you answered. Restart started a fresh
codex, ending the conversation in that terminal. The dialog never appeared for Codex running in Git Bash terminals, because Orca cannot follow Git Bash's process tree to see Codex running there, so it showed up on some terminals and not others.After: those terminals keep running with no dialog. They stay on Orca's old Codex folder until they are closed, and that folder keeps being refreshed from
~/.codex(settings and trust; MCP servers too, without deleting Orca-only ones since #24983). New terminals use~/.codex. The Account switched dialog is unchanged: when you switch Codex accounts, Codex sessions still on the old account are asked to restart.Mechanism:
listStaleCodexPanes(main) reported a pane as stale for two reasons: its launch account differs from the selected one, or its recorded Codex home ("route") differs from the one Orca would pick now. This PR drops the second reason, so the function only compares accounts, and removes what existed only for it:activeHostHomeRouteandgetSelectedHostCodexHomeRoute(), which fed the comparisonreasonfield on the stale-pane result, its preload types, and thehomeRouteChangedflag through the renderer's restart-notice statecodex-session-restart-route-recheck.test.ts)recordComparableHomeRouteand thecustom-homeroute. To keep the comparison from guessing, panes whose CODEX_HOME override Orca could not re-derive were recorded ascustom-homeinstead ofshared-home, and every other reader already treated the two the same. Acustom-homerecord from an older build (those terminals survive updates) is now read asshared-home, which it always was.shellStartupHomeOverride/environmentHomeOverridefields, which kept a pane's custom CODEX_HOME so the prompt could re-check it, plus their validators, equality checks, spawn plumbing and re-check helpers. Their one other reader, the shared-server check, only looked at them for areal-homepane (acustom-homerecord never carried them), and a custom CODEX_HOME always routes a pane to Orca's mirror, so it never used them;real-homenow resolves to~/.codex.getCustomCodexHomeOverrideForLaunchfolds into the existinghasCustomCodexHomeOverrideForLaunch. Older records still parse: the parser keeps only known keys.The pane record keeps its home route. The retained-home refresh, the session migration, the hook home paths, and the shared-server check still read it.
Why
The prompt was added in #11720 with a single line of reasoning: route changes should "use the existing restart prompt even when the account ID is unchanged". It doesn't hold up against what the dialog costs:
~/.codex. Conversations started there are copied into~/.codexby the existing session backfill, socodex resumefinds them. The only thing that does not carry over is trust, approvals, or MCP servers added inside an old terminal, and only until it is closed.The dialog also fired outside migrations, whenever the account was unchanged but Orca's pick of folder changed:
~/.codexbreaking or recovering. While the hook can't be installed or is waiting for Codex's approval, new default-account terminals fall back to Orca's copy. When it recovered, the dialog nudged fallback terminals back to~/.codex; that copy stays refreshed from~/.codexmeanwhile. When it broke, the dialog asked users to restart a working~/.codexsession onto the fallback, which is worse than nothing.CODEX_HOMEin their profile or environment. Restart applied it to that terminal, but only for adding or removing, never for changing one custom path to another. Applying environment changes to new terminals only is ordinary shell behaviour.Alternatives considered:
Linked Issue
Linear: STA-9109 (follow-up to #24356).
Visual Proof
N/A. This removes a dialog; the remaining account-switch dialog is unchanged. The removed dialog is the one in the STA-9109 thread.
Testing
Windows only.
tscnode, web and CLI: no new errors. This checkout's dependencies predatestream-json, whichmainalready imports, so those errors appear on unmodifiedmaintoo.check:code-quality:changed: 0 new findings.verify:localization-catalogs,-runtime-catalog,-extraction,-coverage: pass.Ran
src/main/codex,src/main/codex-accounts,src/main/ipc, and the renderer's Codex restart, stale-pane sweep, notice and terminal-state tests, on this branch and on unmodifiedmain, and compared the failing-test lists. The only failures this branch adds are inscanner-incremental-append.test.ts, which fails on both sides with different cases and passes on rerun (flaky).native-chat.test.tsfails identically on unmodifiedmainwith this checkout's dependencies. The rest fail identically onmainon this machine (session resume, structured sessions, app-server).New
codex-session-restart-account-recheck.test.tscovers the account-switch recheck branches the deleted route-recheck file was the last to exercise: main reports the pane current (notice and queued restart cleared), and main cannot answer (falls back to the switch's account ids). Each test fails when its branch is removed.codex-stale-pane-accounts.test.tscovers a pane on an older home with an unchanged account (not reported) and an older build'scustom-homerecord (read asshared-home).Deleted the two pane-local override tests (environment and shell-startup; the second is POSIX-only); both pinned the removed
custom-homedowngrade. The CODEX_HOME detection tests incodex-real-home-path.test.tsnow check the yes/no answer; the fish case's decoy config no longer sets CODEX_HOME, so it still fails if the launch env'sXDG_CONFIG_HOMEis ignored.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
listStalePanesis a local IPC between this build's main and renderer, so there are no mixed versions. Records written by older builds keep parsing;custom-homeis read asshared-home. Downgrading to a build that still has the dialog could prompt for panes this build recorded, including panes with a CODEX_HOME set only in their own launch environment, which that build recorded ascustom-homeand never prompted for.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)