Skip to content

pr-comment-review skill: GitHub thread resolution gap #134

@diberry

Description

@diberry

Problem

The pr-comment-review skill correctly resolves Azure DevOps PR threads using AzureDevOps-repo_update_pull_request_thread (sets status to WontFix), but has no equivalent for GitHub PRs. When an agent fixes code to address Copilot review comments on GitHub:

  • The threads become outdated (code changed underneath) ✅
  • But they remain unresolved
  • GitHub UI shows them as "updated" instead of resolved
  • Reviewers see stale unresolved threads, creating confusion

This was discovered on bradygaster/squad PR #823 where all 3 Copilot review comments were addressed in code but threads stayed open until manually resolved via GraphQL.

Root Cause

The GitHub MCP server (github-mcp-server) has no tool for resolving review threads. GitHub's API requires a GraphQL mutation:

mutation {
  resolveReviewThread(input: { threadId: "PRRT_..." }) {
    thread { isResolved }
  }
}

The skill's Step 1a fetches threads via get_review_comments which returns html_url but not the GraphQL node ID needed for the mutation.

Required Fix (two parts)

Part 1: Fetch thread node IDs

Before resolving, the skill needs to query GraphQL to get thread node IDs:

query {
  repository(owner: "OWNER", name: "REPO") {
    pullRequest(number: N) {
      reviewThreads(first: 50) {
        nodes {
          id
          isResolved
          isOutdated
          comments(first: 1) {
            nodes { body, url }
          }
        }
      }
    }
  }
}

Match threads by comment URL or body content to correlate with the REST API results from get_review_comments.

Part 2: Resolve threads after fixes

In Step 5 (Action Phase), when platform is GitHub and user approves resolution:

gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_NODE_ID"}) { thread { isResolved } } }'

This uses the powershell tool to call gh api graphql since no MCP tool exists.

Comparison: ADO vs GitHub

Capability Azure DevOps GitHub
Fetch threads AzureDevOps-repo_list_pull_request_threads get_review_comments
Reply to thread AzureDevOps-repo_reply_to_comment No MCP tool (use gh api)
Resolve thread AzureDevOps-repo_update_pull_request_thread to WontFix MISSING - needs GraphQL mutation
Thread node ID Included in API response Requires separate GraphQL query

Workaround (current)

Manually resolve threads from the coordinator after agent work:

$threads = @("PRRT_...", "PRRT_...", "PRRT_...")
foreach ($t in $threads) {
    gh api graphql -f query="mutation { resolveReviewThread(input: {threadId: `"$t`"}) { thread { isResolved } } }"
}

Proposed Skill Changes

Add to pr-comment-review/SKILL.md:

  1. Step 1a addition: After fetching GitHub threads via REST, also run the GraphQL query to get node IDs. Store a mapping of comment URL to thread node ID.

  2. Step 5 addition: For GitHub PRs, after posting reply (if any), resolve the thread using gh api graphql with the resolveReviewThread mutation.

  3. Platform detection: The skill already distinguishes ADO vs GitHub. Add the GitHub resolution path alongside the existing ADO update_pull_request_thread path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions