Repository navigation
fix(run-agent-task): emit an error annotation with the failure reason when an agent task fails - #2641
Merged
Merged
Conversation
… when an agent task fails
chubes4
marked this pull request as ready for review
December 5, 2026 15:32
This was referenced Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Before this change, an agent task that failed through the normal result path just set exit code 1. The failure reason was only in the result JSON artifact, so the job log showed nothing but
Process completed with exit code 1. Now the step prints one GitHub Actions::errorannotation built from the normalized failure (stage, code, message), so the cause shows up in the run log, the run annotations and failure notifications.What changed
::error title=Agent task failed (<stage>)::<code>: <message>line on stdout. It is built fromfailure, or fromprojection_errorif there is nofailure, with a generic fallback.%, CR and LF are escaped as workflow-command data, and the title also escapes:and,.writeNormalizedFailurenow returns. Its existingconsole.erroroutput stays.Verification
All gates passed on
3386346e4622. Basemain: gated onf1871b88cbd8, target nowf1871b88cbd8, re-verified: no.HOMEBOY_LINT_BASE=f1871b88cbd864fad990b9212a170434433f36fe homeboy --placement local review lint wp-codebox --path . --…: passed, 111096 ms; retained gate metadata.node tests/execute-native-agent-task-lifecycle.test.mjs: passed, 3791 ms; retained gate evidence.Gate 2 output
Cook run
agent-task-4e1d5f4c-0c75-40d0-805d-615bfe0e0b6cagent-task-4e1d5f4c-0c75-40d0-805d-615bfe0e0b6c-attempt-1-d79c4d6bb8b652ebe924e822f7732436ea419a678060f1ceb8b652ebe924e822f7732436ea419a678060f1ceDelivery
Evidence
node tests/execute-native-agent-task-lifecycle.test.mjsprinted 'native agent task lifecycle ok', including the new annotation assertions for the max-turns and apply-reject cases.AI disclosure
Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served claude-opus-5-5. Cook time: 10m02s.
The AI read the issue, added the annotation helper to execute-native-agent-task.mjs, and extended the lifecycle regression test, under the direction of the Cook requester. Homeboy reports controller verification separately from this account of the AI's work. A human reviews before merge.
Refs #2637