Skip to content

🐛 Scanner pushes commits onto PR branches another agent is actively working on #18488

Closed

Description

@clubanderson

Problem

The scanner agent pushes its own commits onto PR branches that another agent (or the PR author's session) is actively working on. The commits are authored/committed as scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>, not as the PR author.

Effects seen on 2026-11-16 (at least twice, e.g. #18419):

  • Sign-off check goes red. "Sign-off survives the squash" rejects the non-merge bot commit, because the squash would carry a sign-off that does not match the PR author. The PR is blocked until someone removes or redoes the commit.
  • Push races. The working agent's next push is rejected (non-fast-forward) or it has to rebase over commits it did not expect, sometimes mid-rebase.
  • Duplicate work. The working agent then re-makes the same fix as its own signed commit, so the scanner's fix was wasted.

The scanner already declines to push to human-authored branches ("This is a human-authored branch so I am not pushing"). It does push to branches authored by the owner account, which the fleet treats as agent-authored, even when a session is live on that branch.

Proposed fix

  1. Do not push to a PR branch that has an active worker. Treat a branch as in use if any of these hold: a hive agent holds a claim/lease on the PR or its issue; the last push to the head ref is under N minutes old (named constant, env-overridable, e.g. 60 min); or the PR carries an in-progress label/claim comment.
  2. Comment instead of push. When the scanner has a fix for an in-use branch, post it as a suggestion comment (diff or steps) and let the working agent apply it as its own signed commit.
  3. If it does push (idle branch), commit with a sign-off that the DCO and "Sign-off survives the squash" checks accept for that PR, or open a follow-up PR against the branch instead of committing to it directly.
  4. Add a test asserting the scanner skips pushing when a lease/recent-push condition holds.

Related

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 16, 2026
  2. hivecommons-hive commented on Nov 16, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @Karibhou released (lease revoked).

    Claim history
    • 2026-11-16 20:39 UTC — claimed by Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-16 20:53 UTC — released by Karibhou (contributor; lease revoked)
  3. github-actions commented on Nov 16, 2026

    @github-actions
    Contributor

    @clubanderson this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

  4. added a commit that references this issue on Nov 16, 2026
    85d53f9
  5. clubanderson commented on Nov 16, 2026

    @clubanderson
    MemberAuthor

    Fixed by #18502 (merged as 85d53f9). The repair queues the scanner pushes from (FIX-BEFORE-NEW, CI_FAILING, PR_LIST) now list a red or conflicted PR that the hive App did not open as "suggest, do not push" while its branch is busy. A branch is busy when another worker holds a live claim on the PR or a linked issue, or when its head was pushed within HIVE_SCANNER_BUSY_BRANCH_MINUTES (default 60). The agent posts the fix as one suggestion comment instead of pushing. Idle branches, App-authored lane branches and in-place adoptions are listed as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions