feat(issue-desk): reuse existing PR for an issue instead of opening duplicates#2122
Merged
Conversation
…licates In the issue-desk app, before branching the implementer now discovers open PRs already resolving the issue (GitHub closing-reference link + title/body fallback). If one exists it pushes onto that PR's branch; if several do it keeps the furthest-along as canonical and closes the redundant duplicates. The reviewer resolves the same canonical PR by issue link and checks out its head branch, so it always reviews the branch the implementer pushed to.
4200d10 to
06d3ca8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The same issue can spawn several duplicate PRs (e.g. #2095 → #2099 / #2118 / #2120). Root cause: the implementer only checks whether the
tale/<task._id>branch has a PR, never whether the issue is already being fixed by some other PR — so every desk run opens a fresh competing PR.Changes (config/instructions only, no code)
builtin-configs/apps/issue-desk/:implementstep — dedupe before branching:closedByPullRequestsReferences) + title/body fallback (#num) +tale/*branches.$BRANCH: our branch already has a PR → normal rework; exactly one other PR → adopt it and push onto its branch (no new PR); several → keep the furthest-along as canonical andgh pr closethe redundant duplicates (with a "Superseded by #N" comment; conservative guardrails: never delete a human's branch, keep + flag any PR carrying unique work).ghcalls use$BRANCH; new PRs includeCloses #numso later runs can resolve them by link.reviewstep:tale/<task._id>checkout). The PR'sheadRefNameis the branch the implementer pushed to, so the reviewer always reviews the implementer's work.Bumped
1.2.0 → 1.3.0; updated the workflow / app / implementer-agent descriptions.Known limitations