Skip to content

fix(codex): stop prompting a Codex restart when only its home changed - #25421

Merged
OrcaWin merged 8 commits into
mainfrom
sta-9109-drop-route-restart-prompt
Oct 5, 2026
Merged

OrcaWin merged 8 commits into
mainfrom
sta-9109-drop-route-restart-prompt

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​133 $\color{#cf222e}{\Huge{\mathbf{−}}}$​545 $\color{#cf222e}{\Huge{\mathbf{−}}}$​412
Prod 28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​84 $\color{#cf222e}{\Huge{\mathbf{−}}}$​369 $\color{#cf222e}{\Huge{\mathbf{−}}}$​285

ELI5

When Orca moved Codex on Windows onto your own ~/.codex folder (#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:

  • activeHostHomeRoute and getSelectedHostCodexHomeRoute(), which fed the comparison
  • the reason field on the stale-pane result, its preload types, and the homeRouteChanged flag through the renderer's restart-notice state
  • the dialog's route copy, its four strings in every locale that had them, and its tests (including codex-session-restart-route-recheck.test.ts)
  • recordComparableHomeRoute and the custom-home route. To keep the comparison from guessing, panes whose CODEX_HOME override Orca could not re-derive were recorded as custom-home instead of shared-home, and every other reader already treated the two the same. A custom-home record from an older build (those terminals survive updates) is now read as shared-home, which it always was.
  • the pane record's shellStartupHomeOverride / environmentHomeOverride fields, 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 a real-home pane (a custom-home record never carried them), and a custom CODEX_HOME always routes a pane to Orca's mirror, so it never used them; real-home now resolves to ~/.codex. getCustomCodexHomeOverrideForLaunch folds into the existing hasCustomCodexHomeOverrideForLaunch. Older records still parse: the parser keeps only known keys.
  • the restart dialog's notice key module, now that it only joined two labels.

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:

  • Nobody asked for the change. An account switch is the user's own action, and staying on the old account means using the wrong identity. A Codex home change comes from an Orca update, and staying on the old home is what every Windows Codex terminal in Orca did before feat(codex): run Windows Codex on the real ~/.codex #24356.
  • The old home keeps working. fix(codex): keep persistent panes logged in after home routing #11720 also added the one-way refresh that keeps that home in step with ~/.codex. Conversations started there are copied into ~/.codex by the existing session backfill, so codex resume finds 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 is heavy. It blocks every keystroke until answered, and Restart ends the conversation.
  • It was inconsistent. It never appeared for Codex in Git Bash terminals.

The dialog also fired outside migrations, whenever the account was unchanged but Orca's pick of folder changed:

  • Orca's status hook in ~/.codex breaking 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 ~/.codex meanwhile. When it broke, the dialog asked users to restart a working ~/.codex session onto the fallback, which is worse than nothing.
  • The user adding or removing CODEX_HOME in 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:

  • Make it non-blocking (a banner). It still asks users to restart a session that works, for no benefit they can see.
  • Fix Git Bash detection so it fires everywhere. That makes a dialog we do not need more reliable.
  • Keep it for Windows only. The same reasoning applies on every platform.

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.

  • tsc node, web and CLI: no new errors. This checkout's dependencies predate stream-json, which main already imports, so those errors appear on unmodified main too.

  • 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 unmodified main, and compared the failing-test lists. The only failures this branch adds are in scanner-incremental-append.test.ts, which fails on both sides with different cases and passes on rerun (flaky). native-chat.test.ts fails identically on unmodified main with this checkout's dependencies. The rest fail identically on main on this machine (session resume, structured sessions, app-server).

  • New codex-session-restart-account-recheck.test.ts covers 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.ts covers a pane on an older home with an unchanged account (not reported) and an older build's custom-home record (read as shared-home).

  • Deleted the two pane-local override tests (environment and shell-startup; the second is POSIX-only); both pinned the removed custom-home downgrade. The CODEX_HOME detection tests in codex-real-home-path.test.ts now check the yes/no answer; the fish case's decoy config no longer sets CODEX_HOME, so it still fails if the launch env's XDG_CONFIG_HOME is ignored.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: removes the prompt on every platform; macOS and Linux terminals left on the old home after their earlier move behave the same way.
  • SSH/WSL: unaffected. The route comparison only ever applied to host panes, and SSH panes are never recorded.
  • Compatibility: listStalePanes is a local IPC between this build's main and renderer, so there are no mixed versions. Records written by older builds keep parsing; custom-home is read as shared-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 as custom-home and never prompted for.
  • Security and performance: no new I/O; one IPC field and one comparison removed.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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.
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 5, 2026 05:54
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7407058-8e4a-490d-9538-5d3a89246ba1
📥 Commits

Reviewing files that changed from the base of the PR and between 172992f and 3e96ad8.

📒 Files selected for processing (2)
  • src/main/ipc/pty/ipc/spawn-commit-persist.ts
  • src/renderer/src/i18n/locales/en.json
💤 Files with no reviewable changes (1)
  • src/main/ipc/pty/ipc/spawn-commit-persist.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Codex 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 3e96a

No actionable issue was established in the selected changes. The PR is mergeable after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 17299

The change affects 2 systems.

Changed systems: src, config

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 40 changed files map to changed impact.
  • observed — config (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/main/codex-accounts/runtime-home-real-home-lane-routing.test.ts: The test replaces assertions on the route-name API with isHostSystemDefaultRealHome() checks, including a false result after the real-home lane gate is disabled. The earlier route-name expectations are removed.
  • observed — Modified behavior in src/main/codex-accounts/runtime-home-service-state.ts: Removed the CodexPaneHomeRoute type import.
  • observed — Modified behavior in src/main/codex-accounts/runtime-home-service-state.ts: Removed the abstract getSelectedHostCodexHomeRoute() method from CodexRuntimeHomeState.
  • observed — Modified behavior in src/main/codex/codex-pane-launch-account.test.ts: Removed tests asserting that a pane-local custom home with recordComparableHomeRoute: false yields { selectionKey: 'host', accountId: null, homeRoute: 'custom-home' }, and that the same flag does not change the account-home result for an account-owned path.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: Codex home-route changes no longer trigger a restart prompt.
Description check ✅ Passed The description covers the user impact, implementation, rationale, linked issue identifier, visual proof, testing, compatibility, and checklist. It is detailed and mostly complete, though the Review s…
Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Orca Worker added 6 commits October 4, 2026 23:34
- 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 — listStaleCodexPanes now reports a pane stale only when its launch account differs from the selected account; the reason field and activeHostHomeRoute plumbing through IPC, preload, and renderer are gone.
  • Retired custom-home and the pane-local override fields — shellStartupHomeOverride/environmentHomeOverride, recordComparableHomeRoute, and the re-check helpers are removed; an older build's custom-home record is normalized to shared-home on read, and old records still parse because homeRoute was never validated.
  • Simplified override detection — getCustomCodexHomeOverrideForLaunch folded into the boolean hasCustomCodexHomeOverrideForLaunch, and a real-home pane now resolves straight to ~/.codex in 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.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@OrcaWin
OrcaWin merged commit a68ee67 into main Oct 5, 2026
39 of 40 checks passed
Jinwoo-H pushed a commit that referenced this pull request Oct 5, 2026
…#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant