Repository navigation
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8ccf3d35-262c-4073-88ca-aa13c6bd70b5
📥 Commits
Reviewing files that changed from the base of the PR and between 868fc39 and 283fbf5f49f8f7b4beaa60da59496e6ba26fee83.
📒 Files selected for processing (12)
src/main/codex/codex-mirrored-hook-runtime-trust.test.tssrc/main/codex/codex-mirrored-hook-runtime-trust.tssrc/main/codex/codex-user-hook-trust-rebase-client.test.tssrc/main/codex/codex-user-hook-trust-rebase-client.tssrc/main/codex/config-toml-hook-trust-edit.tssrc/main/codex/config-toml-trust-hook-removal.test.tssrc/main/codex/config-toml-trust-hook-upsert.test.tssrc/main/codex/config-toml-trust-key.test.tssrc/main/codex/config-toml-trust.tssrc/main/codex/hook-service-user-hook-mirroring.test.tssrc/main/codex/hook-service.tssrc/main/codex/hook-trust-promotion.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
283fbf5 to
f2b429c
Compare
Sync update (
|
f2b429c to
ed52080
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Exact-head review verificationVerified commit: A fresh adversarial review-until-clean pass covered stale system approvals, exact normalized key and command matching, disabled state, clear/list/batchWrite/verify/rollback behavior, hash-scoped host/account caching, concurrency, mixed Codex versions, Windows/WSL/SSH boundaries, remote-wire neutrality, and performance. It found and fixed three in-scope issues: disabled mirrored hooks were transiently re-enabled and never cache-stable, unchanged stale approvals repeatedly reopened app-server inspection, and moved-hook repair cleared only one Windows separator spelling. Independent correctness, platform, and performance reviewers were incorporated, and the final exact-head pass found no remaining proven in-scope defects. Live Windows/WSL/SSH Codex validation remains an explicit gap; no such run is claimed. |
Exact-head QA / evidenceVerified commit:
Exact-head GitHub Actions:
Electron/visual proof: N/A. This patch changes no renderer UI, and the motivating flow requires a Windows managed |
e156bd7 to
088cf97
Compare
[High impact] Modifies hook trust verification and storage logic. The trust-update failure path should be made transactional before merging because a write error can delete previously valid mirrored-hook approvals. Findings
SummaryThe PR resolves mirrored Codex hooks to their runtime
|
| clearHookTrustKeySeparatorVariants( | ||
| tomlPath, | ||
| resolvedMirroredTrustEntries.map((entry) => computeTrustKey(entry)) | ||
| ) | ||
| const trustEntries: CodexTrustEntry[] = [ | ||
| ...resolvedMirroredTrustEntries, | ||
| ...managedTrustEntries | ||
| ] | ||
| // Reconcile revoked system approvals too; retaining old runtime trust would leave hooks approved. | ||
| upsertHookTrustEntries(tomlPath, mirroredTrustEntries) | ||
| upsertHookTrustEntries(tomlPath, resolvedMirroredTrustEntries) |
There was a problem hiding this comment.
When a trust-config write, stale-entry cleanup, or enabled-state update fails after clearHookTrustKeySeparatorVariants succeeds, the catch returns an error without restoring the removed approvals, causing mirrored hooks to lose their trust or enabled state and prompt for review until repaired. Apply the clear, upsert, cleanup, and state update transactionally or restore the exact prior TOML snapshot on failure; the maintenance path has the same issue.
Approved system hooks still match by signature (stablyai#7110), but the managed runtime trust entry is written with Codex's hooks/list currentHash instead of the system trusted_hash. Both Windows separator variants of the key are cleared before that write so slash/backslash copies cannot stay conflicted. Fixes stablyai#16428
Incomplete hooks/list records with command:null must not trust a changed hook at the same key.
088cf97 to
590faed
Compare
Sync update (
|
|
Thank you for this, @innocarpe. Your fix pointed at the right place. We landed a narrower version in #43877, which credits you as co-author: on Windows, Orca's hook trust reader now lets the backslash key that Codex itself reads and writes win over Orca's slash copy, so re-approvals stick. Closing this one in favor of that. |
ELI5
Orca mirrors user Codex hooks into a managed
CODEX_HOME. On Windows, the same approved hook can have a different runtime hash and slash spelling, so Codex repeatedly asks to review it. This change asks Codex for the runtime hash, writes it through app-server RPC, and verifies the result without weakening approval checks.What Changed
hooks/listcurrent hash to match the stored approved hash.hooks/list→config/batchWrite→hooks/listwith exact normalized key, command, trusted status, enabled state, and unchanged current hash verification.Why
Copying the system
trusted_hashinto Orca's remapped runtime home leaves Codex seeing a modified hook on every launch. Trust must instead use Codex's runtimecurrentHash, but only after proving the current system hook is still the one the user approved.Linked Issue
Fixes #16428
Linear: STA-5443
Visual Proof
N/A — this is a non-visual Windows app-server/config trust flow with no renderer UI change.
Testing
Node 24 verification at
e156bd72a073bc06f3ff53fcf6d6dde74696a1e6:vitest ... src/main/codex: 1,221 passed; 6 expected skipspnpm tc: passedpnpm run check:code-quality:changed: passedpnpm run check:max-lines-ratchet: passedoxfmt --checkon review-modified files: passedgit diff --check: passedLive Windows/WSL/SSH Codex binaries were not available in this macOS worktree; those environments remain a CI/manual QA gap.
AI Disclosure
Review
A fresh adversarial review-until-clean pass plus independent correctness, platform, and performance reviews completed at the exact head. Proven disabled-state propagation, stale-approval negative-cache, and Windows moved-hook separator-cleanup issues were fixed; the final pass found no remaining in-scope issues.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No wire, provider, renderer, telemetry, credential, or remote protocol shape changes. SSH/folder workspaces are unaffected; Windows and WSL path normalization are covered by unit tests.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Exact-head CI result
At
e156bd72a073bc06f3ff53fcf6d6dde74696a1e6,PR test LoCpassed and 42PR Checksjobs passed, including Windows packaging/boundaries, static analysis, typecheck, managed hooks on Node 18, Git compatibility, shell contracts, and cross-version wire compatibility. The overallPR Checksworkflow is red from two deterministic runtime export-parity failures on Node 24/26 and one Node 26-only WebRTC egress Electron probe failure; all implicated files are byte-identical to base026389a3bc03and outside the Codex PR diff.