Repository navigation
Conversation
POLICY CHANGE: this flips a previously-implicit default. See the Notes section below before merging. Why: hooks were installed into 14 other tools' user-global configs on boot; `agentStatusHooksEnabled` defaulted to `true` and every check used `!== false`, so an unset or unreadable setting installed (`default-global-settings.ts:211`, `managed-agent-hook-controls.ts:40-52`; stablyai#9963). Three call sites in `runtime-client-settings.ts` (the change-detection `before`, and both inside `reconcileManagedAgentHooks`) still used the same `!== false` fail-open check even after the default was fixed elsewhere, letting a genuinely absent setting -- a load path that dropped it, or a profile written before this field existed -- read as consent granted and enter the install path. Fix: `agentStatusHooksEnabled` defaults to `false`; every one of these gates is `=== true`; an absent, `null`, or unreadable setting installs nothing. Test: `constants.test.ts` pins the new default. `runtime-client-settings- agent-status-hooks-consent.test.ts`: an absent `agentStatusHooksEnabled` plus a disabled-agent update must not call `applyAgentStatusHooksEnabled` with `true`, and its `shouldContinue` callback must also treat unset hooks as disabled. On `main`: ``` expected 'install' to be 'skip' ``` Ran: both test files above, every other test file under `src/main/agent-hooks/`, the touched `src/main/ipc/` and `src/main/ssh/` fixture files (which construct settings objects this default flows through), and `pnpm run tc:node`. All pass. Tested on macOS only; no OS-specific code touched. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017xLuDWCWWWjzMm64rL13TR
|
Run failed. View the logs →
|
📝 WalkthroughWalkthroughThe change makes Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Existing profiles can retain managed hook installation after upgrade without a new opt-in. Handle legacy settings before merging the consent-policy change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 46e940b4-d269-4377-83b3-283f04c8fd02
📒 Files selected for processing (19)
src/cli/handlers/agent-hooks.tssrc/main/agent-hooks/managed-agent-hook-controls.test.tssrc/main/agent-hooks/managed-agent-hook-controls.tssrc/main/agent-hooks/wsl-hook-relay-live.integration.test.tssrc/main/agent-hooks/wsl-hook-relay-manager.test.tssrc/main/ipc/pty-controller-spawn-admission.test.tssrc/main/ipc/pty-daemon-spawn-agent-home-env.test.tssrc/main/ipc/pty-daemon-spawn-session-identity.test.tssrc/main/ipc/pty-hidden-at-spawn-mark.test.tssrc/main/ipc/pty-ipc-daemon-provider-fixtures.tssrc/main/ipc/pty-ipc-provider-fixtures.tssrc/main/ipc/pty-ipc-spawn-drivers.tssrc/main/ipc/pty-listener-teardown-and-orphans.test.tssrc/main/ipc/pty-serializer-settlement-mapping.test.tssrc/main/runtime/runtime-client-settings-agent-status-hooks-consent.test.tssrc/main/runtime/runtime-client-settings.tssrc/main/ssh/ssh-relay-session-test-fixtures.tssrc/shared/constants.test.tssrc/shared/default-global-settings.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
| agentYoloDefaultsMigrated: true, | ||
| agentStatusHooksEnabled: true, | ||
| // Why: installing managed hooks into other tools' configs needs explicit user consent. | ||
| agentStatusHooksEnabled: false, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Handle legacy hook defaults as unconsented.
src/main/persistence/loading-store/normalize-loaded-global-settings.ts preserves stored agentStatusHooksEnabled: true values because the old boolean cannot distinguish the former default from explicit opt-in. The startup hook gate treats true as consent, so legacy profiles can continue installing managed hooks after upgrade. Reset legacy default-on values or add consent provenance before enabling hook installation.

ELI5
Orca used to install hooks into 14 other tools' configuration files automatically, on boot, unless you'd explicitly turned that off. If the setting was ever missing or unreadable, it installed anyway. Now it only installs if you've explicitly turned it on.
What Changed
Hooks were installed into other tools' user-global configs on boot;
agentStatusHooksEnableddefaulted totrueand every check used!== false, so an unset or unreadable setting installed (default-global-settings.ts:211,managed-agent-hook-controls.ts:40-52; #9963). Three call sites inruntime-client-settings.ts(the change-detectionbeforevalue, and both insidereconcileManagedAgentHooks) still used the same!== falsefail-open pattern even in places that should have matched the already-correctisAgentStatusHooksEnabledhelper (=== true).agentStatusHooksEnablednow defaults tofalse, and every one of these gates is=== true: an absent,null, or unreadable setting installs nothing.Why
Writing into another tool's user-global configuration file is not something that should happen from an absent or unreadable setting — an unset opt-in is not consent. This matches AGENTS.md's documented rule for this codebase: consent is denied by default and fail-closed.
Linked Issue
Related to #9963 (the same issue tracking the shipped-defaults residuals in this area).
Testing
constants.test.tspins the new default (agentStatusHooksEnabledisfalse).runtime-client-settings-agent-status-hooks-consent.test.ts: an absentagentStatusHooksEnabledplus a disabled-agent update must not callapplyAgentStatusHooksEnabledwithtrue, and itsshouldContinuecallback must also treat unset hooks as disabled, not enabled. Onmain:Ran: both test files above, every other test file under
src/main/agent-hooks/, the touchedsrc/main/ipc/andsrc/main/ssh/fixture files (which construct settings objects this default flows through), andpnpm run tc:node. 95 files / 1025 tests pass. Tested on macOS only; no OS-specific code touched.AI Disclosure
Review
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
Policy change, flagged plainly: this flips
agentStatusHooksEnabled's default fromtruetofalse, so an existing installation that relied on the implicit install will need the operator to opt in once (a UI toggle for this setting, if one doesn't already exist, is a natural follow-up). I believe default-off is correct for writing into another tool's config without ever asking, but recognize maintainers may prefer default-on for backward compatibility with existing installs. Happy to flip the default if preferred — the fail-closed=== truegate at all three call sites is the part I'd ask to keep either way, since that's the part that was inconsistent with this codebase's ownisAgentStatusHooksEnabledhelper.Security: this is the fix — installing hooks into other tools' configs now requires explicit, positively-recorded consent. Cross-platform: no OS-specific code touched. Remote SSH: not specific to this change. Mobile: not applicable. Backwards compatibility: no wire shape changed, only the default value of an existing setting and the strictness of three checks against it.
Checklist
N/Awith reason — N/A, no UI change; backend default/consent-gate fix only.pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — ran targetedvitest+tc:nodelocally (see Testing); fullpnpm lint/pnpm buildleft to CI.Extracted from Odin (github.com/unempyd/odin), a derivative that closes Orca's residual orchestration and safety contracts; all of its changes are offered upstream.