Skip to content

Comments

fix: use HookRegistry.emit() instead of non-existent .fire()#32

Open
Joi wants to merge 1 commit intomicrosoft:mainfrom
Joi:fix/hook-registry-fire-to-emit
Open

fix: use HookRegistry.emit() instead of non-existent .fire()#32
Joi wants to merge 1 commit intomicrosoft:mainfrom
Joi:fix/hook-registry-fire-to-emit

Conversation

@Joi
Copy link

@Joi Joi commented Feb 7, 2026

Summary

  • Fix AttributeError: 'HookRegistry' object has no attribute 'fire' that breaks all recipe execution
  • The HookRegistry class in amplifier-core exposes emit() for firing hook events, but executor.py was calling the non-existent hooks.fire()
  • One-line change: hooks.fire(event_name, event_data)hooks.emit(event_name, event_data)

Details

In modules/tool-recipes/amplifier_module_tool_recipes/executor.py (line 272), the recipe executor dispatches structured hook events for UI integration (e.g., Canvas). The call used hooks.fire(), which does not exist on the HookRegistry class — the correct method is hooks.emit().

This causes every recipe execution to crash with:

AttributeError: 'HookRegistry' object has no attribute 'fire'

Test plan

  • Run any recipe end-to-end and confirm no AttributeError on hook dispatch
  • Verify hook events are received by subscribers (e.g., Canvas UI)

🤖 Generated with Amplifier

The HookRegistry class in amplifier-core exposes emit() for firing
hook events, but executor.py was calling hooks.fire() which does not
exist. This causes an AttributeError on every recipe execution:

  AttributeError: 'HookRegistry' object has no attribute 'fire'

Change the call to hooks.emit() to match the actual API.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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