Skip to content

fix(hooks): add tracing instrumentation and propagate hooks in reload_config#3628

Merged
bug-ops merged 2 commits intomainfrom
3625-hooks-cwd-fire-hooks
May 6, 2026
Merged

fix(hooks): add tracing instrumentation and propagate hooks in reload_config#3628
bug-ops merged 2 commits intomainfrom
3625-hooks-cwd-fire-hooks

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 5, 2026

Summary

Fixes #3625.

Investigation found no deserialization or dispatch bug — hooks were firing correctly but silently. Root causes:

  • No tracing::info!/debug! around fire_hooks calls in check_cwd_changed / handle_file_changed, making it impossible to observe whether hooks fired
  • reload_config did not propagate [hooks] changes to the runtime hooks_config, so live config reload had no effect on hook commands

Changes

  • crates/zeph-core/src/agent/mod.rs: add tracing::debug! before each fire_hooks call and tracing::info! on success in check_cwd_changed and handle_file_changed; propagate cwd_changed, permission_denied, turn_complete in reload_config (file_changed requires watcher restart — skipped with comment)
  • crates/zeph-config/src/hooks.rs: regression test covering the full cwd_changed + file_changed + permission_denied TOML structure

Test plan

  • cargo nextest run -E 'test(hooks)' — 74/74 pass including new regression test
  • Full workspace: 8893/8893 pass, no regressions
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean

@github-actions github-actions Bot added rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels May 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 5, 2026 23:58
bug-ops added 2 commits May 6, 2026 02:07
…_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
@bug-ops bug-ops force-pushed the 3625-hooks-cwd-fire-hooks branch from e70e76c to c72dd6b Compare May 6, 2026 00:07
@bug-ops bug-ops merged commit 12050b6 into main May 6, 2026
32 checks passed
@bug-ops bug-ops deleted the 3625-hooks-cwd-fire-hooks branch May 6, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hooks: cwd_changed/file_changed fire_hooks not called — hooks_config appears empty despite TOML config

1 participant