Skip to content

Report agent assignment failures without blocking safe_outputs job#13719

Merged
pelikhan merged 2 commits intomainfrom
copilot/report-agent-assignment-failure
Feb 4, 2026
Merged

Report agent assignment failures without blocking safe_outputs job#13719
pelikhan merged 2 commits intomainfrom
copilot/report-agent-assignment-failure

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Agent assignment failures currently fail the safe_outputs job via core.setFailed(), blocking other safe output operations (issue creation, comments, etc). Assignment errors should be reported in the conclusion job without failing safe_outputs.

Changes

actions/setup/js/assign_to_agent.cjs

  • Replace core.setFailed() with core.warning() when assignments fail (line 431)
  • Error details remain captured in job outputs (assignment_errors, assignment_error_count)
  • Configuration validation errors still fail the job as expected

actions/setup/js/assign_to_agent.test.cjs

  • Update 7 test assertions: expect(mockCore.setFailed)expect(mockCore.warning)

Flow

// Before: Job fails, blocks other safe outputs
if (failureCount > 0) {
  core.setFailed(`Failed to assign ${failureCount} agent(s)`);
}

// After: Job continues, errors reported in conclusion
if (failureCount > 0) {
  core.warning(`Failed to assign ${failureCount} agent(s) - errors will be reported in conclusion job`);
}

The handle_agent_failure.cjs script already reads these outputs from safe_outputs job and formats them in failure issues/comments (lines 339-340, 429-444, 511-527).

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21672174594/job/62483376429#step:7:1

Failure to assign to agent must be reported in the agent failure in the conclusion job in the issue/comment. Do not fail the safe outputs job.

See attached report


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

…tputs job

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update agent failure reporting in conclusion job Report agent assignment failures without blocking safe_outputs job Feb 4, 2026
Copilot AI requested a review from pelikhan February 4, 2026 13:21
@pelikhan pelikhan marked this pull request as ready for review February 4, 2026 13:23
Copilot AI review requested due to automatic review settings February 4, 2026 13:23
@pelikhan pelikhan merged commit 3e2eddd into main Feb 4, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/report-agent-assignment-failure branch February 4, 2026 13:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures that agent assignment failures no longer cause the safe_outputs job to fail, allowing downstream safe-output operations (issues, comments, etc.) to still run while surfacing assignment problems via the conclusion job.

Changes:

  • Update assign_to_agent.cjs to replace core.setFailed with core.warning when one or more agent assignments fail, while still setting assignment_errors and assignment_error_count outputs for the conclusion job.
  • Keep configuration validation errors (e.g., invalid GH_AW_AGENT_MAX_COUNT) failing the job via core.setFailed, preserving strictness for misconfiguration.
  • Adjust unit tests in assign_to_agent.test.cjs to expect warnings instead of job failure for assignment error paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
actions/setup/js/assign_to_agent.cjs Switches agent-assignment failure handling from failing the job to emitting a warning, while preserving outputs consumed by handle_agent_failure.cjs.
actions/setup/js/assign_to_agent.test.cjs Updates tests to assert on core.warning for assignment failures and maintains existing checks around core.setFailed only for configuration/other non-assignment paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


expect(mockCore.warning).toHaveBeenCalledWith(expect.stringContaining('Agent "unsupported-agent" is not supported'));
expect(mockCore.setFailed).toHaveBeenCalledWith(expect.stringContaining("Failed to assign 1 agent(s)"));
expect(mockCore.warning).toHaveBeenCalledWith(expect.stringContaining("Failed to assign 1 agent(s)"));
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the PR’s goal is to stop failing the safe_outputs job on agent-assignment errors, this test now only asserts that a warning is logged but no longer checks that core.setFailed is not called. To lock in the new behavior and prevent regressions where assignment failures start failing the job again, consider adding an assertion like expect(mockCore.setFailed).not.toHaveBeenCalled() here (and/or in at least one other failure-path test).

Copilot uses AI. Check for mistakes.
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

Comments