Background
Sub-issue of #3011. Connect the config fields (from the config sub-issue) to the builtin (from the scaffolding sub-issue) so the runtime actually activates inject_memories for agents that opt in.
Scope
Wire the new AgentConfig fields through the existing builtins/runtime plumbing:
AgentConfig (YAML)
│
▼
ApplyAgentDefaults → builtins.AgentDefaults
│
▼
buildHooksExecutors → registers inject_memories handler when enabled
Implementation Checklist
Acceptance Criteria
Background
Sub-issue of #3011. Connect the config fields (from the config sub-issue) to the builtin (from the scaffolding sub-issue) so the runtime actually activates
inject_memoriesfor agents that opt in.Scope
Wire the new
AgentConfigfields through the existing builtins/runtime plumbing:Implementation Checklist
pkg/agent/agent.go— add accessors:InjectMemories() boolMaxInjectMemories() intInjectMemoriesStrategy() stringpkg/runtime/hooks.go—ApplyAgentDefaults(or equivalent) mapsAgentConfigfields tobuiltins.AgentDefaultspkg/runtime/hooks.go—buildHooksExecutorsregisters theinject_memoriesturn_start handler whenAgentDefaults.InjectMemories == trueand amemorytoolset is bound to the agenthooks.Input.LastUserMessageinexecuteTurnStartHooks(also tracked in feat(memory): Design and implement inject_memories retrieval strategy #3013) — required for the retrieval pipeline to see the user's promptinject_memories(or does not)Acceptance Criteria
inject_memories: trueand amemorytoolset gets the handler registered in its turn_start executorsinject_memories: truebut nomemorytoolset logs a warning and does not register the handler (graceful degradation)inject_memories: false(or unset) has zero behavioural changeInput.LastUserMessageis populated for all turn_start hooks (mirrorsexecuteStopHookspattern)