Repository navigation
Description
Summary
{{#import shared/file.md}} directives placed in the markdown body of a workflow are recognized by the compiler (listed as "Includes" in the lock file manifest) but their content is never injected into the agent prompt — neither at compile time nor at runtime.
Expected behavior
Per the Imports reference:
Use
imports:in frontmatter or{{#import ...}}in markdown to share workflow components across multiple workflows.
{{#import shared/file.md}} should inline the content of shared/file.md at that position in the prompt, similar to how imports: YAML entries produce {{#runtime-import}} directives that are resolved at runtime.
Actual behavior
-
Compile time: The compiler scans the body, finds
{{#import shared/file.md}}, and records it in the lock file manifest as an "Include" — but does NOT convert it to{{#runtime-import}}and does NOT inline the content. -
Runtime:
interpolate_prompt.cjs(STEP 1: Runtime Imports) only resolves{{#runtime-import ...}}directives.{{#import ...}}directives pass through as raw literal text. -
Result: The agent sees the raw string
{{#import shared/file.md}}in its prompt. The referenced content is completely absent.
Reproduction
# my-workflow.md
---
imports:
- shared/working-import.md # ← this works
---
# Instructions
{{#import shared/broken-import.md}} # ← this does NOT workAfter gh aw compile, inspect the lock file:
# Resolved workflow manifest:
# Imports:
# - shared/working-import.md ← converted to {{#runtime-import}}
# Includes:
# - shared/broken-import.md ← listed but NOT resolved
At runtime, the prompt contains the literal text {{#import shared/broken-import.md}} — the content of broken-import.md is never injected.
Environment
gh-awversion: v0.68.3- Compiler:
gh aw compilecompletes with 0 errors, 0 warnings - Affected: any workflow using
{{#import}}in the markdown body
Workaround
Move {{#import}} references to the imports: YAML key in frontmatter. This produces {{#runtime-import}} directives that the runtime correctly resolves.
Impact
In our repo, 12 workflows with 28 total {{#import}} directives are affected — shared instructions for sub-agent delegation, wiki context, breadcrumb footers, context diaries, and branch resolution are never seen by agents.
Activity