Skip to content

feat: teach pr-fixer mode to resolve review threads via GitHub GraphQL API#11306

Draft
roomote[bot] wants to merge 1 commit intomainfrom
feature/pr-fixer-resolve-review-threads
Draft

feat: teach pr-fixer mode to resolve review threads via GitHub GraphQL API#11306
roomote[bot] wants to merge 1 commit intomainfrom
feature/pr-fixer-resolve-review-threads

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 8, 2026

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:

  • 1_workflow.xml: Added a new resolve-threads phase between implementation and validation, plus a new completion criterion requiring thread resolution.
  • 2_best_practices.xml: Added a high-priority principle ("Resolve Review Threads, Don't Just Check Boxes") and updated the quality checklist.
  • 3_common_patterns.xml: Added 3 new patterns: fetch_review_threads, resolve_review_thread, and resolve_all_addressed_threads - all using gh api graphql with proper CDATA-wrapped queries.
  • 4_tool_usage.xml: Added tool-specific guidance for gh api graphql with the fetch and resolve queries, plus a new review_thread_operations command group in the CLI reference.
  • 5_examples.xml: Updated the first example to include steps 7-8 showing how to fetch and resolve threads after pushing fixes.

The approach uses GitHub's GraphQL resolveReviewThread mutation, 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:

  1. Having the pr-fixer agent process a PR with review comments
  2. Verifying the agent fetches review threads via GraphQL after pushing fixes
  3. Verifying the agent resolves addressed threads using the resolveReviewThread mutation
  4. Verifying the agent leaves unaddressed threads open

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - XML rule file changes only

Documentation Updates

  • No documentation updates are required.

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.

  • Behavior:
    • Adds resolve-threads phase in 1_workflow.xml to resolve GitHub review threads using GraphQL API after feedback is addressed.
    • Updates completion_criteria in 1_workflow.xml to include resolved review threads.
  • Best Practices:
    • Adds principle "Resolve Review Threads, Don't Just Check Boxes" in 2_best_practices.xml.
    • Updates quality_checklist in 2_best_practices.xml to ensure review threads are resolved.
  • Patterns:
    • Adds fetch_review_threads, resolve_review_thread, and resolve_all_addressed_threads patterns in 3_common_patterns.xml.
  • Tool Usage:
    • Adds guidance for gh api graphql in 4_tool_usage.xml for resolving review threads.
  • Examples:
    • Updates example in 5_examples.xml to include steps for resolving review threads.

This description was created by Ellipsis for bf34fa4. You can customize this summary. It will automatically update as commits are pushed.

…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
@roomote
Copy link
Contributor Author

roomote bot commented Feb 8, 2026

Rooviewer Clock   See task

Reviewed the additions to all 5 pr-fixer rule files. One minor consistency issue found:

  • 4_tool_usage.xml: review_thread_operations command group uses inline GraphQL values instead of the parameterized -f/-F variable approach used everywhere else in the PR

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines +200 to +203
<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>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Suggested change
<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.

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.

1 participant