Repository navigation
refactor(codex): remove code the ~/.codex hook rework left unused - #25744
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — the removals are complete and verified; one stale comment example worth a tweak.
Reviewed changes
background/useDefaultCodexHomeplan modes removed — theCodexManagedTrustGrantPlanfields,CODEX_BACKGROUND_TRUST_GRANT_TIMEOUT_MS,findCurrentManagedCodexHookTrust, and everyplan.backgroundguard incodex-hook-trust-grant.tsandcodex-trust-grant-cooldown.ts. The surviving managed path runs the same cooldown, probe and timeout as before.- Request/host surface narrowed —
CodexTrustGrantRequestInput.timeoutMsand the nativebuildRequestdefault-home branch dropped; native now always setsCODEX_HOME+NATIVE_GRANT_TIMEOUT_MS, WSL keepsWSL_GRANT_TIMEOUT_MS. - Shared cache helper removed —
CapabilityProbeCache.runUnshareddeleted;runWithFallbackis the only path. - Startup helper removed —
shouldInstallStartupManagedAgentHookdeleted;resolveStartupManagedHookActionandshouldContinueManagedHookStartupare untouched. - Test cleanup — imports and tests that only exercised the removed branches deleted.
No remaining references to any removed symbol exist in the repo (verified by search), pnpm tc passes, and the four touched/relevant test files pass (48 tests).
ℹ️ Nitpicks
src/main/codex/codex-app-server-session.ts:34-35— theenvToDeletedoc example still reads "an inheritedCODEX_HOME, so a default-home grant runs against the real~/.codex". This PR removed the only grant that producedenvToDelete; the live caller is nowlistCodexHooksincodex-hook-trust-derivation.ts:130whencodexHomeis null. The mechanism is live, but the "grant" example is stale — reword it to the derivation case.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
8a2e9e0 to
fd95a2b
Compare
b4a574a to
225491e
Compare
2b1578c to
f3ff6b4
Compare
225491e to
4afb766
Compare
17ae487 to
ef4388a
Compare
5da068f to
ff3652c
Compare
ef4388a to
8cdba24
Compare
ff3652c to
2cc4cc2
Compare
8cdba24 to
f552966
Compare
2cc4cc2 to
ed88c6d
Compare
f552966 to
c491f5d
Compare
ed88c6d to
26945c1
Compare
c491f5d to
44ba5ec
Compare
5eeb083 to
c0266f3
Compare
44ba5ec to
23ae714
Compare
Only WSL runs a grant session, so resolveNativeCodexTrustGrantHost, its timeout, the native host arm and buildNativeCodexBinaryStamp go. The ledger still parses a native stamp, so files an older build wrote keep loading. The grant suites now run on a WSL host with the guest probe stubbed.
… one host left Only WSL reaches the grant, always on the managed lane; the telemetry event keeps its shape.
…that still grants
23ae714 to
fa2a059
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (37)
💤 Files with no reviewable changes (10)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughRuntime-home routing now uses the host system-default home selection check, and the lane-gate API is removed. Codex trust-grant host handling and capability keys now use WSL distro identities; grant plans use shared fallback handling and apply cooldown checks to all plans. Managed hook startup continuation now also checks whether the application is quitting. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No identified issue blocks merging after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
…de-probes codex-hook-trust-grant.ts takes main's side: #25743/#25744 removed the background trust-grant timeout whose comment PR 2 had updated, so that comment change is dropped. tsconfig.cli.json keeps main's edits plus PR 2's teardown-chain entries, without the two real-home grant files main deleted.

ELI5
The previous PR stopped Orca from running a background Codex approval session for
~/.codex. That left some code with nothing calling it. This PR deletes it. Nothing a user sees changes.What Changed
~/.codexbackground approval used: a "background" mode (longer timeout, no retry cooldown, its own probe lane), a "use the default Codex home" mode, a ledger-only lookup, a shared-cache method for unshared probes, a startup check for whether to install the~/.codexhook, and a native (non-WSL) approval host that, after the earlier PRs in this stack, only tests reached.~/.codex?" question is now one function instead of three.Why
Each removal was checked with a search showing no remaining production caller. Keeping them would leave untested branches that look live. The WSL path and the SSH installer are untouched.
Linked Issue
Fixes #
Visual Proof
N/A: no UI or behavior change.
Testing
src/main+src/clirun: the only 3 failures also fail on the base commit (machine-specific shell tests).Notes