feat: teach pr-fixer mode to resolve review threads via GitHub GraphQL API#11306
feat: teach pr-fixer mode to resolve review threads via GitHub GraphQL API#11306roomote[bot] wants to merge 1 commit intomainfrom
Conversation
…L API Updated the pr-fixer mode rules to resolve review threads on GitHub after addressing review feedback, instead of only checking off internal checkboxes. This uses the GitHub GraphQL API resolveReviewThread mutation to mark threads as resolved, providing clear signal to reviewers that their feedback was acted on. Changes across all 5 rule files: - 1_workflow.xml: Added resolve-threads phase and completion criterion - 2_best_practices.xml: Added principle and quality checklist item - 3_common_patterns.xml: Added 3 new patterns for fetching/resolving threads - 4_tool_usage.xml: Added gh api graphql tool guidance and CLI reference - 5_examples.xml: Added thread resolution steps to example workflow
Reviewed the additions to all 5 pr-fixer rule files. One minor consistency issue found:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| <command_group name="review_thread_operations"> | ||
| <command>gh api graphql -f query='query { repository(owner:"[owner]", name:"[repo]") { pullRequest(number:[PR_NUMBER]) { reviewThreads(first:100) { nodes { id isResolved isOutdated comments(first:1) { nodes { body path line } } } } } } }'</command> | ||
| <command>gh api graphql -f query='mutation { resolveReviewThread(input:{threadId:"[THREAD_NODE_ID]"}) { thread { id isResolved } } }'</command> | ||
| </command_group> |
There was a problem hiding this comment.
The review_thread_operations command group uses inline/hardcoded values in the GraphQL query string (e.g., owner:"[owner]"), while every other GraphQL example in this PR -- including the fetch_threads_query and resolve_thread_mutation elements in this same file -- uses parameterized GraphQL variables with -f/-F flags. The parameterized approach handles type coercion properly (-F for Int), avoids shell quoting pitfalls, and is the gh CLI's recommended pattern. Having both styles in the same file could lead the agent to copy the less robust inline approach from this quick-reference section.
| <command_group name="review_thread_operations"> | |
| <command>gh api graphql -f query='query { repository(owner:"[owner]", name:"[repo]") { pullRequest(number:[PR_NUMBER]) { reviewThreads(first:100) { nodes { id isResolved isOutdated comments(first:1) { nodes { body path line } } } } } } }'</command> | |
| <command>gh api graphql -f query='mutation { resolveReviewThread(input:{threadId:"[THREAD_NODE_ID]"}) { thread { id isResolved } } }'</command> | |
| </command_group> | |
| <command_group name="review_thread_operations"> | |
| <command>gh api graphql -f query='query($owner: String!, $repo: String!, $number: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $number) { reviewThreads(first:100) { nodes { id isResolved isOutdated comments(first:1) { nodes { body path line } } } } } } }' -f owner=[OWNER] -f repo=[REPO] -F number=[PR_NUMBER]</command> | |
| <command>gh api graphql -f query='mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { id isResolved } } }' -f threadId=[THREAD_NODE_ID]</command> | |
| </command_group> |
Fix it with Roo Code or mention @roomote and request a fix.
Related GitHub Issue
N/A - Internal improvement requested via Slack
Roo Code Task Context (Optional)
View task on Roo Code Cloud
Description
Previously, the pr-fixer mode (used by the Roomote agent) would address review feedback by making code changes and pushing them, but it never resolved the actual review threads on GitHub. This meant reviewers had to manually check whether their feedback was addressed by re-reading the code, since the threads stayed open.
This PR updates all 5 pr-fixer rule files to teach the agent to resolve review threads on GitHub using the GraphQL API after addressing feedback:
resolve-threadsphase betweenimplementationandvalidation, plus a new completion criterion requiring thread resolution.fetch_review_threads,resolve_review_thread, andresolve_all_addressed_threads- all usinggh api graphqlwith proper CDATA-wrapped queries.gh api graphqlwith the fetch and resolve queries, plus a newreview_thread_operationscommand group in the CLI reference.The approach uses GitHub's GraphQL
resolveReviewThreadmutation, which is the only API that supports thread resolution (the REST API does not expose this).Test Procedure
These are LLM instruction files (XML rule files for the pr-fixer mode), not executable code. Testing involves:
resolveReviewThreadmutationPre-Submission Checklist
Screenshots / Videos
N/A - XML rule file changes only
Documentation Updates
Additional Notes
The pre-existing XML files have some minor validation issues (unescaped
<in template placeholders and&&in git commands) that predate this PR. My additions use proper CDATA sections to avoid introducing new issues.Get in Touch
N/A - Roomote agent
Important
This PR enhances pr-fixer mode to resolve GitHub review threads using the GraphQL API after addressing feedback, updating XML rule files to guide this process.
resolve-threadsphase in1_workflow.xmlto resolve GitHub review threads using GraphQL API after feedback is addressed.completion_criteriain1_workflow.xmlto include resolved review threads.2_best_practices.xml.quality_checklistin2_best_practices.xmlto ensure review threads are resolved.fetch_review_threads,resolve_review_thread, andresolve_all_addressed_threadspatterns in3_common_patterns.xml.gh api graphqlin4_tool_usage.xmlfor resolving review threads.5_examples.xmlto include steps for resolving review threads.This description was created by
for bf34fa4. You can customize this summary. It will automatically update as commits are pushed.