Skip to content

fix(codex): keep history, restarts, and account identity across an account switch - #10770

Merged
brennanb2025 merged 11 commits into
mainfrom
brennanb2025/fix-codex-account-switch
Jul 28, 2026
Merged

brennanb2025 merged 11 commits into
mainfrom
brennanb2025/fix-codex-account-switch

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10757.

Three symptoms were reported; all three come from one root cause. A managed
Codex account launches against its own self-contained CODEX_HOME
(codex-accounts/<id>/home, shipped in #9501), and three separate things
assumed that home was interchangeable with the previous shared one.

Keeping them in one PR because they are one defect surface — splitting them
would leave the reporter with a Codex that still loses history, or a Restart
button that still does nothing. Each fix is a separate concern in the diff and
can be reviewed independently.

1. Chat history disappears — /resume lists nothing

Codex's own resume picker only reads rollouts under its launch CODEX_HOME. A
per-account home starts with no sessions/ tree at all, and nothing bridged
history into it: the shared-mirror lane calls
startSystemCodexSessionBridgeInBackground, the per-account lane called
nothing. Orca's own AI Vault still saw every session through
getHostCodexHomePathsForSessionDiscovery, which is why this read as data loss
rather than a listing gap — the conversations were always safe on disk.

New codex-account-session-bridge.ts hardlinks every other Orca-visible home's
rollouts into the launching account's home: the real ~/.codex (or the
configured codexSessionSourceHome), the shared mirror, and sibling accounts.
It runs on selection as well as at launch, so history is linked in before
the newly launched Codex opens /resume — the switch → Restart → /resume
path the reporter actually walks. Compressed .jsonl.zst archives are included.
Hardlinks mean one physical log, so a resume that appends under one account does
not fork the conversation.

2. The restart panel sticks and "nothing happens"

A queued restart is only executed by a mounted TerminalPane, but the
prompt covers every stale pane in the worktree — including tabs that are parked,
cold-deferred past COLD_ACTIVATION_TAB_DEFER_THRESHOLD, or in a
background-mounted worktree. Those never drained, and queueCodexPaneRestarts
left their notices in place, so the prompt returned with a button that now did
nothing. Clicking again did nothing either.

Requesting a restart now answers the prompt immediately (restartRequested)
while the pane keeps its pending restart, and a pane drains that request when
its reconnected PTY binds — the only moment an unmounted pane can act. The
status-bar summary stops re-offering requested panes for the same reason. The
notice record deliberately survives, because previousAccountLabel is the
only memory of the account a pane actually launched under, which is what makes
A → B → A collapse instead of leaving a stale prompt.

This matches the intent already stated in the status-bar copy — "Others restart
when their worktree becomes active"
— which the chip did not honour.

3. Stuck on the previous account no matter how many app restarts

CODEX_HOME is fixed in a shell's environment at spawn and can never be changed
afterwards. The daemon keeps those shells alive across app restarts, while
restart notices — renderer-only state — are discarded. So quitting Orca before
restarting a stale pane stranded it on the old account permanently, with no
prompt left to escape it. The reporter's screenshot shows exactly this: the TUI
reads 0% left (old account) while the status bar reads 78% left (new one).

Each PTY's launch account is now recorded on disk
(userData/codex-pane-accounts.json, keyed by pty id, dropped on real teardown
but not on a reconnectable disconnect) and compared against the current
selection at startup, re-raising the prompt the app restart dropped. The sweep
is deferred off the startup-critical path and still gates on Codex actually
being the foreground process, so plain shells are never nagged.

Unrecorded PTYs are never reported. An absent record means Orca does not
know what a shell is pinned to, and a wrong restart prompt is worse than none.

Notes for review

  • codex-home-paths.ts crossed its max-lines budget, so the resource
    copy-marker helpers moved to codex-managed-home-resource-copy-marker.ts
    rather than taking a suppression (AGENTS.md forbids one). New CLI-reachable
    file added to config/tsconfig.cli.json's explicit list.
  • WSL panes compare against their own per-distro selection, so a host switch
    never prompts a WSL pane and one distro's switch never prompts another's.
  • Resume-pinned panes are deliberately on their session's own account and are
    excluded rather than reported stale.
  • Quota polling does not trigger the bridge: prepareForRateLimitFetch
    returns before syncForCurrentSelection on the self-contained lane. The
    bridge runs on app start, account switch, account removal, and launch.

Testing

Typecheck (node / cli / web), oxlint, max-lines ratchet, and the localization
catalog gates are clean. 7797 tests pass across the codex, codex-accounts, ipc,
store, status-bar, and terminal-pane suites, including new coverage for the
bridge (link/dedupe/self-reference/compressed/idempotent), the pane registry
(persistence across a process restart, teardown, corrupt file, WSL lane
isolation, unrecorded PTYs), the answered-prompt behaviour, and the startup
sweep.

23 renderer failures in browser-pane/markup and right-sidebar are
pre-existing — verified identically on a clean HEAD worktree (this box runs
Node 26; the repo pins Node 24, and they are localStorage-unavailable
failures).

Not verified: I have not run the app. These are code-level fixes with unit
coverage; the account-switch flow is unverified end-to-end, and the reporter is
on Windows where the hardlink/symlink fallbacks differ. Worth a real Windows
pass before shipping.

Known gap: PTYs spawned before this lands have no recorded launch account,
so fix 3 will not re-raise a prompt for them until they are respawned. Closing
that would mean guessing at a shell's account, which risks false prompts, so I
left it.


Review-round fixes (post-initial-push)

Four review rounds ran over this branch. Three defects were found — all of them in this PR's own new
machinery, each one defeated by an existing subsystem:

  • ed40982db0 — the restart drain never fired for an unmounted pane. The effect was keyed on
    store.ptyIdsByTabId[tabId], which never changes on the reattach path: updateTabPtyId returns the
    same array reference when the id is already listed, and reattach binds with
    updateTabPtyId: 'if-missing', which skips the write entirely. So fix 2 closed the prompt via
    restartRequested and then never restarted — the original symptom, minus the retry. Now keyed on
    savedLayout.ptyIdsByLeafId, which is rewritten fresh at the moment the pty binds.
  • ed40982db0 — every daemon reattach overwrote the launch account. recordCodexPaneAccountForSpawn
    ran before provider.spawn, but pty:spawn is also the reattach channel, so a relaunch rewrote the
    record to the current selection and listStalePanes saw no mismatch — fix 3 erased by the very
    reconnect it exists to survive. Now guarded on isReattach and recorded after spawn, keyed on
    result.id.
  • 1818553aa6 — "Keep old account" was not durable. Restart was made durable but dismiss stayed
    renderer-only, leaving the on-disk record in place, so the startup sweep re-raised the same prompt on
    every launch — and since isCodexPaneStale drops all onData while a notice exists, it re-killed that
    pane's keyboard every launch. Dismissing now drops the record via a new
    codexAccounts:forgetStalePanes. A later switch still prompts the pane, because the live path is
    registry-independent.
  • 1f4c0120af — test-only: the "corrupt file" case deleted the registry instead of corrupting it, so
    no parseRegistry malformed-input branch was exercised.

Round 4 came back clean with nothing to change. Gates re-run on the final commit: three typechecks,
oxlint, the max-lines ratchet, and the codex / codex-accounts / ipc / store / status-bar /
terminal-pane suites all pass.

Still unverified: the app has not been run, and there has been no Windows pass. Every round is
code-reading only, and the reporter is on Windows.

Follow-up, out of scope for this PR (pre-existing on main, verified character-identical): dismiss
"Keep old account", then re-select the pane's original account, and you get a false prompt with
inverted labels plus a dead keyboard — the dismissal deleted the notice, so the A→B→A collapse has no
previousAccountLabel to match against. Fixing it needs new renderer state (a dismissed marker
honoured by isCodexPaneStale, collectStalePtyIdsForTabs, and summarizeCodexRestartStatus).


Validation summary (added after review + QA)

This PR now carries six merged fixes and has been reviewed, live-QA'd on macOS, and validated three
times on real Windows 11 — the reporter's platform.

Merged into this branch: #10802 (dismissed notice no longer kills the keyboard), #10803 (sweep
arms on real PTY binds; launcher Codex panes no longer filtered out), #10804 (a resume-pinned pane now
says which account it is on), #10870 (the restart card no longer parks focus on its destructive
Restart button), #10853 (retry ladder widened past the Windows worst case).

Five independent reviews found real defects in every one of the original PRs — several of them
dead-keyboard bugs, and three introduced by the fix for another defect in the same review loop.

Windows validation (3 passes)

Pass 1 at 1818553aa6 found two defects that made the stale-account fix a no-op on Windows: the
startup sweep fired before any PTY was bound and never retried, and launcher Codex panes were filtered
out because Windows reports the deepest process in the tree. Both fixed in #10803.

Pass 3 at c460de6089:

  • Stale prompt after restart — PASS. Warm restart resolves in ~3.7–4.2s (rung 3). Cold full
    restart takes ~21s from bind and needs rung 4
    , so the ladder widening in fix(codex): widen the stale-pane sweep retry ladder past the Windows worst case #10853 was load-bearing:
    under the old three-rung ladder the cold-restart card would never have appeared.
  • Focus fix — PASS, better than specified. With a card from pane A overlaying a healthy pane B, an
    ordinary sentence typed into B reached B (Codex answered it) and Enter did not activate Restart. All
    four codex.exe PIDs unchanged. The residual documented in fix(codex): stop the restart card from parking focus on Restart #10870 (focus leaving the terminal) did
    not occur.
  • Non-agent process — PASS. A pane running vim after exiting Codex got no card, and still none
    45s later, covering rung 4 and part of rung 5.
  • auth.json byte-identical across every pass.

Known gaps, stated rather than implied

  • fix(codex): tell the user when a resumed pane is pinned to another account #10804 is unverified on Windows (BLOCKED — auto-resume could not be manufactured there: with the
    daemon alive the shell survives so no cold restore happens, and killing the daemon discards the
    resume state). macOS-verified only.
  • Cross-volume Windows is untested, and expected to yield no bridged history: linkSync fails with
    EXDEV, the symlink fallback needs Developer Mode, and Codex ignores symlinked JSONL rollouts.
  • A cold-parked pane never binds, so the sweep never covers it and it gets no card.
  • The subagent-deepest launcher shape could not be reproduced on Windows across two passes, so that
    specific branch of the eligibility predicate is fixture-verified only. The original symptom never
    recurred across five account switches.
  • WSL passed isolation (a host switch does not card WSL panes) but this PR's resume mechanism is
    host-lane only.
  • SSH is not covered here. A host-account switch marks and mutes live remote panes — confirmed
    pre-existing on main by two independent QA runs — and remote panes ride all five sweep rungs at 15s
    RPC timeouts despite never being reportable as stale. Tracked as a follow-up.
  • Related pre-existing defect filed as Codex restart card steals focus while muting the pane — a space bar press kills the running session #10863 (restart card focus scope).

Fixes #10757. A managed Codex account launches against its own
self-contained CODEX_HOME, which broke three things at once.

**History disappears (`/resume` is empty).** Codex's own resume picker only
lists rollouts under the launch CODEX_HOME, and nothing bridged history into
a per-account home — only the AI Vault's discovery scan knew about the other
homes. Every other Orca-visible home's rollouts are now hardlinked in, on
selection and again at launch, so one physical log is listed everywhere.

**The restart panel sticks and "nothing happens".** A queued restart is only
executed by a mounted TerminalPane, but the prompt covers every stale pane in
the worktree — including tabs that are parked, cold-deferred, or otherwise
unmounted. Those never drained, so the prompt returned with a button that now
did nothing. Requesting a restart now answers the prompt immediately while the
pane keeps its pending restart, and a pane drains that request when its
reconnected PTY binds. The notice record survives so A -> B -> A still
collapses.

**Stuck on the previous account after a restart.** CODEX_HOME is fixed in a
shell's environment at spawn, and the daemon keeps those shells alive across
app restarts while the restart notices (renderer state) are discarded — so
reopening Codex silently reused the old account with no way to escape. Each
PTY's launch account is now recorded on disk and compared against the current
selection at startup, which re-raises the prompt the app restart dropped.
Unrecorded PTYs are never reported: a wrong prompt is worse than none.

codex-home-paths.ts crossed its max-lines budget, so the resource copy-marker
helpers moved to their own module rather than taking a suppression.
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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
📝 Walkthrough

Walkthrough

The change adds managed-home session bridging with shared hardlink-or-symlink utilities and resource-copy markers. It persists Codex account ownership for PTYs, detects stale panes across host and WSL selections, and exposes stale-pane data through IPC and preload APIs. Renderer restart state now preserves requested and dismissed notices, restores stale-session prompts during startup, updates stale counts and input blocking, retries queued restarts when PTY bindings change, and adds localized restart labels. Tests cover bridging, persistence, stale detection, IPC wiring, and restart behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.07% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes bridge session history across Codex homes and preserve restart/account state, matching the bug fix requested in #10757.
Out of Scope Changes check ✅ Passed The added bridge, registry, restart, and localization changes all support the account-switch/history fix; no clearly unrelated code stands out.
Title check ✅ Passed The title is specific and matches the main PR change around Codex history, restart handling, and account identity.
Description check ✅ Passed The description is detailed and covers the main change, testing, and caveats, though it lacks explicit Screenshots and Security Audit sections.

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/main/codex/codex-pane-account-registry.ts (1)

5-13: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Keep new TypeScript comments concise.

Both blocks explain valid non-obvious behavior but are longer than the repository’s comment policy permits.

  • src/main/codex/codex-pane-account-registry.ts#L5-L13: reduce to a one-line persistence invariant.
  • src/main/ipc/pty.ts#L830-L834: reduce to a one-line spawn-account invariant.

Source: Coding guidelines

src/main/codex/codex-stale-pane-accounts.test.ts (1)

62-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise the branches these tests claim to cover.

Line 63 never reaches the 2,000-entry cap, and Line 74 removes the file rather than corrupting its JSON. Seed 2,000 persisted entries, add one, and write malformed JSON for the parse-failure case.

src/main/codex/codex-session-link.ts (1)

24-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Log tag no longer matches all callers.

linkCodexSessionFile is now shared by codex-session-bridge.ts and codex-account-session-bridge.ts, but the warning still hardcodes [codex-session-bridge], which can mislead triage when a failure actually originates from the account-bridge path.

♻️ Proposed fix
-    console.warn('[codex-session-bridge] Failed to link Codex session:', sourcePath, error)
+    console.warn('[codex-session-link] Failed to link Codex session:', sourcePath, error)
src/main/codex/codex-account-session-bridge.ts (1)

29-51: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Target-only dedup in startCodexAccountSessionBridgeInBackground silently drops a concurrent caller's source list. The in-flight cache keys purely on targetCodexHomePath; a second caller for the same target while a bridge is running gets the first caller's promise, and its own sourceCodexHomePaths are never consulted. This is currently harmless because all callers compute equivalent source lists, but it's an undocumented contract that both production call sites and the new test lean on implicitly.

  • src/main/codex/codex-account-session-bridge.ts#L29-L51: document that concurrent calls for the same target share the first caller's sourceCodexHomePaths (or merge the lists instead of discarding them) so future callers can't silently lose rollout sources.
  • src/main/codex-accounts/runtime-home-service.ts#L260-L281: prepareSelfContainedManagedHomeForLaunch and syncSelfContainedManagedSelection both fire startSelfContainedSessionBridgeForLaunch for the same target with no await in between; note this reliance on identical getSelfContainedSessionBridgeSourceHomes() output explicitly so a future divergence between the two call sites doesn't silently narrow the bridged sources.
  • src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts#L189-L227: the explicit await bridge.startCodexAccountSessionBridgeInBackground({ sourceCodexHomePaths: [...] }) call is actually just awaiting the already in-flight internal bridge from syncForCurrentSelection()/prepareForCodexLaunch() rather than running with its own stated source list; add a comment clarifying this or reset _internals.resetBackgroundBridgeTasks() first if an independent run is intended.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a77fa2d9-5ae8-428c-af38-59a37a830170

📥 Commits

Reviewing files that changed from the base of the PR and between 8f5a454 and a125662.

📒 Files selected for processing (33)
  • config/tsconfig.cli.json
  • src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-accounts/runtime-selection.ts
  • src/main/codex/codex-account-session-bridge.test.ts
  • src/main/codex/codex-account-session-bridge.ts
  • src/main/codex/codex-home-paths.ts
  • src/main/codex/codex-managed-home-resource-copy-marker.ts
  • src/main/codex/codex-pane-account-registry.ts
  • src/main/codex/codex-session-bridge.ts
  • src/main/codex/codex-session-link.ts
  • src/main/codex/codex-stale-pane-accounts.test.ts
  • src/main/codex/codex-stale-pane-accounts.ts
  • src/main/ipc/codex-accounts.ts
  • src/main/ipc/pty.ts
  • src/main/ipc/register-core-handlers.test.ts
  • src/main/ipc/register-core-handlers.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/CodexRestartChip.tsx
  • src/renderer/src/components/codex-restart-chip.test.ts
  • src/renderer/src/components/status-bar/codex-restart-status-summary.test.ts
  • src/renderer/src/components/status-bar/codex-restart-status-summary.ts
  • src/renderer/src/components/terminal-pane/TerminalPane.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/codex-session-restart.test.ts
  • src/renderer/src/lib/codex-session-restart.ts
  • src/renderer/src/store/slices/terminals.ts

Comment thread src/main/ipc/pty.ts Resolved
…nch account across reattach

The pending-restart effect keyed off ptyIdsByTabId, which a restored pane
already lists before it ever mounts, so an unmounted pane's queued restart
never drained. Key off the pane->PTY layout bindings, which bindActivePanePty
and the reattach path both rewrite when a PTY actually binds.

pty:spawn re-records a pane's launch account on every daemon reattach, but a
reattached shell keeps the CODEX_HOME baked in at its original spawn. Recording
the current selection there erased the only evidence the pane was stale, so the
startup sweep found nothing to prompt about. Record after the spawn resolves and
skip reattaches.
The corrupt-file case deleted the registry instead of corrupting it, so
neither the malformed-JSON nor the bad-shape branches of parseRegistry were
exercised. Assert each rejected shape and that a record still lands afterwards.
…arts

"Keep old account" cleared the renderer notice but left the on-disk launch
record, so the startup sweep re-raised the same prompt — and re-blocked that
pane's terminal input — on every subsequent launch. Dismissing now drops the
record through a new codexAccounts:forgetStalePanes handler, matching the
registry's own rule that an unrecorded PTY is never reported.

Also stubs both stale-pane methods in the web preload shim, whose `as never`
cast hid the gap; the sweep rejected with a TypeError there instead of
reporting no stale panes.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07c339e0-1620-4f20-8f8d-d0523deed5b0

📥 Commits

Reviewing files that changed from the base of the PR and between 1f4c012 and 1818553.

📒 Files selected for processing (8)
  • src/main/codex/codex-stale-pane-accounts.test.ts
  • src/main/codex/codex-stale-pane-accounts.ts
  • src/main/ipc/codex-accounts.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/CodexRestartChip.tsx
  • src/renderer/src/components/codex-restart-chip.test.ts
  • src/renderer/src/web/web-preload-api.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/codex/codex-stale-pane-accounts.test.ts
  • src/main/ipc/codex-accounts.ts

