mirror of
https://github.com/instructkr/claw-code.git
synced 2026-06-05 22:17:10 +08:00
fix: validate hook config entries partially
Hook config now supports the Claude Code structured hook format with partial validation. Invalid hook entries are recorded in invalid_hooks while valid siblings are retained, following the same pattern as MCP partial validation (#440). Key changes: - RuntimeInvalidHookConfig now includes typed kind field (invalid_hooks_config or unknown_hook_event) for machine-readable error classification - Hook parsing collects all invalid entries instead of halting at first error - Unknown hook event names recorded as invalid without rejecting valid hooks - Legacy bare-string hooks still load with deprecation warnings - Claude Code documented format loads without error (matcher + nested hooks) - config/status/doctor JSON surfaces hook_validation metadata - classify_error_kind maps hook errors to invalid_hooks_config Generated with https://github.com/Yeachan-Heo/gajae-code Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
1
USAGE.md
1
USAGE.md
@@ -615,6 +615,7 @@ The list is also the precedence chain: project-local settings override project s
|
||||
```
|
||||
|
||||
Object-style matchers are optional. When present, they match tool names case-insensitively and support `*` wildcards plus comma or pipe separated alternatives. Nested hook `type` may be omitted or set to `"command"`; each nested command runs in configuration order.
|
||||
Legacy bare-string hook entries still load for backward compatibility but emit deprecation warnings suggesting migration to object-style entries. Unknown hook event names (e.g. `Stop`, `Notification`) are recorded as invalid without rejecting valid hooks. `status --output-format json` mirrors partial hook validation under `hook_validation` with `valid_count`, `invalid_count`, and `invalid_hooks:[{event, index, hook_index, kind, error_field, reason, valid:false}]`. `doctor --output-format json` includes a `hook validation` check so automation can repair every rejected hook entry without losing usable hooks.
|
||||
|
||||
## Project instruction rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user