Summary
On a fresh install where the user has never run amplifier notify, every session emits a Failed to load module 'hooks-notify' warning + traceback during session init. Two notification-config code paths use different defaults for config.notifications.desktop.enabled, so one path appends a hooks-notify hook override while the other path does not compose the notify bundle — leaving the hook referenced but unresolvable.
Not fatal (sessions continue), but noisy and alarming-looking for every new user.
Environment
amplifier-core 1.3.3
amplifier-app-cli installed via uv tool install amplifier
~/.amplifier/settings.yaml has no config.notifications block (default state for anyone who has never run amplifier notify desktop --enable|--disable)
Root cause
Two defaults disagree:
amplifier_app_cli/lib/settings.py:568 (SettingsManager.get_notification_hook_overrides):
desktop_config = notifications.get("desktop", {})
if desktop_config.get("enabled", True): # <-- defaults True
...
overrides.append({"module": "hooks-notify", "config": hook_config})
amplifier_app_cli/runtime/config.py:833 (_build_notification_behaviors):
desktop_config = notifications_config.get("desktop", {})
desktop_enabled = desktop_config.get("enabled", False) # <-- defaults False
When config.notifications.desktop.enabled is unset:
_build_notification_behaviors returns [] → the notify bundle (git+https://github.com/microsoft/amplifier-bundle-notify@main) is not composed → hooks-notify has no source in the prepared bundle.
get_notification_hook_overrides appends {"module": "hooks-notify", "config": {"enabled": True}} to config.hooks anyway.
- At session init, the loader iterates
config.hooks, tries to resolve hooks-notify against the prepared bundle, fails with ModuleNotFoundError, logs the warning+traceback.
Reproduction
# Fresh install, no prior `amplifier notify` config
rm -rf ~/.amplifier/settings.yaml # or just ensure config.notifications is absent
amplifier run # or any recipe execute / agent delegation
Observe on stderr:
Failed to load module 'hooks-notify': Module 'hooks-notify' not found in prepared bundle. Available modules: [...]
Failed to load hook 'hooks-notify': Module 'hooks-notify' not found in prepared bundle. ...
Traceback (most recent call last):
File ".../amplifier_core/_session_init.py", line 214, in initialize_session
hook_mount = await loader.load(...)
...
amplifier_core.module_sources.ModuleNotFoundError: Module 'hooks-notify' not found in prepared bundle.
Suggested fix
Make the two defaults agree. Since amplifier notify status reports "nothing configured" in this state (and the behaviors-composition path is the authoritative one for deciding whether the hook can be loaded), the safest fix is to change settings.py:568 from True to False:
if desktop_config.get("enabled", False):
Alternative: in runtime/config.py, default to True and always compose the notify bundle — but that changes user-facing behavior (enables desktop notifications by default), so the first fix is probably preferable.
Local workaround
Either one fixes it by writing config.notifications.desktop.enabled explicitly into settings:
amplifier notify desktop --enable # turns feature on
amplifier notify desktop --disable # silences the warning, feature stays off
Summary
On a fresh install where the user has never run
amplifier notify, every session emits aFailed to load module 'hooks-notify'warning + traceback during session init. Two notification-config code paths use different defaults forconfig.notifications.desktop.enabled, so one path appends ahooks-notifyhook override while the other path does not compose the notify bundle — leaving the hook referenced but unresolvable.Not fatal (sessions continue), but noisy and alarming-looking for every new user.
Environment
amplifier-core1.3.3amplifier-app-cliinstalled viauv tool install amplifier~/.amplifier/settings.yamlhas noconfig.notificationsblock (default state for anyone who has never runamplifier notify desktop --enable|--disable)Root cause
Two defaults disagree:
amplifier_app_cli/lib/settings.py:568(SettingsManager.get_notification_hook_overrides):amplifier_app_cli/runtime/config.py:833(_build_notification_behaviors):When
config.notifications.desktop.enabledis unset:_build_notification_behaviorsreturns[]→ the notify bundle (git+https://github.com/microsoft/amplifier-bundle-notify@main) is not composed →hooks-notifyhas no source in the prepared bundle.get_notification_hook_overridesappends{"module": "hooks-notify", "config": {"enabled": True}}toconfig.hooksanyway.config.hooks, tries to resolvehooks-notifyagainst the prepared bundle, fails withModuleNotFoundError, logs the warning+traceback.Reproduction
Observe on stderr:
Suggested fix
Make the two defaults agree. Since
amplifier notify statusreports "nothing configured" in this state (and the behaviors-composition path is the authoritative one for deciding whether the hook can be loaded), the safest fix is to changesettings.py:568fromTruetoFalse:Alternative: in
runtime/config.py, default toTrueand always compose the notify bundle — but that changes user-facing behavior (enables desktop notifications by default), so the first fix is probably preferable.Local workaround
Either one fixes it by writing
config.notifications.desktop.enabledexplicitly into settings: