Build Failure Analyst
June 10, 2026 · View on GitHub
Delegate to the build-failure-analyst agent defined at
.github/agents/build-failure-analyst.agent.md to analyze the binary log of
the build that just ran and post a PR review when (and only when) the build
failed.
Instructions
-
Read the agent-context environment variables:
GH_AW_BUILD_OUTCOME,GH_AW_BINLOG_PATH,GH_AW_BINLOG_HOST_PATH,GH_AW_PR_NUMBER,GH_AW_PR_HEAD_SHA,GH_AW_WORKSPACE. -
If
GH_AW_BUILD_OUTCOME == 'success', the build did not actually fail — there is nothing to analyse. Callnoopwith the message"Build succeeded — no analysis required."and stop. -
Otherwise, launch the
build-failure-analystagent as a background task (tasktool,agent_type: "general-purpose",model: "claude-opus-4.6",mode: "background"). In the sub-agent prompt include:- All six
GH_AW_*environment values verbatim so the sub-agent knows which binlog to query (GH_AW_BINLOG_PATHis the in-container path/data/build.binlogexposed by thebinlog-mcpMCP server) and where to post. - A reminder that the binlog is live-queryable through the
binlog-mcpMCP server: the sub-agent should call MCP tools such asbinlog_overview,binlog_errors,binlog_warnings(and others as needed) withbinlog_file: "$GH_AW_BINLOG_PATH", rather than reading pre-dumped JSON files. - A reminder that the parent workflow
noops immediately and that the sub-agent itself is responsible for callingadd_comment(summary) andcreate_pull_request_review_comment(inline ```suggestion blocks). - A reminder that
submit_pull_request_reviewis not a safe output for this workflow — inline comments stand alone.
- All six
-
Immediately after launching the background task — do NOT wait for it to finish and do NOT read its result — call
noopwith a brief status message such as"Build-failure analyst launched in background for PR #N. It will post the analysis directly.". Then stop.
Important: Reading the background agent result would pull its entire conversation (including every binlog query and every source file it inspected) into your context. Do not call
read_agentor any equivalent after callingnoop.