Files
claw-code-parity/rust/crates
Yeachan-Heo b3da2f1812 Restore help/config loading when structured hook entries are present
The runtime config loader still treated merged settings.hooks entries as plain strings only. Current user settings can contribute simple wrapper objects that contain command hook definitions, so config loading failed before the CLI could even print help.

This change teaches the loader to accept those simple command hook objects, flatten them into the existing string-based runtime hook config, and leaves plugin hook merging in the typed RuntimeHookConfig path. Focused tests cover both the structured hook parse path and the config-plus-plugin merge path.

Constraint: Preserve the existing string-based runtime hook runner and plugin hook merge behavior

Rejected: Ignore non-string hook entries entirely | would silently drop valid configured command hooks

Rejected: Rework the runtime hook pipeline around the full structured hook schema | larger behavioral change than needed for this regression

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: If hook matchers or non-command hook types are introduced here, extend RuntimeHookConfig deliberately instead of flattening richer semantics implicitly

Tested: cargo test -p runtime loads_command_hooks_from_structured_hook_entries

Tested: cargo test -p runtime loads_and_merges_claude_code_config_files_by_precedence

Tested: cargo test -p rusty-claude-cli build_runtime_plugin_state_

Tested: cargo build -p rusty-claude-cli && CLAW_CONFIG_HOME=$HOME/.claude ./rust/target/debug/claw --help

Not-tested: End-to-end hook execution with matcher-bearing structured hook entries
2026-04-04 12:38:51 +00:00
..
2026-04-01 07:09:06 +00:00