Bug Report — {report_incomplete_context} placeholder is missing from agent_failure_comment.md / agent_failure_issue.md, dropping the agent's reason
Summary
When the agent emits a report_incomplete safe output, buildReportIncompleteContext() in actions/setup/js/handle_agent_failure.cjs correctly assembles a non‑empty context string (containing the agent's stated reason for the incomplete report), and templateContext.report_incomplete_context is set. However, neither actions/setup/md/agent_failure_comment.md nor actions/setup/md/agent_failure_issue.md contains a {report_incomplete_context} placeholder, so renderTemplate() silently drops the value.
The result: when the agent voluntarily flags an incomplete run with a detailed reason, the user sees a vague "Agent emitted N report_incomplete signal(s)" line in the comment with no reason text, even though the reason was captured in agent_output.json and would have been useful to triage.
11 runs in microsoft/aspire's pr-docs-check have hit this since May 11.
Reproduction
- Run any
gh-aw v0.72.x workflow that allows create_report_incomplete_issue as a safe output.
- Have the agent produce a
report_incomplete item with a non‑empty body (e.g., "I cannot proceed because X").
- The handler logs:
Found 1 report_incomplete signal(s)
Added comment to existing issue #16138
- Open the comment. The body contains a generic failure summary; the agent's stated reason is absent.
Root cause
In actions/setup/js/handle_agent_failure.cjs (current main):
- Lines ~796–816 —
buildReportIncompleteContext(items):
function buildReportIncompleteContext(items) {
const reports = items.filter(i => i?.type === "report_incomplete");
if (reports.length === 0) return "";
const bullets = reports.map(r => `- ${r.body || "(no reason provided)"}`).join("\n");
return `\n## Agent's incomplete‑run reason\n\n${bullets}\n`;
}
- Line ~1814 —
const reportIncompleteContext = buildReportIncompleteContext(agentOutputItems);
- Line ~1887 —
templateContext.report_incomplete_context = reportIncompleteContext;
- Line ~1902 —
const renderedComment = renderTemplate(commentTemplate, templateContext);
The pipeline is correct except the templates don't reference the slot:
actions/setup/md/agent_failure_comment.md — placeholder list includes {permission_denied_context}, {missing_safe_outputs_context}, etc., but not {report_incomplete_context}.
actions/setup/md/agent_failure_issue.md — same omission.
renderTemplate() does literal substring substitution; values for missing placeholders are silently discarded.
Evidence
A representative affected run is 25948043739. The agent step finished success, then the safe‑outputs job processed the report_incomplete item:
[handle_agent_failure] Found 1 report_incomplete signal(s)
[handle_agent_failure] Built report_incomplete_context: 312 chars
[handle_agent_failure] Rendering comment template (template length: 1486)
[handle_agent_failure] Added comment to existing issue #16138 (id=...)
But the resulting comment on microsoft/aspire#16138 (and 10 others) shows no reason text — just the generic "Agent emitted 1 report_incomplete signal(s)" boilerplate. The text from the agent (which is in agent_output.json and in the build log) never reaches the reader.
Affected runs
All 11 are pr-docs-check runs in microsoft/aspire, all awf v0.25.41:
Suggested fix
Add {report_incomplete_context} to both templates, positioned to match the handler's variable‑build order (between {permission_denied_context} and {missing_safe_outputs_context}):
actions/setup/md/agent_failure_comment.md (and the analogous spot in agent_failure_issue.md):
... existing content ...
{permission_denied_context}
{report_incomplete_context}
{missing_safe_outputs_context}
... existing content ...
Optional follow‑up: have renderTemplate() warn (or fail in test) when templateContext contains keys with no placeholder slot — that would have caught this at PR time.
Environment
gh-aw: v0.72.0 / v0.72.1
- Engine: GitHub Copilot CLI 1.0.40
- Failure handler:
actions/setup/js/handle_agent_failure.cjs
- Templates:
actions/setup/md/agent_failure_comment.md, actions/setup/md/agent_failure_issue.md
Bug Report —
{report_incomplete_context}placeholder is missing fromagent_failure_comment.md/agent_failure_issue.md, dropping the agent's reasonSummary
When the agent emits a
report_incompletesafe output,buildReportIncompleteContext()inactions/setup/js/handle_agent_failure.cjscorrectly assembles a non‑empty context string (containing the agent's stated reason for the incomplete report), andtemplateContext.report_incomplete_contextis set. However, neitheractions/setup/md/agent_failure_comment.mdnoractions/setup/md/agent_failure_issue.mdcontains a{report_incomplete_context}placeholder, sorenderTemplate()silently drops the value.The result: when the agent voluntarily flags an incomplete run with a detailed reason, the user sees a vague "Agent emitted N report_incomplete signal(s)" line in the comment with no reason text, even though the reason was captured in
agent_output.jsonand would have been useful to triage.11 runs in
microsoft/aspire'spr-docs-checkhave hit this since May 11.Reproduction
gh-aw v0.72.xworkflow that allowscreate_report_incomplete_issueas a safe output.report_incompleteitem with a non‑emptybody(e.g., "I cannot proceed because X").Root cause
In
actions/setup/js/handle_agent_failure.cjs(currentmain):buildReportIncompleteContext(items):const reportIncompleteContext = buildReportIncompleteContext(agentOutputItems);templateContext.report_incomplete_context = reportIncompleteContext;const renderedComment = renderTemplate(commentTemplate, templateContext);The pipeline is correct except the templates don't reference the slot:
actions/setup/md/agent_failure_comment.md— placeholder list includes{permission_denied_context},{missing_safe_outputs_context}, etc., but not{report_incomplete_context}.actions/setup/md/agent_failure_issue.md— same omission.renderTemplate()does literal substring substitution; values for missing placeholders are silently discarded.Evidence
A representative affected run is 25948043739. The agent step finished
success, then the safe‑outputs job processed thereport_incompleteitem:But the resulting comment on
microsoft/aspire#16138(and 10 others) shows no reason text — just the generic "Agent emitted 1 report_incomplete signal(s)" boilerplate. The text from the agent (which is inagent_output.jsonand in the build log) never reaches the reader.Affected runs
All 11 are
pr-docs-checkruns inmicrosoft/aspire, allawf v0.25.41:Suggested fix
Add
{report_incomplete_context}to both templates, positioned to match the handler's variable‑build order (between{permission_denied_context}and{missing_safe_outputs_context}):actions/setup/md/agent_failure_comment.md(and the analogous spot inagent_failure_issue.md):... existing content ... {permission_denied_context} {report_incomplete_context} {missing_safe_outputs_context} ... existing content ...Optional follow‑up: have
renderTemplate()warn (or fail in test) whentemplateContextcontains keys with no placeholder slot — that would have caught this at PR time.Environment
gh-aw:v0.72.0/v0.72.1actions/setup/js/handle_agent_failure.cjsactions/setup/md/agent_failure_comment.md,actions/setup/md/agent_failure_issue.md