fix(hooks): add tracing instrumentation and propagate hooks in reload_config#3628
Merged
fix(hooks): add tracing instrumentation and propagate hooks in reload_config#3628
Conversation
…_config - add tracing::debug!/info! in check_cwd_changed and handle_file_changed so that hook dispatch is observable in logs (was silent on success) - propagate cwd_changed, permission_denied and turn_complete hooks in reload_config so live config reload takes effect without restart - add regression test covering full cwd_changed/file_changed/permission_denied TOML structure to guard against deserialization regressions Closes #3625
e70e76c to
c72dd6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3625.
Investigation found no deserialization or dispatch bug — hooks were firing correctly but silently. Root causes:
tracing::info!/debug!aroundfire_hookscalls incheck_cwd_changed/handle_file_changed, making it impossible to observe whether hooks firedreload_configdid not propagate[hooks]changes to the runtimehooks_config, so live config reload had no effect on hook commandsChanges
crates/zeph-core/src/agent/mod.rs: addtracing::debug!before eachfire_hookscall andtracing::info!on success incheck_cwd_changedandhandle_file_changed; propagatecwd_changed,permission_denied,turn_completeinreload_config(file_changed requires watcher restart — skipped with comment)crates/zeph-config/src/hooks.rs: regression test covering the fullcwd_changed+file_changed+permission_deniedTOML structureTest plan
cargo nextest run -E 'test(hooks)'— 74/74 pass including new regression testcargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— clean