-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Context
This issue tracks cleanup work after the upstream fix for agent instruction loading is merged.
Related:
- Upstream issue: Bug: Agent instructions from .md files are never loaded in spawn pipeline microsoft/amplifier#174
- Upstream PR: feat(bundle): Add agent instruction loading from .md files microsoft/amplifier-foundation#30
- Workaround commit: 252dd75
Problem
Agent instructions from .md files were never loaded when spawning sub-sessions via the task tool because resolve_agent_path() was never called in the spawn pipeline.
Current Workaround
We implemented a workaround in the hook-session-start module that:
- On
session:start, readsagents/*.mdfiles - Parses frontmatter and body content
- Updates
coordinator.config['agents']with the loaded instruction content
This allows the amplihack:guide agent (and future agents) to work correctly.
Cleanup Required After PR Merge
Once microsoft/amplifier-foundation#30 is merged:
1. Update amplifier-foundation dependency
Update pyproject.toml to use the version with the fix.
2. Remove workaround from hook-session-start
In amplifier-bundle/modules/hook-session-start/amplifier_hook_session_start/__init__.py:
- Delete
parse_frontmatter()function - Delete
load_agent_content()function - Delete
populate_agent_configs()function - Remove
coordinatorparameter fromSessionStartHook.__init__() - Remove
self._coordinatorstorage - Remove the
if self._coordinator:block in__call__() - Update
mount()to not pass coordinator to hook - Remove
import yamlif no longer needed
3. Simplify bundle.md
In amplifier-bundle/bundle.md:
- Remove the inline
amplihack:guideagent definition - Use
include:pattern instead to referenceagents/guide.md - Remove workaround comments referencing the issue/PR
4. Verify agents load correctly
- Test that
amplihack:guideagent works via task tool - Verify agent instructions are loaded from
.mdfile
Verification
# Test the guide agent
amplifier run --bundle amplihack "Use the amplihack:guide agent to explain what amplihack can do"The agent should respond with knowledge from agents/guide.md.
Do not close until upstream PR is merged and cleanup is complete.