Skip to content

fix(hookify): keep stop and prompt rules out of unrelated tool hooks#36925

Open
AliFozooni wants to merge 1 commit intoanthropics:mainfrom
AliFozooni:fix/hookify-event-filtering
Open

fix(hookify): keep stop and prompt rules out of unrelated tool hooks#36925
AliFozooni wants to merge 1 commit intoanthropics:mainfrom
AliFozooni:fix/hookify-event-filtering

Conversation

@AliFozooni
Copy link

Summary

Hookify currently lets unrelated rules evaluate during PreToolUse and PostToolUse when the active tool is outside the Bash/file-edit paths.

This change:

  • scopes unmapped PreToolUse / PostToolUse tools to event: all
  • prevents reason, transcript, and user_prompt from resolving outside their actual hook events
  • adds regression tests covering the misfire while preserving event: all behavior

Test Plan

  • python3 -m unittest plugins/hookify/tests/test_event_filtering.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant