Skip to content

Comments

fix: include agent instructions from .md files in spawned sessions#32

Merged
bkrabach merged 1 commit intomainfrom
fix/agent-instruction-loading
Jan 21, 2026
Merged

fix: include agent instructions from .md files in spawned sessions#32
bkrabach merged 1 commit intomainfrom
fix/agent-instruction-loading

Conversation

@bkrabach
Copy link
Collaborator

Summary

Fixed a regression where agent instructions from .md files were being discarded during agent metadata loading.

Problem

In _load_agent_file_metadata(), the markdown body was being assigned to _body (discarded) instead of being included in the returned metadata dict. This meant that agent instructions defined in the markdown body of agent .md files were not available when spawning agent sessions.

Solution

  • Changed _body to body to capture the markdown content
  • Added the body as instruction in the returned dict (if non-empty)
  • This matches how bundle loading handles agent instructions

Related

This fix has a companion change in amplifier-app-cli that updates session_spawner.py to check for the top-level instruction field.

Fixed regression in _load_agent_file_metadata() where markdown body content
was being discarded (assigned to _body). The function now properly includes
the body as 'instruction' in the returned dict, matching how bundle loading
handles agent instructions.

This ensures agent instructions defined in .md files are available when
spawning agent sessions.
@bkrabach bkrabach merged commit 650aff2 into main Jan 21, 2026
1 check passed
@bkrabach bkrabach deleted the fix/agent-instruction-loading branch January 21, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant