Issues and pull requests / Pull requests
Answer and resolve review comments
A review left comments on the lines of your pull request. Someone sent you a link to one of them, or you want to answer each one and mark it as done. Each line comment starts a thread. You can open a thread from its link, reply in it and resolve it, on the web or in a terminal.
3 min read
To resolve a thread, you must be its author or have triage access.
1. Open the comment from its link
A comment link looks like this:
https://source.tanstack.com/@acme/app/pull/7#comment-31
- Open the link.
- The page opens the Conversation tab and scrolls to the comment.
If the comment is in an older round that is folded, the page opens that round first.
To get the link of a comment yourself, see Send a link to one comment.
2. Answer and resolve on the web
- Under the thread, click Write a reply.
- Write your answer, then click Reply.
- When the work is done, click Resolve thread.
The thread folds and shows Resolved. To open it again, click Reopen thread.
If the comment has a Suggested change, you can commit it with one click. See Suggest changes.
3. Answer and resolve in a terminal
List the threads of the pull request:
src pr-comment list 7The URL column has the link of each thread. For only the links, run
src pr-comment list 7 --json url.Reply in a thread. Give the link of any comment in the thread, also a reply:
src pr-comment reply "https://source.tanstack.com/@acme/app/pull/7#comment-31" --body "Fixed in the next commit."Resolve the thread with the same link:
src pr-comment resolve "https://source.tanstack.com/@acme/app/pull/7#comment-31"
Put the link in quotes, so that your shell does not change it. You can also give the pull request and the comment id: src pr-comment resolve 7 31. To open a thread again, add --unresolve.
4. Resolve all threads at once
When you fixed every comment, resolve all open threads of the pull request:
src pr-comment resolve 7 --all
srcprints how many threads it resolved.- If a thread fails,
srcprints the thread and the reason, and goes on with the other threads. At the end, it stops with exit code 1. - If no thread is open,
srctells you and stops with exit code 0.
To open all resolved threads again, run src pr-comment resolve 7 --all --unresolve.
Done
- A comment link opens the Conversation tab at that comment.
- Your replies show in the threads.
- Each thread that you resolved is folded and shows Resolved.
Later: REST and MCP
An agent or a script does the same work over REST or MCP. The REST paths are under /api/v1/repos/{owner}/{repo}.
| You want to | REST | MCP tool |
|---|---|---|
List the threads, each with its link in htmlUrl | GET /pulls/{n}/comments | list_pull_request_comments |
| Reply in a thread | POST /pulls/{n}/comments, with { "replyTo", "body" } | comment_on_pull_request_line |
| Resolve a thread | PUT /pulls/{n}/threads/{id}, with { "resolved": true } | resolve_review_thread |
replyTo and {id} are the id of the thread: the id of its first comment. To open a thread again, send { "resolved": false }.