Summary
modules/tool-skills/amplifier_module_tool_skills/hooks.py (as of Vlad Vannov (@main) cache 2026-08-01):
placement defaults to 'prefix' (hooks.py:80: config.get("placement", "prefix")).
_ensure_prefix_placement() returns a bare bool with two distinct failure modes: context module lacks set_system_prompt_factory (~line 214), or the surface exists but no factory was ever registered (_system_prompt_factory is None, ~lines 217-222 — the hook rightly refuses to wrap, since wrapping would drop a static system prompt).
- The single warn-once message (~lines 153-162) describes only the first branch ("the context module offers no system-prompt factory surface"), but the second branch is the one real sessions actually hit — e.g. every in-process delegate child spawned by amplifier-app-cli's
session_spawner.py, which injects personas via static add_message and never registers a factory. Each child mounts a fresh hook instance, so the "once" guard is per child: delegation-heavy sessions and multi-step recipes produce a warning storm on the user's terminal, with text that misdiagnoses the cause.
- The hook's own comment (~lines 147-151) acknowledges sessions hit this path "without any user misconfiguration".
Suggested fix
- Have
_ensure_prefix_placement() return a reason ("ok" | "no_surface" | "no_factory") instead of a bool.
- Log two distinct, accurate messages.
- Severity: WARNING only when
placement: prefix was explicitly configured ("placement" in config); INFO otherwise (the default-config case). The fallback is graceful and skills remain fully visible, so default-config noise is not actionable for users.
- Update
tests/test_prefix_placement.py for the new branches.
Context: this warning was investigated after a user saw it across many sessions and suspected crashes (unrelated — external SIGTERMs from their terminal host). The root cause of the fallback itself is amplifier-app-cli's spawner never registering a factory for delegate children; a companion issue is filed there. This issue covers only the log level/wording, which ships independently and helps users on any CLI version.
Summary
modules/tool-skills/amplifier_module_tool_skills/hooks.py(as of Vlad Vannov (@main) cache 2026-08-01):placementdefaults to'prefix'(hooks.py:80:config.get("placement", "prefix"))._ensure_prefix_placement()returns a bare bool with two distinct failure modes: context module lacksset_system_prompt_factory(~line 214), or the surface exists but no factory was ever registered (_system_prompt_factory is None, ~lines 217-222 — the hook rightly refuses to wrap, since wrapping would drop a static system prompt).session_spawner.py, which injects personas via staticadd_messageand never registers a factory. Each child mounts a fresh hook instance, so the "once" guard is per child: delegation-heavy sessions and multi-step recipes produce a warning storm on the user's terminal, with text that misdiagnoses the cause.Suggested fix
_ensure_prefix_placement()return a reason ("ok" | "no_surface" | "no_factory") instead of a bool.placement: prefixwas explicitly configured ("placement" in config); INFO otherwise (the default-config case). The fallback is graceful and skills remain fully visible, so default-config noise is not actionable for users.tests/test_prefix_placement.pyfor the new branches.Context: this warning was investigated after a user saw it across many sessions and suspected crashes (unrelated — external SIGTERMs from their terminal host). The root cause of the fallback itself is amplifier-app-cli's spawner never registering a factory for delegate children; a companion issue is filed there. This issue covers only the log level/wording, which ships independently and helps users on any CLI version.