Files
orca/config
Brennan Benson a125662b10 fix(codex): keep history, restarts, and account identity across a switch
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.
2026-07-26 12:28:58 -07:00
..