Repository navigation
fix(orcad): keep Codex status hooks in a managed account home on a WSL host, and list its sessions - #28469
Merged
Conversation
…d list its sessions
… find account transcripts by id
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merged
8 of 9 tasks
This was referenced Oct 14, 2026
nwparker
added a commit
that referenced
this pull request
Oct 16, 2026
The per-account tier of the session-file resolver listed homes through getHostCodexHomePathsForSessionDiscovery, which reached the mkdir-ing getOrcaManagedCodexHomePath. The transcript poll runs every 5 s on a miss, so users who never used Codex got userData/codex-runtime-home/home created. Use the path-only resolver for discovery, and skip the per-account ownership checks while the managed accounts root does not exist. Follow-up to #28469.
nwparker
added a commit
that referenced
this pull request
Oct 16, 2026
…9557) The per-account tier of the session-file resolver listed homes through getHostCodexHomePathsForSessionDiscovery, which reached the mkdir-ing getOrcaManagedCodexHomePath. The transcript poll runs every 5 s on a miss, so users who never used Codex got userData/codex-runtime-home/home created. Use the path-only resolver for discovery, and skip the per-account ownership checks while the managed accounts root does not exist. Follow-up to #28469.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
When Orca runs inside a WSL distro as its own server (the not-yet-enabled "WSL host"), a terminal that uses a signed-in Codex account (one Orca manages, not the default
~/.codex) never told Orca what Codex was doing. Its past conversations were also missing from AI Vault. Now that server keeps Orca's status hook in that account's Codex folder and lists the folder's conversations.What Changed
Before: the desktop sends the selected Codex account's in-distro folder (
~/.local/share/orca/codex-accounts/<id>/home) asCODEX_HOMEwhen it opens a terminal on the WSL host. The server inside the distro (orcad) passed it straight through. It never put Orca's status hook in that folder, so a Codex pane there reported no status. AI Vault, and looking a transcript up by session id, only searched~/.codexand Orca's shared folder, so the account's conversations didn't show up.After:
orcadrecognises aCODEX_HOMEthat is an Orca-owned account folder: under the account root, with an ownership marker holding the account id. The path is checked as text first, because it comes from the client. Before the terminal starts,orcadkeeps Orca's status hook in that folder. It uses the same in-place editor that already maintains~/.codex, generalised to take any folder (reconcileCodexHookEntriesInHome,sweepRealHomeCodexHook(home)). Only Orca's entry and its approvals change; the account's own hooks and approvals stay. With status hooks turned off, Orca's entry is taken back out. Any otherCODEX_HOMEis left untouched.orcadlists these account folders as extra Codex folders, so AI Vault shows their sessions. The native-chat lookup by session id now searches per-account folders as a separate tier. It runs only after the default folders miss, never when the caller names its own folders, and an error while listing them is skipped. That last part applies on the desktop too, for its own per-account folders.~/.codexbehaviour is unchanged: the wrappers pass the same paths, the same queue key and the same one-time backup as before. Nothing here turns on the WSL host; it stays behindORCA_INTERNAL_WSL_HOSTS. On SSH hosts there are no such folders, so nothing changes.Why
The first version reused the desktop's installer for managed account homes. That installer rebuilds a home's hooks from
~/.codex. Review found it would delete hooks and approvals that existed only in the account folder, which the WSL bridge always kept. A "skip if something would be lost" guard was then found racy and still lossy. Editing in place the way~/.codexis edited matches what the bridge did, reuses code that is already hardened against concurrent saves, and loses nothing.Linked Issue
Track E step E4 of the internal WSL-host work (no public issue).
Visual Proof
N/A: no UI change. The behaviour is server-side; see Testing for the end-to-end run.
Testing
End-to-end on macOS (POSIX
orcad, the same code that runs in a distro): I builtorcad, started it with an isolatedHOME, paired a client, and created a terminal withCODEX_HOMEpointing at a fake account folder. That folder held its own Stop hook and a rollout file.mainCODEX_HOMEhooks.json(with Codex's approvals)worktree.ps)CODEX_HOMEoutside the account root is untouchedUnit tests:
orcadwiring.The existing
~/.codexlane suites pass unchanged. Not tested on a real WSL distro with a real managed account: there is no test Codex account. Codex's hook firing was exercised by running the installed hook command inside the pane.Review
Three adversarial review rounds with a second model. Round 1 and round 2 findings (lost hooks and approvals, a stat on a wire path, by-id lookup, a race in the guard, a desktop
mkdiron lookup) are each fixed by the redesign or by a direct fix. Round 3: no MEDIUM/HIGH findings, LOW.Agent skill upstream boundary
Notes
orcad.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)