Repository navigation
fix(skills): recheck open PRs immediately before gh pr create - #280
Merged
Merged
Conversation
Two tend-mention runs on PRQL/prql fired concurrently (issue #5802 and PR #5801) and each opened a near-duplicate PR for the same Zig 0.16 build.zig migration — PRQL/prql#5803 and PRQL/prql#5804, created 48s apart. Both runs ran `gh pr list` at session start (before either PR existed) and neither re-checked before `gh pr create` ~7 minutes later, so each thought the other's PR didn't exist. tend-mention's concurrency group is keyed by issue/PR number, so mentions on different threads are not serialized. Add a dedup recheck step in the PR Creation section analogous to the existing dedup check for inline review comment replies — re-run `gh pr list` immediately before `gh pr create`, and compare by title keywords and modified file paths (not just branch name, which two concurrent runs will pick differently). Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
Add a dedup recheck step in
running-in-cifor PR creation, analogous to the existing dedup check for inline review comment replies. Re-rungh pr listimmediately beforegh pr createso a concurrent sibling run doesn't slip a duplicate PR past the initial session-start check.Evidence
Observed on
PRQL/prqlin runs 24464554439 and 24464634498.Timeline:
max-sixtycommented "do the follow-up please" on issue PRQL/prql#5802 (Zig 0.16 follow-up)tend-mentionrun A started on issue #5802vanillajonathancommented on PR PRQL/prql#5801 asking the bot to create a Zig 0.16 PRtend-mentionrun B started on PR #5801 (different concurrency group — runs in parallel with A)gh pr listonce, early in its session; no Zig fix PR exists yetgh pr create→ PRQL/prql#5803gh pr create→ PRQL/prql#5804, 48s after #5803 appeared; no recheckBoth PRs modify the same two files (
.github/workflows/test-prqlc-c.yamlto drop theversion: 0.15.2pin, andprqlc/bindings/prqlc-c/examples/minimal-zig/build.zigto move calls ontoroot_module) with the same intent — near-duplicates differing only in refactoring style. Maintainers must now triage and close one.Root cause
tend-mention'shandlejob concurrency group is keyed byissue.number || pull_request.number, so mentions on different threads (issue #5802 vs PR #5801) run concurrently. The currentPR Creationguidance says to checkgh pr listbefore creating, but in practice runs do this once at session start. Minutes pass between the check andgh pr create, during which a sibling run can open a scope-overlapping PR — invisible to the stale check.Gate assessment
Dedup check for inline review comment repliespattern merged in #141. Passes Gate 2.Test plan
pre-commit run --all-files)gh pr list --state open --author $BOT_LOGIN --json number,title,headRefName,createdAtreturns what a bot can actually use to decide (it does: standard gh flags)