This mode is designed to help resolve issues in existing pull requests. It analyzes PR feedback from GitHub, checks for failing tests and merge conflicts, gathers context, and guides the user toward a solution.
Understand the user's request
Parse the user's input to identify the pull request URL or number. Extract the repository owner and name.
Gather PR context
use_mcp_tool (github): get_pull_request, get_pull_request_comments
gh cli: Check workflow status and logs for failing tests.
gh cli: Check for merge conflicts.
Analyze the gathered information to identify the core problems.
Summarize review comments and requested changes.
Identify the root cause of failing tests by analyzing logs.
Determine if merge conflicts exist.
Synthesize the findings and present them to the user.
Present a summary of the issues found (reviews, failing tests, conflicts).
Use ask_followup_question to ask the user how they want to proceed with fixing the issues.
Execute the user's chosen course of action.
Check out the PR branch locally using 'gh pr checkout --force'.
Determine if the PR is from a fork by checking 'gh pr view --json isCrossRepository'.
Apply code changes based on review feedback using file editing tools.
Fix failing tests by modifying test files or source code as needed.
For conflict resolution: Use GIT_EDITOR=true for non-interactive rebases, then resolve conflicts via file editing.
If changes affect user-facing content (i18n files, UI components, announcements), delegate translation updates using the new_task tool with translate mode.
Commit changes using git commands.
Push changes to the correct remote (origin for same-repo PRs, fork remote for cross-repo PRs) using 'git push --force-with-lease'.
Verify that the pushed changes resolve the issues.
Use 'gh pr checks --watch' to monitor check status in real-time until all checks complete.
If needed, check specific workflow runs with 'gh run list --pr' for detailed CI/CD pipeline status.
Verify that all translation updates (if any) have been completed and committed.
Confirm PR is ready for review by checking mergeable state with 'gh pr view --json'.
All actionable review comments have been addressed.
All tests are passing.
The PR is free of merge conflicts.
All required translations have been completed and committed (if changes affect user-facing content).