Resolve Command Design
Goal
Add a maintainer-triggered @qwen-code /resolve command for pull requests that are blocked by merge conflicts with the default branch.
Scope
The first version is intentionally conservative:
- The command only runs in
QwenLM/qwen-code. - The requester must have
write,maintain, oradminpermission. - The target must be an open pull request.
- The pull request branch must live in the base repository.
- Fork pull requests are reported as unsupported instead of being pushed.
- The agent receives no GitHub token. It can only edit and commit locally.
- A separate publish step injects
CI_DEV_BOT_PATto push and comment.
Workflow
- The existing PR command workflow handles
issue_commentorworkflow_dispatchand resolves the target pull request. - An authorization job checks the requester’s collaborator permission with
CI_BOT_PAT. - The resolve job acknowledges comment triggers with an
eyesreaction. - The job reads pull request metadata and rejects closed, draft, non-conflicting, or fork pull requests.
- For eligible pull requests, the job checks out the pull request branch with persisted credentials disabled, fetches the base branch, and verifies the branch still points at the expected head SHA.
- Qwen Code runs without GitHub credentials, merges
origin/<base>, resolves conflicts, verifies the result, commits, and writes a summary artifact. - A deterministic verification step fails on unresolved conflicts, missing summary, or failed checks.
- The publish step pushes with
--force-with-leaseagainst the original head SHA and comments with the conflict-resolution summary.
Out of Scope
- Automatically pushing to fork pull requests.
- Replacement pull request creation for external contributors.
- Scheduled scanning of stale conflicted pull requests.
- Resolving non-mergeability states other than direct merge conflicts.
Last updated on