feat(bundle): Add agent instruction loading from .md files #30
+394
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where agent instructions from
.mdfiles were never loaded when spawning sub-sessions via the task tool.Fixes: microsoft/amplifier#174
Problem
The
resolve_agent_path()method existed but was never called in the spawn pipeline. Agents specified viainclude:only stored their names, not their instruction content from the.mdfiles.Solution
Add two new methods to the
Bundleclass:load_agent_content(name).mdfiles (frontmatter + body)meta.nameandmeta.descriptionfrom frontmattersystem.instructionNonefor invalid paths or missing filesresolve_agents()include:).mdfilesdeep_mergeto preserve existing nested configsource_base_pathsis populatedSecurity Hardening
..or starting with/agents/directory using path containment checkTests
Added comprehensive tests:
TestBundleAgentLoading(7 tests) - functional testsTestBundleAgentSecurity(3 tests) - path traversal protectionReview Process
This PR went through:
🤖 Generated with Amplifier
Co-Authored-By: Amplifier 240397093+microsoft-amplifier@users.noreply.github.com