## TL;DR

The agent's thread-resolution call fails  -  usually a wrong thread ID (review ID vs thread ID) or a missing permission. Pass the thread's GraphQL node ID to the resolve mutation and ensure the token can resolve threads.

## Error

```text
GraphQL: Could not resolve to a PullRequestReviewThread with the id "PRR_xxx"  -  expected a thread id, got a review id.
```

## Steps

1. Read the error: it usually says the ID is the wrong type (review ID instead of thread ID). Expected: you know which ID is wrong.
2. Fetch the real thread IDs: query the PR's review threads and use each thread's node `id`. Expected: IDs of the PullRequestReviewThread type.
3. Call the resolve mutation with the thread ID (and `resolved: true`). Expected: the thread resolves.
4. If it 403s, grant the token write access to pull requests. Expected: resolution succeeds.

## When to use

- The agent resolves threads via GraphQL and the mutation errors.
- The error mentions ID type mismatches or permissions.

## When not to use

- The agent uses REST  -  the endpoint and ID shapes differ.
- Threads resolve fine but the merge still blocks; something else is unresolved.

## Tool compatibility

- GitHub GraphQL API.
- Any agent resolving threads programmatically.

## Variant phrasings

### Resolving threads on outdated diffs

Threads on old SHAs still resolve by thread ID  -  no need to map positions.

### Bulk-resolving many threads

Loop the mutation per thread; there is no batch resolve.

## Why it happens

Review threads, reviews, and comments are distinct GraphQL node types with incompatible IDs. Passing a review's ID where a thread's ID belongs is the most common failure, and the error message says so explicitly.

## Edge cases

- Only unresolved threads need the mutation; resolving an already-resolved thread is a no-op, not an error.
- Resolving someone else's thread as a bot is visible  -  prefer asking the thread author when the feedback is theirs.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_GklWR94WyPqXLIWe1It1qg
