Repository navigation
π fix(github): the overlap duplicate guard defers only to hive agents' PRs and tells the blocked issue - #17001
Conversation
The create-PR overlapping-files check kept any open PR whose author ended in [bot]. On projectbluefin/server a one-line Renovate digest bump by mergeraptor[bot] (Justfile only) was contained in an architect refactor's file set, so the refactor was refused and pointed at the bump (server#637, Refs server#638). The check now counts only PRs authored by hiveBotLogins(): the App bot plus github.additional_bot_logins. A client with no hive bot login skips it. On an overlapping-files refusal the watcher no longer stages the request's issues under the blocking PR, which shares files with them, not issues. It leaves a gated note on each issue naming the agent, branch and blocking PR (a status-card section under the attention pilot, never stacked on a retry), and logs the refusal at WARN. Refs hivecommons#11577 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@Danathar this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (4 waiting): fixes are handed out before new work as soon as you have capacity. |
|
π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Read against the v6 tree and the watcher that consumes the result. Looks correct to me.
What I verified
pr_duplicate_guard.go:167β the filter is nowisHiveBotLogin(c.hiveBotLogins(), login);client.go:658-673shows that is the App bot login plusadditionalBotLogins, compared case-insensitively. Dependency bots (renovate[bot],dependabot[bot],mergeraptor[bot]) fall out of the candidate set exactly as the body says, and the "closes-issue" and "merged-fix" paths are untouched β only the file-overlap heuristic narrows.pr_request_watcher.go:712-726β the split is onDuplicateReasonOverlappingFilesonly. That is the right line: acloses-issueduplicate genuinely covers the request's issues, so staging them under it at 040 remains correct; an overlap-only PR does not, andclearInProgressForPR/addressInProgressForPRare skipped for it. Nothing else inhandleOnePRRequestkeyed off those two calls.noteDuplicateGuardOnIssuesgoes throughWritebackItemForNumberβWritebackAllowedβPostIssueNotewith a marker+head idempotence check, so a retried request does not stack notes; the site is registered innotification_write_sites.goandnotifications.md. ReusingKindDuplicateFixNoticefor the issue-side note is documented inwriteback/kinds.go.go build ./pkg/github/ ./pkg/writeback/passes on the head; the three new tests cover the filter, the watcher's issue note, and the note text.
One behavioural edge, not a defect: a client with no App bot login configured (PAT auth) now skips the overlap check entirely rather than matching any [bot]. The doc comment at :159-163 says so explicitly, and on PAT auth the hive's own PRs would not be [bot]-authored anyway, so the old check was not protecting anything there either.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
β¦p-bots Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
The hive's GitHub App lacks |
|
Needs a decision, not a merge: Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
β¦ CI incident is withdrawn (#17007) The 072 nudge goes out the moment a contributor PR goes red ("the hive will not merge it until the head changes"). The scanner's [shared-ci] incident marker can land minutes later. The stage pass then moved the PR to 050, but the nudge stayed as posted and the head's nudge count stayed at 1. Seen on hivecommons/hive #16993, #16995, #17000 and #17001: nudged for native-queue-policy about ten minutes before they were deferred to incident #17003. - When the pass reads a nudged head's red as shared-ci-incident:<n> or base-branch-red:<checks>, edit the hive's own nudge comments for that head in place to say it was withdrawn, and forget the nudge (Store.WithdrawNudge), so a genuine return to 072 is nudged afresh. - After an incident closes as completed, keep a PR deferred to it until the rerun sweep stamps hive-shared-ci-rerun-<n> (at most 30 minutes), so the head is not handed back in the gap before the re-run. - Name the head's red checks in the nudge when the CI gate's reason is a bare token such as check-failure (a base with no required checks). Refs #17003, #12606, #12253 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Conclusion: looks correct to me. Verified against the tree, not the body.
pkg/github/client.go:609-624(main) βhiveBotLoginsreturns the App login plusadditionalBotLogins, empty for PAT auth;isHiveBotLoginisEqualFold. So the new filter infindOverlappingBotPRdoes exactly what the seven table cases assert, including the case-insensitive and "no login known β guard never fires" rows. Under PAT auth the oldHasSuffix("[bot]")filter could only ever match third-party bots (PAT-authored agent PRs have no[bot]suffix), so the narrowing removes false positives without losing any true positive.pr_request_watcher.go:712-726β the overlap branch now skipsclearInProgressForPR/addressInProgressForPR. That is right: the blocking PR shares files, not issues, so staging the issue under it was the bug on projectbluefin/server#638. The issue's in-progress claim is left to its TTL, which is the correct fallback given no PR exists. Thecloses-issuerefusal still takes the old path (the test's second subtest pins this).noteDuplicateGuardOnIssuesβ consultsWritebackAllowedbeforePostIssueNote, dedups onduplicateGuardMarker+`head`so a retried request does not stack comments, and skipsn == blocking.prstatus.KeyDuplicateGuard(prstatus.go:150) and the marker (pr_duplicate_guard.go:33) already exist, and the write site is registered innotification_write_sites.goanddocs/notifications.md.
One pre-existing thing, not introduced here: the refusal path still records AuditActionAgentPRCreated (pr_request_watcher.go just below the hunk) even though no PR was created β it did that for the redirect case before this PR too. Worth a separate look if the audit trail is used to count opened PRs.
No security or scope concerns. I have not approved or changed anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
The create-PR duplicate guard treated any
[bot]PR as "another agent's PR". On projectbluefin/server a one-line Renovate digest bump (authored by the custom-namedmergeraptor[bot]App, editing onlyJustfile) was contained in an architect refactor's file set, so the hive refused to open the refactor and pointed it at the bump. The overlapping-files check now counts only PRs this hive's agents opened (its App bot plusgithub.additional_bot_logins). When the guard does refuse a request on overlapping files, the issue the work was for now hears about it, instead of only the blocking PR.What went wrong
fedora:44digest bump bymergeraptor[bot]; it changes onlyJustfile.arch/refactor-sysext-export(Refs [architect] Add-on export commands are copy-pasted per add-on and have drifted (Kubernetes export wipes the others)Β projectbluefin/server#638), which changesJustfileand two test files. Since{Justfile}is contained in that set, the guard matched at 06:46Z on 2026-11-07 and wrote "Another agent tried to open a PR fromarch/refactor-sysext-exportβ¦" into fix: restore dashboard overrides and fix agent shellΒ #637's hive status. No PR was opened.hive-open-prcall returned before the watcher ran, so it never learned either.stage/040-covered-by-prunder fix: restore dashboard overrides and fix agent shellΒ #637 (06:47:03Z). fix: restore dashboard overrides and fix agent shellΒ #637 does not reference fix: create home directories for per-agent usersΒ #638, so the reconciler took it back off at 06:55:53Z.The guard came from #11577, which asked to "list open PRs by the App bot". The
[bot]suffix check was wider than that.What changes
findOverlappingBotPRkeeps a candidate only when its author is one ofhiveBotLogins()(case-insensitive), not any login ending in[bot]. A client with no hive bot login (PAT auth, nothing configured) skips this check. Before, such a client only ever matched third-party bots here anyway. The closes-issue and merged-fix checks are unchanged.mergeraptor[bot], notrenovate[bot]. Hunk overlap would still collide whenever a refactor touches the bumped line.duplicate_fix_notice), becomes a status-card section under the attention pilot, and is never stacked on a retry. A WARN log line records the agent, head, blocking PR and issues.Files
src/pkg/github/pr_duplicate_guard.go: author filter;noteDuplicateGuardOnIssuesand its note text.src/pkg/github/pr_request_watcher.go: overlapping-files refusals note the issue instead of staging it.src/pkg/github/notification_write_sites.go,src/docs/notifications.md: inventory row for the new write site.src/pkg/writeback/kinds.go:duplicate_fix_noticedoc covers the new note.changelog.d/fixed-overlap-guard-hive-agent-prs.mdTests
TestCreatePR_DuplicateGuardOnlyCountsHiveAgentPRs: the fix: restore dashboard overrides and fix agent shellΒ #637 shape withmergeraptor[bot],renovate[bot]anddependabot[bot]opens the PR. The hive's own App, a case variant of it, and a configured additional bot still refuse it. No known hive login opens it.TestPRRequestWatcher_OverlapRefusalNotesTheBlockedIssue: an overlap refusal posts one note on the issue and one redirect on the PR, and stages nothing. A retry stacks nothing. A closes-issue refusal still stages the issue under the closing PR.TestDuplicateGuardIssueNote: note text.hive[bot]candidates stand for.go test ./pkg/github/ ./pkg/writeback/andgo vetpass, and so do the docs citation and link checks.Out of scope: the dupsweep "superseded regeneration series" comment on #637, and how the guard behaves when it cannot list PRs.
Refs #11577
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1