You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(codex): history follows you into ~/.codex on system default, with a per-host opt-out (#24511) - #34981
Orca gives each managed Codex account its own Codex folder. To keep "switch account, keep your conversations" working (#10770), it links session files between those folders, and with this PR also into your own ~/.codex when you switch back to system default (#25000). Some people need the opposite: separate accounts for separate organizations must never see each other's history (#24511).
This PR adds a real switch, Settings → Agents → Share Codex history across accounts. It's on by default, which keeps today's behavior. When it's off, Orca stops linking Codex history between accounts and into ~/.codex. The switch applies to whichever host you pick in Settings, this computer or a paired SSH or WSL host, because that host is the one writing the links.
What Changed
Missing history after switching back to system default (#25000):
When Codex launches on your real ~/.codex (system default), the existing background bridge links the trusted managed host accounts' sessions into it and indexes them. That's the same mechanism and gates the per-account lane already uses.
That lane now lives in the launch class (runtime-home-service-launch.ts).
Hardlinks only into ~/.codex. The bridge links with hardlinks only here, with no symlink fallback. A rollout that can't be hardlinked, for example EXDEV across volumes with a redirected profile or second disk, is skipped (skippedFiles), and any folder created for it is removed. Codex resume ignores symlinked sessions, and a symlink into a managed home would dangle once that account is removed. Bridges between Orca-managed homes keep the existing symlink fallback.
Never into a WSL distro. If the history source home (codexSessionSourceHome) points inside a distro (\\wsl.localhost\…), this lane does nothing. Scanning it would boot a stopped distro over 9P, and links across that boundary don't resume. The WSL lane, which runs only at launch, owns those homes.
New settingcodexShareHistoryAcrossAccounts (src/shared/global-settings-types.ts). Absent means on.
Off stops every history bridge the launching host starts:
system default into Orca's shared runtime home;
~/.codex and sibling accounts into a per-account home;
managed accounts into the real ~/.codex (the new lane);
the distro's ~/.codex and sibling WSL accounts into a WSL account home.
Nothing destructive: turning it off removes nothing already linked. Orca just stops adding links.
Out of scope: history-preserving migrations of the user's own retired homes are unchanged; they aren't sharing between accounts.
Hosts own the setting:
SSH and WSL hosts run their own Codex account service against their own settings store, so the setting lives there.
The host publishes it in settings.get (runtime-client-settings.ts, always present) and accepts it in settings.update (client-settings-params.ts).
The switch (CodexHistorySharingSetting.tsx) edits the host chosen in Settings: local settings for this computer, settings.get/settings.update for a paired host.
Mixed versions:
Older hosts parse settings.update strictly and would reject the new key. So the client treats "key present in settings.get" as the capability.
An older host shows "Update Orca on {host} to change this setting there." with the switch disabled, and is never sent the key.
Older clients ignore the extra key in settings.get.
Strings: 4 new ones (title, description, the update-needed note, the failure toast), translated into all 11 locales.
Why
Default on: today every existing lane shares history (#10770), and users rely on it. Making the new ~/.codex lane default-on keeps one consistent rule: history follows you unless you turn sharing off.
One switch for every lane, not just the new one:#24511 asks for a way to stop sharing altogether. A switch that only blocked ~/.codex would still leak sessions between accounts.
Per host: the host that launches Codex writes the links, so a desktop-only switch couldn't stop a WSL or SSH host from sharing.
Known limitation: the opt-out is per host, not per account. It turns all sharing off on that host, or leaves it all on. #24511's "never share into or out of account X" isn't covered.
Reusing codexSessionSourceHome: it's a path, not a switch.
Flag-off: N/A. Not WSL-gated: the setting and lanes apply on macOS, Linux, Windows, WSL and SSH hosts.
User risk: low to medium.
With the default (on), users with system default plus managed host accounts now also get managed-account sessions linked (hardlinks, no extra disk) and indexed into their own ~/.codex. Those sessions then appear in plain codex resume and the picker. Nothing is deleted or moved, and no auth or config is copied.
With it off, no new links are made anywhere. Account switches no longer carry history; that's the point.
Existing users see no change except the new ~/.codex lane.
Linked Issue
Fixes#25000. Addresses #24511 (global opt-out; per-account scoping not included). Related: #10770. Split from #33578; the WSL half shipped as #34968.
Visual Proof
CDP screenshots of hidden renderers (ORCA_BACKGROUND_LAUNCH=1; no window was ever shown), Settings → Agents:
This computer, sharing on (the default):
This computer, turned off:
A paired host running an older Orca (the headless host was built from origin/main at ce44117, before this setting existed). The switch is disabled, says to update that host, and nothing is sent:
Testing
runtime-home-history-sharing-opt-out.test.ts:
each lane shares history by default: real-home, per-account and shared-mirror;
each links nothing when the setting is off;
the WSL lane links nothing when off.
runtime-home-real-home-lane-routing.test.ts:
the new ~/.codex lane bridges the managed account into getSystemCodexHomePath() with hardlinkOnly: true;
a \\wsl.localhost\… history source home starts no bridge.
codex-account-session-bridge-hardlink-only.test.ts: with linkSync throwing EXDEV:
a hardlink-only target creates nothing (no sessions folder) and reports skippedFiles: 1, with no thread queued for indexing;
a bridge between managed homes still falls back to a symlink;
on one volume, hardlink-only links normally.
runtime-client-settings-codex-history.test.ts:
the host always publishes the key, true by default;
a paired update turns it off;
SettingsUpdate accepts it and still rejects unknown keys.
Settings search: "Codex", "history", "share", "shared" and "account" find the switch, using existing localized keywords.
CodexHistorySharingSetting.test.tsx:
local toggle writes local settings;
a paired host is read and written over RPC;
an older host (key absent) shows the update note with the switch disabled, and no settings.update is ever sent.
Suites and checks:
src/main/codex-accounts, src/main/codex, runtime-client-settings*, src/renderer/src/components/settings and src/shared/rpc-contract all pass (4239 tests).
pnpm tc, pnpm run typecheck:ci, verify:rpc-params-catalog, all localization verifies, oxlint, the anti-slop lint, the ast-grep gates, check:process-host-imports and check:code-quality:changed pass.
tests/e2e/cross-version-wire/ needs the tagged-checkout setup that only its CI job provides; CI covers it.
AI Disclosure
Review
Touches session restore, settings wire and agent history: needs two reviewers.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
SSH/WSL: the setting is per host, as above.
Remote wire compatibility: additive settings.get field; the settings.update key is capability-gated by presence.
Folder workspaces: unaffected.
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)
… on system default
When system default launches Codex on the real ~/.codex, bridge every trusted
managed host account home into it so sessions started on a managed account
stay resumable after switching back (#25000).
Split from #33578 (host half). Needs an owner product decision (#10770 vs #24511).
…unts (#24511)
Adds codexShareHistoryAcrossAccounts (absent = on, today's #10770 behaviour).
Off, the host that launches Codex starts none of its history bridges: system
default into the shared runtime home, accounts and ~/.codex into a per-account
home, managed accounts into the real ~/.codex, and the WSL distro and sibling
accounts into a WSL account home. Turning it off removes nothing already linked.
The setting lives in each host's own store, since that host writes the links.
Settings → Agents shows it for the selected host: local writes update this app,
a paired SSH or WSL host is read and written over settings.get/settings.update.
New hosts always publish the key; a host that doesn't is shown as needing an
update and is never sent it, because older hosts' strict update schema would
reject the call. Strings are localized for all 11 locales.
The system-default lane moves into the launch class, keeping managed-home under
the line cap.
nwparker
changed the title
fix(codex): write managed-account history into the user's own ~/.codex on system default [needs owner product decision]
feat(codex): history follows you into ~/.codex on system default, with a per-host opt-out (#24511)
Oct 29, 2026
The change adds a Codex history-sharing setting that defaults to enabled. Runtime launch code uses the setting to control session bridges, including hardlink-only bridging for eligible real-home launches. A new Agents settings control reads and updates the setting locally or on the selected runtime environment. Tests cover setting updates, bridge behavior, launch routing, and unsupported hosts. Localized labels and messages are added.
Priority: Normal
Severity of issue fixed: Medium
Merge Risk: Moderate · up to c2c3e
Users with a custom Codex history source configured will not see managed-account conversations in /resume on a system-default launch, because sessions are linked into the wrong directory. The new settings toggle can also get stuck disabled after a failed read or a quick host switch. Fix the bridge target before merging. The UI states and the Windows test guard are small follow-ups.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly summarizes the primary changes: Codex history sharing into ~/.codex and a per-host opt-out.
Description check
The description covers the required sections, linked issues, user impact, implementation details, visual proof, testing, compatibility, and checklist items. It is sufficiently complete for review.
Linked Issues check
The PR meets the coding requirements in #25000. prepareForCodexLaunch() calls startSystemDefaultSessionBridgeForLaunch() when the host uses the real home. That method selects the effective Codex h…
Out of Scope Changes check
The changes stay within the issue scope. The history-sharing setting, host-specific settings transport, UI, localization, and bridge tests support the #25000 transition or document and control intenti…
Full details: Linked Issues check
Explanation
The PR meets the coding requirements in #25000. prepareForCodexLaunch() calls startSystemDefaultSessionBridgeForLaunch() when the host uses the real home. That method selects the effective Codex home, collects managed account homes, and starts startCodexAccountSessionBridgeInBackground() with hardlinkOnly: true. The bridge links rollout files and calls healCodexAccountSessionIndex() so sessions become discoverable in the target index. The bridge skips WSL-distro sources, which preserves the separate WSL launch path. Tests cover managed-home to real-home routing and the WSL-source guard in runtime-home-real-home-lane-routing.test.ts. The new setting description also explains the intentional isolation behavior when sharing is disabled.
Full details: Out of Scope Changes check
Explanation
The changes stay within the issue scope. The history-sharing setting, host-specific settings transport, UI, localization, and bridge tests support the #25000 transition or document and control intentional account isolation. The hardlink-only behavior prevents unsafe symlink links into the user's real home. The WSL guard prevents the real-home lane from duplicating WSL-owned work. No demonstrated change is unrelated to managed-home history discovery or its required isolation and compatibility behavior.
Full details: Docstring Coverage
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 20 files. (11 skipped: 11 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · 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.
The reason will be displayed to describe this comment to others. Learn more.
History reaches the wrong home
When codexSessionSourceHome.host points elsewhere, this bridge writes managed sessions there instead of into ~/.codex. That setting only changes history discovery; system-default Codex still launches on ~/.codex. Managed conversations therefore remain missing from its resume picker. Use getSystemCodexHomePath() as the destination.
The reason will be displayed to describe this comment to others. Learn more.
Remote switch stays disabled
If the first remote settings.get fails, the switch stays disabled for the rest of the mount. The error handler only logs, and the effect runs again only when environmentId changes. Reconnecting the same host does not recover the control. Add a retry path or reload it when the host reconnects.
The reason will be displayed to describe this comment to others. Learn more.
Write type misses the setting
The new key is added to RuntimeClientSettings, but not to RuntimeClientSettingsUpdate below it. The RPC currently saves it through the ...updates spread, so this works at runtime. However, typed callers cannot directly express this supported update. Add the key to the write type too.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Sharing continues after opt-outsrc/main/codex-accounts/runtime-home-service-managed-home.ts:145▶
Turning sharing off does not stop a bridge already running. This guard runs only before the scan starts, while the scan keeps linking files across accounts without checking the setting again. The WSL loop can also start later source scans after an earlier scan finishes. Pass a live cancellation check through the scans and check it before each WSL source.
How this was verified: The launch guard reads the setting once, but the file-linking loop receives only paths and options and never checks whether sharing was turned off.
…rce is left to the WSL lane
The system-default lane wrote into codexSessionSourceHome when set, which can be
a \\wsl.localhost path: the background scan would boot a stopped distro over 9P
and its cross-volume symlinks are ignored by codex resume. That lane now returns
early for a WSL UNC target; the WSL lane owns those homes.
Into the user's own ~/.codex the bridge now links with hardlinks only: a failed
hardlink (EXDEV across volumes) skips the rollout, counted as skippedFiles,
removes any folder it just created, and never falls back to a symlink that
codex resume ignores and that would dangle once an account is removed. Bridges
between Orca-managed homes keep the symlink fallback.
Also: the setting's JSDoc sits above its own field, and Settings search finds
the switch (codex, history, share, shared, account; existing localized keys).
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Bridge into the home used by the real-home launch.
If codexSessionSourceHome.host names another directory, this code links managed sessions there. The real-home launch leaves CODEX_HOME uninjected, so Codex uses getSystemCodexHomePath() instead. Managed conversations therefore remain absent from that launch’s /resume history. Target the actual launch home; handle the configured history-discovery source separately.
linkCodexSessionFile falls back to symlinkSync(..., 'file') on Windows when linkSync fails. If that symlink fails, the function returns false. The bridge then reports linkedFiles: 0, so the assertion linkedFiles: 1 fails on Windows runners without symlink privileges. Mark this case as Windows-skipped, as other file-symlink tests in the repository do.
🐛 Suggested fix
--- "a/src/main/codex/codex-account-session-bridge-hardlink-only.test.ts"+++ "b/src/main/codex/codex-account-session-bridge-hardlink-only.test.ts"@@ -54,7 +54,7 @@
expect(existsSync(join(root, 'codex', 'sessions'))).toBe(false)
})
-it('still falls back to a symlink between Orca-managed homes', async () => {+it.skipIf(process.platform === 'win32')('still falls back to a symlink between Orca-managed homes', async () => {
const summary = await bridgeCodexSessionsIntoAccountHome({
targetCodexHomePath: join(root, 'codex'),
sourceCodexHomePaths: [join(root, 'account')]
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
it('still falls back to a symlink between Orca-managed homes',async()=>{
it.skipIf(process.platform==='win32')('still falls back to a symlink between Orca-managed homes',async()=>{
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Show a recoverable state when settings.get fails.
If the remote read rejects or times out, this handler only logs the error. The setting stays in loading, so the switch stays disabled until the pane remounts. Show a load error and provide a retry path, including when the host reconnects. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Keep a late update from replacing another host's setting.
If an update for host A remains pending while the user selects host B, host B's read can finish first. The late update then stores host A in remote. Host B returns to loading and its switch stays disabled because the host ID has not changed to trigger another read. Keep results per host, or ignore an update result when its host is no longer selected. The host scope supports changing the selected environment. (raw.githubusercontent.com)
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
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.
ELI5
Orca gives each managed Codex account its own Codex folder. To keep "switch account, keep your conversations" working (#10770), it links session files between those folders, and with this PR also into your own
~/.codexwhen you switch back to system default (#25000). Some people need the opposite: separate accounts for separate organizations must never see each other's history (#24511).This PR adds a real switch, Settings → Agents → Share Codex history across accounts. It's on by default, which keeps today's behavior. When it's off, Orca stops linking Codex history between accounts and into
~/.codex. The switch applies to whichever host you pick in Settings, this computer or a paired SSH or WSL host, because that host is the one writing the links.What Changed
Missing history after switching back to system default (#25000):
~/.codex(system default), the existing background bridge links the trusted managed host accounts' sessions into it and indexes them. That's the same mechanism and gates the per-account lane already uses.runtime-home-service-launch.ts).~/.codex. The bridge links with hardlinks only here, with no symlink fallback. A rollout that can't be hardlinked, for exampleEXDEVacross volumes with a redirected profile or second disk, is skipped (skippedFiles), and any folder created for it is removed. Codex resume ignores symlinked sessions, and a symlink into a managed home would dangle once that account is removed. Bridges between Orca-managed homes keep the existing symlink fallback.codexSessionSourceHome) points inside a distro (\\wsl.localhost\…), this lane does nothing. Scanning it would boot a stopped distro over 9P, and links across that boundary don't resume. The WSL lane, which runs only at launch, owns those homes.The opt-out (#24511):
codexShareHistoryAcrossAccounts(src/shared/global-settings-types.ts). Absent means on.~/.codexand sibling accounts into a per-account home;~/.codex(the new lane);~/.codexand sibling WSL accounts into a WSL account home.Hosts own the setting:
settings.get(runtime-client-settings.ts, always present) and accepts it insettings.update(client-settings-params.ts).CodexHistorySharingSetting.tsx) edits the host chosen in Settings: local settings for this computer,settings.get/settings.updatefor a paired host.Mixed versions:
settings.updatestrictly and would reject the new key. So the client treats "key present insettings.get" as the capability.settings.get.Strings: 4 new ones (title, description, the update-needed note, the failure toast), translated into all 11 locales.
Why
Default on: today every existing lane shares history (#10770), and users rely on it. Making the new
~/.codexlane default-on keeps one consistent rule: history follows you unless you turn sharing off.One switch for every lane, not just the new one: #24511 asks for a way to stop sharing altogether. A switch that only blocked
~/.codexwould still leak sessions between accounts.Per host: the host that launches Codex writes the links, so a desktop-only switch couldn't stop a WSL or SSH host from sharing.
Other options considered:
Known limitation: the opt-out is per host, not per account. It turns all sharing off on that host, or leaves it all on. #24511's "never share into or out of account X" isn't covered.
Reusing
codexSessionSourceHome: it's a path, not a switch.Flag-off: N/A. Not WSL-gated: the setting and lanes apply on macOS, Linux, Windows, WSL and SSH hosts.
User risk: low to medium.
~/.codex. Those sessions then appear in plaincodex resumeand the picker. Nothing is deleted or moved, and no auth or config is copied.~/.codexlane.Linked Issue
Fixes #25000. Addresses #24511 (global opt-out; per-account scoping not included). Related: #10770. Split from #33578; the WSL half shipped as #34968.
Visual Proof
CDP screenshots of hidden renderers (
ORCA_BACKGROUND_LAUNCH=1; no window was ever shown), Settings → Agents:This computer, sharing on (the default):
This computer, turned off:
A paired host running an older Orca (the headless host was built from
origin/mainat ce44117, before this setting existed). The switch is disabled, says to update that host, and nothing is sent:Testing
runtime-home-history-sharing-opt-out.test.ts:runtime-home-real-home-lane-routing.test.ts:~/.codexlane bridges the managed account intogetSystemCodexHomePath()withhardlinkOnly: true;\\wsl.localhost\…history source home starts no bridge.codex-account-session-bridge-hardlink-only.test.ts: withlinkSyncthrowingEXDEV:sessionsfolder) and reportsskippedFiles: 1, with no thread queued for indexing;runtime-client-settings-codex-history.test.ts:trueby default;SettingsUpdateaccepts it and still rejects unknown keys.Settings search: "Codex", "history", "share", "shared" and "account" find the switch, using existing localized keywords.
CodexHistorySharingSetting.test.tsx:settings.updateis ever sent.Suites and checks:
src/main/codex-accounts,src/main/codex,runtime-client-settings*,src/renderer/src/components/settingsandsrc/shared/rpc-contractall pass (4239 tests).pnpm tc,pnpm run typecheck:ci,verify:rpc-params-catalog, all localization verifies, oxlint, the anti-slop lint, the ast-grep gates,check:process-host-importsandcheck:code-quality:changedpass.tests/e2e/cross-version-wire/needs the tagged-checkout setup that only its CI job provides; CI covers it.AI Disclosure
Review
Touches session restore, settings wire and agent history: needs two reviewers.
Agent skill upstream boundary
Notes
settings.getfield; thesettings.updatekey is capability-gated by presence.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)