Skip to content

report_incomplete context silently dropped: {report_incomplete_context} placeholder missing from agent_failure_comment.md and agent_failure_issue.md #33068

@IEvangelist

Description

@IEvangelist

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

  1. Run any gh-aw v0.72.x workflow that allows create_report_incomplete_issue as a safe output.
  2. Have the agent produce a report_incomplete item with a non‑empty body (e.g., "I cannot proceed because X").
  3. The handler logs:
    Found 1 report_incomplete signal(s)
    Added comment to existing issue #16138
    
  4. 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:

Run Date (UTC)
25722192005 2026‑05‑12
25858379252 2026‑05‑14
25860321761 2026‑05‑14
25948043739 2026‑05‑16
25948516643 2026‑05‑16
25951955277 2026‑05‑16
25976603668 2026‑05‑16
26013183825 2026‑05‑17
26013265131 2026‑05‑17
26014391681 2026‑05‑17
26024344809 2026‑05‑18

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

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions