microsoft / microsoft/amplifier
Bug: Agent instructions from .md files are never loaded in spawn pipeline
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
Summary
Agent definitions in .md files within the agents/ directory are never loaded when spawning sub-sessions via the task tool. The resolve_agent_path() method exists but is never called in the spawn pipeline.
Affected component: amplifier-foundation
Root Cause Analysis
1. Agent Parsing Only Stores Names
In amplifier_foundation/bundle.py, the _parse_agents() function only stores agent names, not their content:
def _parse_agents(agents_config, base_path):
if "include" in agents_config:
for name in agents_config["include"]:
result[name] = {"name": name} # ← Just the name, NO instruction!
return result
2. resolve_agent_path() Exists But Is Never Called
The method Bundle.resolve_agent_path() correctly handles both:
source_base_paths[namespace]for included bundles- Fallback to
self.base_pathwhennamespace == self.name
But this method is never called in the spawn pipeline.
3. Spawn Expects Pre-populated Instruction
In the CLI's session_spawner.py, the code expects agent_config to already contain {"system": {"instruction": "..."}}:
system_instruction = agent_config.get("system", {}).get("instruction")
if system_instruction:
await context.add_message({"role": "system", "content": system_instruction})
But it only has {"name": "bundle:agent-name"}.
Impact
- Agents spawn without their specialized system prompts
- Custom agents defined by bundle authors are effectively ignored
- The
agents/directory structure provides no value beyond documentation
Proposed Fix
In the spawn pipeline, before using agent_config, load agent content from the .md file using the existing resolve_agent_path() method.
Steps to Reproduce
- Create a bundle with an agent in
agents/my-agent.md - Register the bundle with
amplifier bundle register - Try to spawn the agent:
Use bundle:my-agent to do X - Observe that the agent's instructions are not loaded
Expected Behavior
Agent instructions from .md files should be loaded and injected as system prompts when spawning.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in amplifier_foundation/bundle.py with _parse_agents() and Bundle.resolve_agent_path(), then trace the spawn path in session_spawner.py where agent_config supplies the system instruction. Reproduce the issue with an agents/my-agent.md file and the task tool. Done means the markdown instructions are loaded and injected as the spawned agent's system prompt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100