Comment on lines 52 to +66
export function dismissStaleWorktreePtyIds(
staleWorktreePtyIds: string[],
clearCodexRestartNotice: (ptyId: string) => void
clearCodexRestartNotice: (ptyId: string) => void,
forgetLaunchAccounts: (ptyIds: string[]) => void
): void {
// Why: restart notices are stored per PTY, but the workspace host presents
// one shared prompt. Clearing all matching PTY notices keeps every pane in
// that worktree consistent with the dismissal.
for (const ptyId of staleWorktreePtyIds) {
clearCodexRestartNotice(ptyId)
}
// Why: notices are renderer-only, so without dropping the on-disk launch
// record the startup sweep re-raises this exact prompt — and re-blocks the
// pane's input — after every app restart the user already answered.
forgetLaunchAccounts(staleWorktreePtyIds)

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Persist the dismissal before clearing the renderer notice.

forgetLaunchAccounts runs after the in-memory notices are cleared, and the component passes a fire-and-forget IPC call that can reject. On failure, the UI reports the prompt as dismissed while the launch record remains, so startup can re-raise it after the next restart. Await the persistence operation first, retain the notice on failure, and add rejection coverage.

Also applies to: 120-124

brennanb2025 added a commit that referenced this pull request Jul 27, 2026
Two comments overstated their case:

- The test fixture credited #10770's hardlink bridge for one id living in
  several homes. That duplication already exists on main via the one-shot
  migrateLegacySessions copy, and attributing it solely to an unlanded PR is
  what makes the tier-2 ordering look unreachable.
- The mirror tier read as a universal justification. The migration it protects
  only fires with the system-default selection; with an account selected the
  tier merely preserves the pre-ranking order.
…eyboard (#10802)

A Codex restart notice makes the pane's onData handler return early, so while
one exists EVERY KEYSTROKE IS DROPPED. Dismissing ("Keep old account") deleted
the notice outright, destroying the only memory of the account the pane
launched under — so re-selecting that ORIGINAL account produced a fresh,
INVERTED notice and a dead keyboard.

Adds a `dismissed` marker plus two shared predicates (blocksCodexPaneInput /
awaitsCodexRestartAnswer) honoured by every consumer, so a dismissal frees the
keyboard immediately while keeping the launch-account memory that drives the
A -> B -> A collapse.

Reproduced on main before fixing, so this is pre-existing; #10770's startup
sweep only widened its reach.

Four defects found across four review rounds, all dead-keyboard: a dismissed
pane still blocked by a sibling's notice in a split tab; queueCodexPaneRestarts
not stripping the marker; a bound pane with no record inheriting tab.ptyId's
block (a plain shell going silently mute); and — introduced by this PR —
markCodexRestartNotices dropping the marker on every re-mark, so a routine
token reauth resurrected an answered prompt and re-muted the pane.

Live-validated in a real Orca dev build: 7/7 desktop cases, input liveness
proven with filesystem probes rather than inferred from state, including a
before/after reproduction of the bug on main's dismissal path in the same build.

Known and out of scope: switching the HOST account marks and mutes live SSH
remote panes. Verified pre-existing and byte-identical on main by two
independent QA runs; needs a follow-up gating the marking on the selection lane.
…t launcher panes (#10803)

Fixes the two defects a live Windows run found in #10770's stale-account
detection, which together made it a no-op on the reporter's platform.

1. The startup sweep fired once during hydration, before any PTY was bound, so
   getLiveCodexSessionPtyIds found nothing, returned early and never retried —
   the prompt never appeared after an app restart. It now arms off real PTY
   binds with a bounded per-PTY ladder (300/1500/4000ms), keyed on the layout
   binding that every bind path rewrites rather than on a point in time.

2. Windows reports the DEEPEST process in the PTY tree, so an Orca launcher
   Codex pane running a subagent read as "claude" and was filtered out before
   the stale-account registry was ever consulted — no card on switch, none from
   the sweep. Eligibility now falls back to tab.launchAgent, deliberately paired
   with a foreground that can only be a deeper agent or an unresolved wrapper,
   so a pane where the user exited Codex back to a shell is never marked.

Four further defects found in review: a HIGH dead-keyboard regression where the
widened predicate marked a Codex tab running less/vim/ssh; a restored-reattach
bind site with zero coverage; a retry-ladder rung collapse where one pane's
timer burned another's rung; and a thrown sweep that permanently stranded every
pane parked on a later rung (that one introduced by the fix for the third).

Live-validated in a real Orca dev build: all five cases pass, including the
less/vim pane getting no card and typing fine, two worktrees prompting with
independent per-PTY timings (741ms / 658ms after their binds, no rung
collapse), and the eligibility module returning all 14 matrix cases correctly
including the Windows claude.exe subagent shape. Bind-to-card ~0.66s, leaving
~3.3s of ladder unused.

Not verified: the real Windows process tree (macOS fixtures only) — a Windows
re-run of the original T5/W4 cases is still required before #10770 lands.

Known and out of scope: a HOST account switch marks and mutes live SSH remote
panes. Pre-existing (base filtered purely on isCodexForegroundProcess with no
lane check) but this PR widens its blast radius via the launchAgent fallback;
needs a follow-up gating markLiveCodexSessionsForRestart on the selection lane.
This PR's own mechanism is safe there — remote panes are never written to the
pane-account registry, verified on disk.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/renderer/src/store/slices/terminals.ts (1)

2793-2820: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider skipping the codexRestartNoticeByPtyId update when no ptyId has a matching notice.

Unlike the sibling dismissCodexRestartNotices a few lines below (which returns {} when nothing changed), queueCodexPaneRestarts always spreads and returns a brand-new codexRestartNoticeByPtyId reference, even when none of the queued ptyIds had an existing notice. This forces any consumer that shallow-compares this map (e.g. selectCodexRestartInputs, status-bar summary) to re-evaluate on every restart, not just Codex-account-related ones.

♻️ Suggested fix mirroring the `dismissCodexRestartNotices` pattern
     set((s) => {
       // Why: the prompt is answered the moment the user asks for a restart. A
       // pane whose tab isn't mounted can only restart when it next mounts, and
       // leaving the prompt up re-showed a button that now does nothing.
       const nextCodexRestartNoticeByPtyId = { ...s.codexRestartNoticeByPtyId }
+      let noticesChanged = false
       for (const ptyId of ptyIds) {
         const notice = nextCodexRestartNoticeByPtyId[ptyId]
         if (notice) {
           // Why: mirror of the strip in dismissCodexRestartNotices. A queued
           // restart leaves the pane on the old account until it relaunches, so
           // it must re-block input that an earlier dismissal had freed.
           const { dismissed: _dismissed, ...kept } = notice
           nextCodexRestartNoticeByPtyId[ptyId] = { ...kept, restartRequested: true }
+          noticesChanged = true
         }
       }
       return {
         pendingCodexPaneRestartIds: {
           ...s.pendingCodexPaneRestartIds,
           ...Object.fromEntries(ptyIds.map((ptyId) => [ptyId, true] as const))
         },
-        codexRestartNoticeByPtyId: nextCodexRestartNoticeByPtyId
+        ...(noticesChanged ? { codexRestartNoticeByPtyId: nextCodexRestartNoticeByPtyId } : {})
       }
     })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9091751c-a9ae-4a68-b7b3-5d29c7fb94b2

📥 Commits

Reviewing files that changed from the base of the PR and between 1818553 and 34e179e.

📒 Files selected for processing (11)
  • src/renderer/src/components/CodexRestartChip.tsx
  • src/renderer/src/components/codex-restart-chip-inputs.test.ts
  • src/renderer/src/components/codex-restart-chip-inputs.ts
  • src/renderer/src/components/codex-restart-chip.test.ts
  • src/renderer/src/components/codex-restart-notice-state.ts
  • src/renderer/src/components/status-bar/codex-restart-status-summary.test.ts
  • src/renderer/src/components/status-bar/codex-restart-status-summary.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/store/slices/codex-restart-notice-lifecycle.test.ts
  • src/renderer/src/store/slices/terminals.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/status-bar/codex-restart-status-summary.ts
  • src/renderer/src/components/CodexRestartChip.tsx

…count (#10804)

When Orca auto-resumes a Codex session belonging to a different account than
the one selected, it deliberately pins CODEX_HOME to the ORIGINATING account so
it never continues a conversation under someone else's credentials. That pin
was silent: the pane came back on the old account while the status bar showed
the new one, which is one of the mechanisms behind #10757's "stuck on the
previous account".

The pin stays — it is correct under concurrent multi-account. This records the
pane's real launch account instead of forgetting it, so the existing chip says
"Codex is still signed in as A. Restart this session to use B."

Review (2 rounds) found three things: the branch was rebased off a stale fork
point where a sibling's notice still muted an innocent split-tab pane — and
since this PR strictly increases panes carrying notices it was amplifying that
keyboard-death path; the runtime-controller spawn site (pty.ts:3705) had ZERO
coverage, with a full behavioural revert leaving all 392 tests green despite
being reachable via the CLI/relay/orchestration resume path; and a comment
claimed the shared runtime mirror "hot-swaps to whichever account is selected",
which is untrue under the shipped config.

Live-validated in a real Orca dev build: all five cases pass, with every
CODEX_HOME claim read off the SPAWNED PROCESS via a shim binary (SIP blocks
ps eww). Restart relaunches under the newly selected account with input
restored and no prompt loop; a same-account resume produces no chip; in a split
tab exactly one pane is noticed while the sibling types normally; and the
runtime-controller path records the launch account when driven over the RPC
socket.

Not verified: WSL is not run and not claimed — prepareCodexSessionResumeForLaunch
returns null for WSL targets, so this mechanism is HOST-LANE ONLY.

Known follow-ups, deliberately not fixed here: a pane resumed into the legacy
mirror is genuinely stale but unnameable in the current record shape, and a
dismissal does not survive a cold restore for a resume-pinned pane (correct
as-is — the new shell really is on the old account).
When a Codex restart notice appears, the card moved keyboard focus to its
default "Restart" button. The card is mounted per WORKTREE — Terminal.tsx
renders it as a sibling of TabGroupSplitLayout — so `root.parentElement` is the
whole worktree surface and shouldFocusMobileDriverAction's xterm branch matches
ANY terminal in it. A notice raised for pane A therefore yanked focus out of a
different, perfectly healthy pane B that the user was typing in.

The focused control was destructive: Restart calls queueCodexPaneRestarts over
every stale pty in the worktree, so the next Space or Enter of the user's prose
silently restarted those Codex sessions and lost their state — the same class of
loss #10757 is about. Verified empirically: focus moves from
TEXTAREA.xterm-helper-textarea to BUTTON 'Restart' 3/3, and Space/Enter changed
the pane's ptyId, i.e. genuinely killed and relaunched the session.

Focus the role="dialog" root instead, with tabIndex={-1} so it is
programmatically focusable but out of the Tab order. The card is still announced
(role + aria-live + labelledby/describedby) and Tab from it still reaches Restart
and Keep, so keyboard and AT discoverability are preserved; the only thing lost
is the ability to fire a session-killing action by accident.
shouldFocusMobileDriverAction is untouched, so MobileDriverOverlay is unchanged.

Both new tests are mutation-proved: restoring restartRef.current?.focus() fails
exactly those two and leaves the other 11 green.

Known residual, deliberately not fixed: focus still leaves a healthy pane for the
dialog. That interrupts typing but no longer destroys anything; narrowing to the
stale pane needs a DOM-to-ptyId mapping the card does not have today.

Not verified: no live app run.

Refs #10863
…worst case (#10853)

Live Windows 11 validation of #10770 measured store-visible PTY bind -> notice
raised at 3,959 / 4,064 / 5,140 ms across three runs. The ladder delays are
CUMULATIVE (queueNextRung -> queue -> Date.now() + delayMs), so the old
[300, 1500, 4000] fired at 300ms / 1.8s / 5.8s from bind — leaving the worst run
roughly 660ms of margin against the final rung. A slightly slower machine, more
panes, or a colder daemon exhausts the ladder and the card NEVER appears,
silently reintroducing the bug #10770 exists to fix. macOS by comparison
resolved in ~0.66s with most of the ladder unused.

Widened to [300, 1500, 4000, 10_000, 20_000] — cumulative 300ms / 1.8s / 5.8s /
15.8s / 35.8s. Early rungs untouched so macOS still resolves under a second; the
tail clears the Windows worst case by 2.7x and 6.2x. Still bounded at five
attempts, not interval-based; queue/takeDuePtyIds are unchanged so per-PTY rung
independence does not regress, and the notified/dismissed/closed-pane guards
were verified to stop late rungs.

Failure mode if the ladder is still short is "no card" — never a dead keyboard.

Review verified the cumulative arithmetic by measurement rather than reading
(both the author and I initially misread the delays as absolute-from-bind) and
confirmed boundedness deterministically 10/10. It also hardened the
bounded-ladder test: it previously asserted only "5 inspects within 120s", which
a 6th rung at 200s passed unchanged — the test named for termination did not pin
termination. Now asserts vi.getTimerCount() === 0, mutation-proved.

Not verified: the Windows field numbers behind the 10s/20s sizing have not been
re-measured on Windows with this change.

Known follow-up, out of scope: remote SSH panes can never be reported stale (they
are never written to the pane-account registry) yet still ride all five rungs at
15s RPC timeouts, so this change raises wasted remote RPC from ~45s to ~75s per
pane. The sweep and the switch-time marking should both skip remote panes for a
host-account change.
…x-account-switch

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/ja.json
#	src/renderer/src/i18n/locales/ko.json
#	src/renderer/src/i18n/locales/zh.json
…x-account-switch

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/ja.json
#	src/renderer/src/i18n/locales/ko.json
#	src/renderer/src/i18n/locales/zh.json
@brennanb2025
brennanb2025 merged commit 9c5d827 into main Jul 28, 2026
25 checks passed
brennanb2025 added a commit that referenced this pull request Jul 28, 2026
… result

#10770 added four pty.test.ts mocks returning a bare { codexHomePath }, while
this branch changed PrepareCodexSessionResume to a discriminated result that
requires an `outcome`. The merge was textually clean and the suite still passed —
vitest does not typecheck — so this only surfaced under tsc.
nwparker added a commit to nwparker/orca that referenced this pull request Jul 29, 2026
…ted locales

7.1 ui.set rejected whole preference payloads on enum drift. The new
AssertNoMissingKeys guard is key-only, so it could not see that
LegacyWorktreeCardProperty omitted 'cli' (in DEFAULT_WORKTREE_CARD_PROPERTIES)
or that rightSidebarTab omitted 'workspaces'/'pr-checks' and every plugin tab.
UiUpdate is .strict(), so one bad value failed the entire batch and silently
dropped sidebarWidth/groupBy/sortBy/filterRepoIds riding the same debounced
write. Both enums now derive from the shared unions, AssertNoMissingValues
catches value drift by name, and UiUpdate drops an unknown value instead of
rejecting the batch around it. Unknown KEYS still reject.

7.2 The SSH shell-ready fallback moved from first-output to spawn, so a remote
shell needing >1.5s to prompt got the bracketed-paste startup command before
readline armed it, with no recovery afterward. The short deadline now applies
only once output proves the shell is talking; a silent-since-spawn shell gets a
longer budget and still delivers eventually.

7.3 The project picker armed in rank order but rendered in section order, so
with a folder group present the BOTTOM row was armed on open and Enter created
the workspace in the wrong place. Row keys now derive from the same sections
that render. The folders bucket also gains the recent-exclusion guard the
projects bucket has; that duplicate was unreachable, so this is symmetry, not a
live bug fix.

7.4 setBrowserPageZoomLevel now compares before writing, so a pane reasserting
a level the host already holds no longer emits a redundant host-wide
HostZoomMap write. The user-applied level also moved to a module-level map
keyed by page id: the guest webview outlives its React pane, so the pane-local
ref re-seeded from the shared Settings default on every remount and let a later
default retroactively hijack an already-zoomed tab. See PR notes on the part of
this finding that could not be fixed as prescribed.

7.5 A non-null sessionId short-circuited the live-work escape hatch, forcing
'loading' over hook 'working' and rendering an idle pane mid-turn: Send instead
of Stop, no typing indicator, no streaming preview. Status stays 'working'; the
empty-transcript loading SURFACE moves to selectNativeChatViewState, which keeps

7.6 stablyai#10770 merged from a base predating stablyai#8549, reverting 182-187 translated
strings per locale to English (es 182, ja/ko/zh 187) plus en.json's recipesHelp.
Restored by script, only where the English source is unchanged between the two
shas, so later legitimate edits are preserved: 0 keys added or removed, every
value sourced from 97e4776, and the four other English-source changes since

7.7 Match highlighting indexed by UTF-16 code unit but rendered by code point,
so an emoji-named folder showed marks one glyph late. Cosmetic.

Co-authored-by: Orca <[email protected]>
nwparker added a commit to nwparker/orca that referenced this pull request Jul 29, 2026
stablyai#10770 merged from a base predating stablyai#8549, so its stale locale copies
overwrote ~185 already-translated strings per locale back to English. A
present catalog value always beats the English translate() fallback, so
those strings render English with nothing to signal the loss.

Since that finding was written, stablyai#11205 and other upstream translation
passes independently re-covered most of ja/ko/zh. Replaying stablyai#8549's
catalogs wholesale would now overwrite that newer work, so this re-applies
a key ONLY where all of the following hold at origin/main: it was
translated at 97e4776, stablyai#10770 reverted it, its English source is
unchanged since, and no upstream commit has touched it since the revert.

  es 182  ja 32  ko 17  zh 55

Everything else is left to upstream. Verified zero upstream translations
reverted: every changed key still matches its stablyai#10770 value at main. Keys
upstream deleted are not resurrected, and keys whose English source was
edited since are skipped as legitimate source changes rather than reverts
(this is what keeps zh CPU on stablyai#11205's deliberate "CPU" over stablyai#8549's
"中央处理器"). Key count and order are unchanged in all five catalogs.

en.json's own recipesHelp was reverted by the same stale base and no
upstream commit has touched it since, so it is restored to match the live
source at EphemeralVmsPane.tsx:252.
nwparker added a commit that referenced this pull request Jul 29, 2026
…ted locales (#11241)

* fix(ui): preference sync, picker arming, zoom, chat status, and reverted locales

7.1 ui.set rejected whole preference payloads on enum drift. The new
AssertNoMissingKeys guard is key-only, so it could not see that
LegacyWorktreeCardProperty omitted 'cli' (in DEFAULT_WORKTREE_CARD_PROPERTIES)
or that rightSidebarTab omitted 'workspaces'/'pr-checks' and every plugin tab.
UiUpdate is .strict(), so one bad value failed the entire batch and silently
dropped sidebarWidth/groupBy/sortBy/filterRepoIds riding the same debounced
write. Both enums now derive from the shared unions, AssertNoMissingValues
catches value drift by name, and UiUpdate drops an unknown value instead of
rejecting the batch around it. Unknown KEYS still reject.

7.2 The SSH shell-ready fallback moved from first-output to spawn, so a remote
shell needing >1.5s to prompt got the bracketed-paste startup command before
readline armed it, with no recovery afterward. The short deadline now applies
only once output proves the shell is talking; a silent-since-spawn shell gets a
longer budget and still delivers eventually.

7.3 The project picker armed in rank order but rendered in section order, so
with a folder group present the BOTTOM row was armed on open and Enter created
the workspace in the wrong place. Row keys now derive from the same sections
that render. The folders bucket also gains the recent-exclusion guard the
projects bucket has; that duplicate was unreachable, so this is symmetry, not a
live bug fix.

7.4 setBrowserPageZoomLevel now compares before writing, so a pane reasserting
a level the host already holds no longer emits a redundant host-wide
HostZoomMap write. The user-applied level also moved to a module-level map
keyed by page id: the guest webview outlives its React pane, so the pane-local
ref re-seeded from the shared Settings default on every remount and let a later
default retroactively hijack an already-zoomed tab. See PR notes on the part of
this finding that could not be fixed as prescribed.

7.5 A non-null sessionId short-circuited the live-work escape hatch, forcing
'loading' over hook 'working' and rendering an idle pane mid-turn: Send instead
of Stop, no typing indicator, no streaming preview. Status stays 'working'; the
empty-transcript loading SURFACE moves to selectNativeChatViewState, which keeps

7.6 #10770 merged from a base predating #8549, reverting 182-187 translated
strings per locale to English (es 182, ja/ko/zh 187) plus en.json's recipesHelp.
Restored by script, only where the English source is unchanged between the two
shas, so later legitimate edits are preserved: 0 keys added or removed, every
value sourced from 97e4776, and the four other English-source changes since

7.7 Match highlighting indexed by UTF-16 code unit but rendered by code point,
so an emoji-named folder showed marks one glyph late. Cosmetic.

Co-authored-by: Orca <[email protected]>

* fix(ssh): keep fast startup delivery on the short fallback deadline

The 15s no-output budget added for the shell-ready fallback was applied to
every SSH launch, including 'fast' delivery. Fast delivery waits for no
marker and pastes nothing prompt-sensitive, so it gained a 10x startup
delay for nothing.

Co-authored-by: Orca <[email protected]>

* fix(rpc): generalize the ui.set value-parity guard to every shared key

Naming worktreeCardProperties and rightSidebarTab left the next field to drift
exactly as unguarded: dropping 'pr-status' from groupBy typechecked clean.
Check the value domain of every shared key instead, against z.input (what a
client may send) rather than z.infer (post-transform).

Also move the pure mergeNativeChatLiveSession suite beside the module it covers;
the hook's test file owns an IO harness and was at the max-lines cap.

Co-authored-by: Orca <[email protected]>

* fix(i18n): re-apply only the locale strings still reverted at HEAD

#10770 merged from a base predating #8549, so its stale locale copies
overwrote ~185 already-translated strings per locale back to English. A
present catalog value always beats the English translate() fallback, so
those strings render English with nothing to signal the loss.

Since that finding was written, #11205 and other upstream translation
passes independently re-covered most of ja/ko/zh. Replaying #8549's
catalogs wholesale would now overwrite that newer work, so this re-applies
a key ONLY where all of the following hold at origin/main: it was
translated at 97e4776, #10770 reverted it, its English source is
unchanged since, and no upstream commit has touched it since the revert.

  es 182  ja 32  ko 17  zh 55

Everything else is left to upstream. Verified zero upstream translations
reverted: every changed key still matches its #10770 value at main. Keys
upstream deleted are not resurrected, and keys whose English source was
edited since are skipped as legitimate source changes rather than reverts
(this is what keeps zh CPU on #11205's deliberate "CPU" over #8549's
"中央处理器"). Key count and order are unchanged in all five catalogs.

en.json's own recipesHelp was reverted by the same stale base and no
upstream commit has touched it since, so it is restored to match the live
source at EphemeralVmsPane.tsx:252.

* fix(rpc): keep null in the ui.set value-parity guard

NonNullable stripped null as well as undefined, so dropping .nullable()
from a `| null` field passed the guard while still rejecting the batch at
runtime -- the exact drift class the guard exists to catch. Proven: making
visibleWorkspaceHostIds non-nullable typechecked clean before, now errors
by name. Also pins the 15s silent-shell budget so it cannot silently
shrink back toward the short deadline.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…count switch (stablyai#10770)

Fixes stablyai#10757. Switching Codex accounts broke three ways, all rooted in the
self-contained per-account CODEX_HOME from stablyai#9501.

HISTORY DISAPPEARED. Codex's own /resume picker only lists rollouts under the
launch CODEX_HOME, and nothing bridged history into a per-account home — only
the AI Vault's discovery scan knew about the other homes. Every other
Orca-visible home's rollouts are now hardlinked in, on selection and again at
launch, so one physical log is listed everywhere.

THE RESTART PANEL STUCK. A queued restart was only drained by a mounted
TerminalPane, but the prompt covered every stale pane in the worktree including
parked and cold-deferred tabs. Requesting a restart now answers the prompt
immediately while the pane keeps its pending restart, and a pane drains it when
its reconnected PTY binds.

PANES STAYED ON THE OLD ACCOUNT. CODEX_HOME is fixed in a shell's environment at
spawn and the daemon keeps those shells alive across app restarts, while the
restart notices are renderer state and are discarded. Each PTY's launch account
is now recorded on disk and compared against the current selection at startup.

Also merged in: stablyai#10802 (a dismissed notice no longer kills the pane's keyboard),
stablyai#10803 (the sweep arms on real PTY binds, and launcher Codex panes are no longer
filtered out by Windows deepest-process reporting), stablyai#10804 (a resume-pinned pane
now says which account it is on), stablyai#10870 (the restart card no longer parks focus
on its destructive Restart button), stablyai#10853 (the retry ladder is widened past the
Windows worst case).

Six independent reviews found real defects in every original PR, several of them
dead-keyboard bugs and three introduced by the fix for another defect in the same
loop. Live QA on macOS covered every PR; Windows was validated three times.

WINDOWS: pass 1 found two defects that made the stale-account fix a no-op there
(the sweep fired before any PTY was bound and never retried; launcher panes were
filtered out). Pass 3 at the merged head: the prompt appears on its own after a
restart — warm ~3.7-4.2s, cold ~21s needing rung 4, so stablyai#10853's widening was
load-bearing rather than precautionary; an ordinary sentence typed into a healthy
pane while another pane's card is up reaches that pane and kills nothing; a pane
running vim after exiting Codex gets no card, still none 45s later. auth.json
byte-identical across every pass.

KNOWN GAPS, stated rather than implied: stablyai#10804 is unverified on Windows
(auto-resume could not be manufactured there); cross-volume Windows is untested
and expected to yield no bridged history (EXDEV, and Codex ignores symlinked
rollouts); a cold-parked pane never binds so the sweep never covers it; the
subagent-deepest launcher shape could not be reproduced on Windows, so that
branch is fixture-verified only; WSL passed isolation but the resume mechanism is
host-lane only. A host-account switch also marks and mutes live SSH remote panes
— confirmed pre-existing on main by two independent QA runs — tracked separately
in stablyai#10992. Related pre-existing defect filed as stablyai#10863.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ted locales (stablyai#11241)

* fix(ui): preference sync, picker arming, zoom, chat status, and reverted locales

7.1 ui.set rejected whole preference payloads on enum drift. The new
AssertNoMissingKeys guard is key-only, so it could not see that
LegacyWorktreeCardProperty omitted 'cli' (in DEFAULT_WORKTREE_CARD_PROPERTIES)
or that rightSidebarTab omitted 'workspaces'/'pr-checks' and every plugin tab.
UiUpdate is .strict(), so one bad value failed the entire batch and silently
dropped sidebarWidth/groupBy/sortBy/filterRepoIds riding the same debounced
write. Both enums now derive from the shared unions, AssertNoMissingValues
catches value drift by name, and UiUpdate drops an unknown value instead of
rejecting the batch around it. Unknown KEYS still reject.

7.2 The SSH shell-ready fallback moved from first-output to spawn, so a remote
shell needing >1.5s to prompt got the bracketed-paste startup command before
readline armed it, with no recovery afterward. The short deadline now applies
only once output proves the shell is talking; a silent-since-spawn shell gets a
longer budget and still delivers eventually.

7.3 The project picker armed in rank order but rendered in section order, so
with a folder group present the BOTTOM row was armed on open and Enter created
the workspace in the wrong place. Row keys now derive from the same sections
that render. The folders bucket also gains the recent-exclusion guard the
projects bucket has; that duplicate was unreachable, so this is symmetry, not a
live bug fix.

7.4 setBrowserPageZoomLevel now compares before writing, so a pane reasserting
a level the host already holds no longer emits a redundant host-wide
HostZoomMap write. The user-applied level also moved to a module-level map
keyed by page id: the guest webview outlives its React pane, so the pane-local
ref re-seeded from the shared Settings default on every remount and let a later
default retroactively hijack an already-zoomed tab. See PR notes on the part of
this finding that could not be fixed as prescribed.

7.5 A non-null sessionId short-circuited the live-work escape hatch, forcing
'loading' over hook 'working' and rendering an idle pane mid-turn: Send instead
of Stop, no typing indicator, no streaming preview. Status stays 'working'; the
empty-transcript loading SURFACE moves to selectNativeChatViewState, which keeps

7.6 stablyai#10770 merged from a base predating stablyai#8549, reverting 182-187 translated
strings per locale to English (es 182, ja/ko/zh 187) plus en.json's recipesHelp.
Restored by script, only where the English source is unchanged between the two
shas, so later legitimate edits are preserved: 0 keys added or removed, every
value sourced from edf5219, and the four other English-source changes since

7.7 Match highlighting indexed by UTF-16 code unit but rendered by code point,
so an emoji-named folder showed marks one glyph late. Cosmetic.

Co-authored-by: Orca <[email protected]>

* fix(ssh): keep fast startup delivery on the short fallback deadline

The 15s no-output budget added for the shell-ready fallback was applied to
every SSH launch, including 'fast' delivery. Fast delivery waits for no
marker and pastes nothing prompt-sensitive, so it gained a 10x startup
delay for nothing.

Co-authored-by: Orca <[email protected]>

* fix(rpc): generalize the ui.set value-parity guard to every shared key

Naming worktreeCardProperties and rightSidebarTab left the next field to drift
exactly as unguarded: dropping 'pr-status' from groupBy typechecked clean.
Check the value domain of every shared key instead, against z.input (what a
client may send) rather than z.infer (post-transform).

Also move the pure mergeNativeChatLiveSession suite beside the module it covers;
the hook's test file owns an IO harness and was at the max-lines cap.

Co-authored-by: Orca <[email protected]>

* fix(i18n): re-apply only the locale strings still reverted at HEAD

stablyai#10770 merged from a base predating stablyai#8549, so its stale locale copies
overwrote ~185 already-translated strings per locale back to English. A
present catalog value always beats the English translate() fallback, so
those strings render English with nothing to signal the loss.

Since that finding was written, stablyai#11205 and other upstream translation
passes independently re-covered most of ja/ko/zh. Replaying stablyai#8549's
catalogs wholesale would now overwrite that newer work, so this re-applies
a key ONLY where all of the following hold at origin/main: it was
translated at edf5219, stablyai#10770 reverted it, its English source is
unchanged since, and no upstream commit has touched it since the revert.

  es 182  ja 32  ko 17  zh 55

Everything else is left to upstream. Verified zero upstream translations
reverted: every changed key still matches its stablyai#10770 value at main. Keys
upstream deleted are not resurrected, and keys whose English source was
edited since are skipped as legitimate source changes rather than reverts
(this is what keeps zh CPU on stablyai#11205's deliberate "CPU" over stablyai#8549's
"中央处理器"). Key count and order are unchanged in all five catalogs.

en.json's own recipesHelp was reverted by the same stale base and no
upstream commit has touched it since, so it is restored to match the live
source at EphemeralVmsPane.tsx:252.

* fix(rpc): keep null in the ui.set value-parity guard

NonNullable stripped null as well as undefined, so dropping .nullable()
from a `| null` field passed the guard while still rejecting the batch at
runtime -- the exact drift class the guard exists to catch. Proven: making
visibleWorkspaceHostIds non-nullable typechecked clean before, now errors
by name. Also pins the 15s silent-shell budget so it cannot silently
shrink back toward the short deadline.

Co-authored-by: Orca <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
nwparker added a commit that referenced this pull request Oct 29, 2026
… 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).
nwparker added a commit that referenced this pull request Oct 29, 2026
…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 added a commit that referenced this pull request Oct 29, 2026
…h a per-host opt-out (#24511) (#34981)

* fix(codex): link managed-account history into the user's own ~/.codex 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).

* feat(codex): a per-host opt-out for sharing Codex history across accounts (#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.

* fix(codex): ~/.codex gets hardlinks or nothing, and a WSL history source 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).
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.

[Bug] CHAT HISTORY LOST AFTER ACCOUNT SWITCH !!!!

1 participant