Skip to content

Report agent assignment errors in workflow failure tracking#11206

Merged
pelikhan merged 3 commits intomainfrom
copilot/report-assignment-error-output
Jan 22, 2026
Merged

Report agent assignment errors in workflow failure tracking#11206
pelikhan merged 3 commits intomainfrom
copilot/report-assignment-error-output

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Agent assignment failures (due to missing or invalid GH_AW_AGENT_TOKEN) were silently failing without being reported in the failure tracking issue. This made it difficult to diagnose why assignments weren't happening.

Changes

  • Capture assignment errors: assign_to_agent.cjs now exports assignment_errors and assignment_error_count outputs containing failure details
  • Expose through workflow: Compiler adds these outputs to the safe_outputs job in generated workflows
  • Pass to conclusion job: notify_comment.go supplies assignment error data as environment variables
  • Report in failure issues: handle_agent_failure.cjs processes assignment errors even when agent job succeeds, formatting them in failure issues/comments

Result

Failure issues now display assignment errors with issue numbers and error messages:

⚠️ Agent Assignment Failed: Failed to assign agent to issues due to insufficient permissions or missing token.

Assignment Errors:
- Issue #11198 (agent: copilot): Failed to assign copilot via GraphQL
- Issue #11136 (agent: copilot): Insufficient permissions

Error format: {type}:{number}:{agent}:{error_message} where type is "issue" or "pr".

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21238712945/job/61112047802#step:7:1

When assigning the agent fails (because of missing token or invalid token), report the error as an output variable.

In the conclusion job, review this output variable and add it to the "failed runs" issue or comment created when a problem is detected.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 22, 2026 07:06
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add output variable for assignment errors Report agent assignment errors in workflow failure tracking Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 07:16
@pelikhan pelikhan marked this pull request as ready for review January 22, 2026 07:19
@pelikhan pelikhan merged commit c26e5c9 into main Jan 22, 2026
@pelikhan pelikhan deleted the copilot/report-assignment-error-output branch January 22, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants