Skip to content

Fix issue-triage-agent: correct MCP tool name and read issue from payload - #67962

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-issue-triage-agent-debug
Jul 22, 2026
Merged

DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-issue-triage-agent-debug

Conversation

@DeagleGross

Copy link
Copy Markdown
Member

Problem

The issue-triage-agent workflow was consistently failing to read the triggering issue. Two prompt-level bugs are fixed here.

1. Wrong MCP tool name (get_issue → issue_read)

The prompt instructed the agent to fetch issues with a get_issue tool, but github-mcp-server (v1.6.0, the version pinned in the lock file) exposes this operation as issue_read. The agent searched for a tool that doesn't exist, failed to find it, and wasted a significant chunk of the run before giving up. All references are updated to issue_read.

2. Read the issue from the event payload first

For issues.opened runs, the issue title and body are already delivered in the workflow event context — no GitHub MCP call or network egress is needed to read them. The prompt now injects the sanitized title and body directly (steps.sanitized.outputs.title / .body) and tells the agent to use them as the source of truth and skip the MCP fetch entirely.

The issue_read MCP tool is kept strictly as a fallback for cases with no issue payload (e.g. workflow_dispatch, where the issue number comes from an input). The prompt also explicitly forbids shelling out to gh, curl, or node to read the issue.

This makes the common issues.opened path independent of MCP/network availability, which is relevant given the intermittent firewall/egress failures seen in CI.

Compilation

issue-triage-agent.lock.yml was recompiled with gh-aw v0.82.13 — the exact version this repo is currently pinned to — so the only changes are the ones driven by the prompt edit (the new steps.sanitized.outputs.* wiring). The github/gh-aw-actions/setup SHA pin and every other workflow are left untouched.

Out of scope (not fixed here)

Two failures observed in recent runs are environment/infrastructure issues, not workflow-file bugs, and are intentionally not addressed by this PR:

…load

The issue-triage-agent workflow was failing to read the triggering issue.
Two prompt-level problems are fixed here:

1. Tool name mismatch: the prompt told the agent to use `get_issue`, but
   github-mcp-server (v1.6.0) exposes this tool as `issue_read`. The agent
   searched for a non-existent tool and wasted time. All references are
   updated to `issue_read`.

2. Read the issue from the event payload first. For `issues.opened` runs the
   issue title and body are already delivered in the event context, so the
   agent no longer needs any GitHub MCP / network call to read them. The
   sanitized title and body are now injected directly into the prompt
   (`steps.sanitized.outputs.title` / `.body`). The `issue_read` MCP tool
   is used only as a fallback (e.g. `workflow_dispatch`, which carries no
   issue payload), and the prompt explicitly forbids falling back to `gh`,
   `curl`, or `node`.

Recompiled issue-triage-agent.lock.yml with gh-aw v0.82.13 (the version the
repo is pinned to) so the setup action SHA pin and all other workflows are
left unchanged.

Note: this does not address run-level infrastructure failures seen in CI
(a firewall block on MCP CLI network egress, tracked in github/gh-aw#46826 /
gh-aw-firewall#6473, and an authentication_failed 401 from a bad PAT in the
COPILOT_PAT pool). Those are environment issues outside this workflow file.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: ac9f9d5e-5b4e-4994-a60b-ed01b52cf97f
Copilot AI review requested due to automatic review settings July 22, 2026 16:18
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners July 22, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the issue-triage-agent workflow prompt/compilation so the agent reliably reads the triggering issue (preferably from the event payload) and uses the correct GitHub MCP tool name when a fallback fetch is required.

Changes:

  • Switch prompt guidance from the nonexistent get_issue tool to the issue_read MCP tool for fallback reads.
  • Prefer the workflow event payload for issues.opened by injecting sanitized issue title/body into the prompt and instructing the agent to skip MCP in that case.
  • Recompile the lock workflow to wire steps.sanitized.outputs.title/body into prompt interpolation.
Show a summary per file
File Description
.github/workflows/issue-triage-agent.md Updates the agent prompt to prefer event payload + correct MCP tool name (issue_read) for fallback.
.github/workflows/issue-triage-agent.lock.yml Recompiled workflow wiring new sanitized outputs into the prompt rendering steps.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

values below as the source of truth for the title and body:

Read the full issue title and body using the GitHub MCP Server tools:
- **Number:** #${{ github.event.issue.number }}
@DeagleGross
DeagleGross merged commit 901977f into dotnet:main Jul 22, 2026
12 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-issue-triage-agent-debug branch July 22, 2026 16:48
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 23, 2026
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.

3 participants