Summary
Custom agent definitions (.github/agents/*.agent.md) commonly reference supporting docs with paths relative to the agent file, e.g.:
Follow the full guidelines in [architecture-review-guidelines.md](../prompts/architecture-review-guidelines.md).
When a subagent runs, (1) the harness does not auto-inline the linked markdown, and (2) if the agent follows the link literally it resolves the relative path against its working directory (repo root), not against the agent file's directory (.github/agents/). The link points to a non-existent path and the guidelines silently fail to load.
Repro
Repo: Azure/azure-sdk-for-js, agent file .github/agents/archie.agent.md links ../prompts/architecture-review-guidelines.md.
- Agent cwd:
<repo> (e.g. D:\src\azure-sdk-for-js)
- Link resolved against cwd ->
<repo>\..\prompts\... -> D:\src\prompts\architecture-review-guidelines.md -> does not exist
- Actual file ->
<repo>\.github\prompts\architecture-review-guidelines.md -> exists
- Resolved against the agent file dir ->
.github\agents\..\prompts\... -> .github\prompts\... -> correct
Evidence
Probing the archie subagent (tools forbidden) confirmed only the .agent.md body is in context -- the linked file's text is not inlined. A second probe confirmed the literal ../prompts/... path resolves to D:\src\prompts\... (missing) from cwd. All 9 agent files in that repo share this pattern.
Expected
Relative links in an .agent.md should resolve relative to the agent file's own directory (matching GitHub web / editor rendering), and/or the harness should auto-inline referenced markdown into the subagent's context.
Impact
Subagents run without their full guidelines, degrading review quality, with no error surfaced.
Summary
Custom agent definitions (
.github/agents/*.agent.md) commonly reference supporting docs with paths relative to the agent file, e.g.:When a subagent runs, (1) the harness does not auto-inline the linked markdown, and (2) if the agent follows the link literally it resolves the relative path against its working directory (repo root), not against the agent file's directory (
.github/agents/). The link points to a non-existent path and the guidelines silently fail to load.Repro
Repo:
Azure/azure-sdk-for-js, agent file.github/agents/archie.agent.mdlinks../prompts/architecture-review-guidelines.md.<repo>(e.g.D:\src\azure-sdk-for-js)<repo>\..\prompts\...->D:\src\prompts\architecture-review-guidelines.md-> does not exist<repo>\.github\prompts\architecture-review-guidelines.md-> exists.github\agents\..\prompts\...->.github\prompts\...-> correctEvidence
Probing the
archiesubagent (tools forbidden) confirmed only the.agent.mdbody is in context -- the linked file's text is not inlined. A second probe confirmed the literal../prompts/...path resolves toD:\src\prompts\...(missing) from cwd. All 9 agent files in that repo share this pattern.Expected
Relative links in an
.agent.mdshould resolve relative to the agent file's own directory (matching GitHub web / editor rendering), and/or the harness should auto-inline referenced markdown into the subagent's context.Impact
Subagents run without their full guidelines, degrading review quality, with no error surfaced.