Repository navigation
Conversation
Claude Code validates hooks event names against its settings schema and skips the ENTIRE settings.json when it meets an unknown key, so the OpenClaude-only events Orca injected (StopFailure, PostToolUseFailure, TeammateIdle, PermissionRequest) silenced every user setting in ~/.claude/settings.json — env, statusLine, enabledPlugins (stablyai#15548). CLAUDE_EVENTS stays the master list (OpenClaude emits those events and still gets all of them), but the Claude variant now filters to the schema-valid subset via getEventsForSettings(), and applyManagedHooks() sweeps managed entries under the rejected keys so a config written by an older Orca heals on the next install — user entries in those keys survive, the key only disappears when nothing is left. getStatus() and installRemote() follow the same per-variant list.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughClaude hook handling now derives supported events from configured settings. Claude excludes OpenClaude-only events, while OpenClaude retains all events. Local and remote installation pass settings to Merge Risk: 🟡 Moderate · up to The change stops Orca from adding unsupported Claude hook events and removes managed entries, but user-authored entries under those unsupported keys can still cause Claude Code to reject the entire settings file and disable unrelated settings. Merge readiness is moderate until those remaining invalid keys are handled or explicitly accepted by the owner. 🚥 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: Pro Plus
Run ID: bef7f6fe-1883-4d96-b874-efc12c2a64a5
📒 Files selected for processing (3)
src/main/claude/hook-service.test.tssrc/main/claude/hook-service.tssrc/main/claude/hook-settings.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Review follow-up: keeping a user-authored entry under an unsupported event key left the key in place, and Claude Code rejects the whole settings.json over the unknown key regardless of who wrote the entry — the user's env/statusLine stayed dead exactly as before the heal. In a schema-validating Claude Code an entry under such a key can never fire anyway, so removing the key loses nothing there; OpenClaude lists no unsupported keys, so user config in .openclaude is untouched.
|
Good catch — addressed in ff81f5a. The sweep now deletes a rejected key unconditionally: Claude Code skips the whole settings.json over the unknown key no matter who authored the entry, so the user's env/statusLine stayed just as dead with the key kept, and in a schema-validating Claude Code an entry under such a key can never fire anyway (nothing functional is lost). OpenClaude lists no unsupported keys, so user config under |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d5d2112e-a19a-443e-a41a-4bd87e19d49a
📒 Files selected for processing (2)
src/main/claude/hook-service.test.tssrc/main/claude/hook-settings.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Review follow-up: the Array.isArray guard skipped non-array values under a rejected key, and Claude Code rejects the whole settings.json over the unknown key no matter what its value looks like — a string or object under TeammateIdle poisoned the file exactly like a managed list did. The key is now deleted unconditionally; regression case added.
7bd17fb to
ed0bead
Compare
|
Valid — the |
Fixes #15548.
What changed
Claude Code validates
hooksevent names against its settings schema and skips the entiresettings.jsonwhen it meets an unknown key. Four events Orca injects are OpenClaude-only (StopFailure,PostToolUseFailure,TeammateIdle,PermissionRequest), so installing the Claude hooks silenced every user setting in~/.claude/settings.json—env,statusLine,enabledPlugins, everything — with theSettings Errorbanner shown in the issue.CLAUDE_EVENTSremains the master list — OpenClaude emits those events (the comments document why each exists) and keeps receiving all of them in.openclaude/settings.json.getEventsForSettings()filters the list to the schema-valid subset (SessionStart,UserPromptSubmit,Stop,SubagentStart,SubagentStop,PreToolUse,PostToolUse) for the.claudevariant.applyManagedHooks()additionally sweeps managed entries under the rejected keys, so a config written by an older Orca heals on the next install: keys holding only managed entries disappear, user-authored entries in those keys survive. Without this, existing installs would stay broken until the user edited the file by hand (the workaround the issue describes).getStatus()andinstallRemote()use the same per-variant list, so remote.claudeinstalls stop writing the rejected keys too and status no longer reportspartialfor events Claude never accepts.Nothing functional is lost for Claude Code: it never emitted those four events, so the hooks could not fire there — they only poisoned the file.
Verification
vitest run src/main/claude/hook-service.test.ts— 19/19, including two new cases: the heal sweep (pre-Claude Code hooks:StopFailureis not a valid hook event — causes entire settings.json to be skipped #15548 config with managedStopFailure/TeammateIdleentries + a user entry underPermissionRequest→ keys dropped/kept correctly,envuntouched) and the remote install asserting the four rejected keys are absent.StopFailure).remote-hook-service-installers24/24 — Grok/Kimi keep their own event lists, untouched.pnpm run typecheck:nodeclean.managed-hook-stdin-lifecycle+devin hook-servicereproduce on an unmodified tree (Windows-local, unrelated).