Skip to content

Remove agent loading workaround after amplifier-foundation#30 is merged #1957

@rysweet

Description

@rysweet

Context

This issue tracks cleanup work after the upstream fix for agent instruction loading is merged.

Related:

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:

  1. On session:start, reads agents/*.md files
  2. Parses frontmatter and body content
  3. 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 coordinator parameter from SessionStartHook.__init__()
  • Remove self._coordinator storage
  • Remove the if self._coordinator: block in __call__()
  • Update mount() to not pass coordinator to hook
  • Remove import yaml if no longer needed

3. Simplify bundle.md

In amplifier-bundle/bundle.md:

  • Remove the inline amplihack:guide agent definition
  • Use include: pattern instead to reference agents/guide.md
  • Remove workaround comments referencing the issue/PR

4. Verify agents load correctly

  • Test that amplihack:guide agent works via task tool
  • Verify agent instructions are loaded from .md file

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions