Skip to content

Improve Copilot agent assignment failure comment with progressive disclosure and precise errors#22664

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/improve-assign-to-agent-comment
Closed

Improve Copilot agent assignment failure comment with progressive disclosure and precise errors#22664
Copilot wants to merge 2 commits intomainfrom
copilot/improve-assign-to-agent-comment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

The failure comment when the workflow can't assign the Copilot coding agent was generic and unhelpful — no run link, no manual assignment instructions, and no error-type-specific guidance.

Changes

  • Progressive disclosure via <details> sections — three collapsible sections replace the flat text:

    • 📋 Failed assignments — exact issues and raw error messages
    • 🔧 Assign manually — copy-paste gh issue edit <n> --add-assignee copilot-swe-agent commands and UI instructions naming the specific agent
    • 💡 Possible causes — branches on actual error type:
      • ERR_PERMISSION / not available → agent not enabled, links to Settings → Copilot
      • Forbidden / Insufficient permissions / Resource not accessible → token misconfiguration with gh aw secrets set remediation
      • fallback → generic causes list
  • Run link footer — appends > [View workflow run #<id>](<url>) when runUrl is available, satisfying the "generated by" requirement

  • Moved from template file to inline JSbuildAssignCopilotFailureContext() now builds the body directly (same pattern as buildCodePushFailureContext) rather than delegating to the now-deleted assign_copilot_to_created_issues_failure.md template; accepts runUrl as a new optional third parameter

  • Call sites updated — both invocations in main() now pass runUrl

  • 15 new unit tests covering empty input, availability errors, permission errors, generic errors, multiple issues, and run URL variants

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs --conditions node --conditions development /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js -m de/node/bin/git git comm�� &#39;/tmp/push-signed-bare-hGsbmN&#39; &#39;/tmp/push-signed-bare-hGsbmN&#39; es/.bin/git --name-status aaaae4e226f65c21rev-parse b7e6705f git (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git add ental-rRXw8w git es/.bin/git modules/@npmcli/git git e_modules/.bin/g-u git rev-�� --count origin/auth-cleanup-success..auth-cleanup-success _modules/.bin/git -M ch es/.bin/git git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…precise errors, and run link

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9cfccf8b-4a14-437f-9eab-7310b4ff2df0
Copilot AI changed the title [WIP] Improve assign to agent failure comment Improve Copilot agent assignment failure comment with progressive disclosure and precise errors Mar 24, 2026
Copilot AI requested a review from pelikhan March 24, 2026 12:04
@pelikhan pelikhan closed this Mar 24, 2026
@github-actions github-actions bot deleted the copilot/improve-assign-to-agent-comment branch April 2, 2026 13:08
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