Repository navigation
feat: add conflict resolution for bot PRs to nightly cleaner - #1307
Conversation
Adds a Step 0 to the nightly cleaner prompt that checks for open worktrunk-bot PRs with merge conflicts and resolves them using Claude subagents before proceeding to the code review sweep. Each conflicted PR gets a dedicated subagent that checks out the branch, merges main, resolves conflicts, pushes, and monitors CI. PRs are processed in parallel via the Task tool. Requested in #1253. Co-Authored-By: Claude Opus 4.6 <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two issues with the parallel subagent design:
Parallel checkout conflict (should fix): The instructions tell subagents to run gh pr checkout <number> in parallel, but all subagents share the same git working directory. When two subagents check out different PR branches simultaneously, they'll clobber each other's state. Each subagent needs an isolated working directory — e.g., clone to a temp dir or use git worktree add per PR branch.
/tmp/comment.md never created (minor): Step 5 references gh pr comment <number> -F /tmp/comment.md, but nothing in the instructions creates that file. If the intent is for the subagent to write the comment content first, this should be explicit. Additionally, parallel subagents would collide on the same /tmp/comment.md path — use a unique path per PR or just use --body inline.
- Instruct subagents to use isolated directories (worktree/clone) to avoid checkout conflicts when resolving multiple PRs in parallel - Replace `-F /tmp/comment.md` (never created, collides across agents) with `--body "..."` inline Co-Authored-By: Claude <[email protected]>
Summary
worktrunk-botPRs with merge conflictsRequested by @max-sixty in #1253.
Test plan
workflow_dispatchwhen a bot PR has conflicts to verify end-to-end🤖 Generated with Claude Code