Repository navigation
π fix: escalate stalled claims instead of re-claiming after 2 no-progress claims - #10736
Conversation
β¦ent claims The claim ledger now remembers each agent's claims per issue (with how each ended), and a scheduler in-flight gate withholds a free issue whose last escalate_after_claims claims by one agent were followed by no linked or referencing PR, referencing commit, label/assignee change or close/reopen. The issue is labelled needs-human and gets one comment listing the claims (ADR-0019). Timeline read failures fail open. NOT FOR MERGE AS-IS: agent kick claims are recorded for every issue in a kick's list (up to governor.kick_limits.max_issues, default 100), so with the default threshold of 2 this would label the whole untouched backlog needs-human about four hours after deploy. See the issue comment. Hive-Run: #10527 Hive-Plan: #10527 (Proposed fix) Hive-Spec: #10527#acceptance Signed-off-by: Danathar <Danathar@users.noreply.github.com>
β¦ly on start signal Kick-listed issues get a short in-ledger listing (no GitHub comment, not a claim attempt) that keeps relay contributors and other agents off them while the kick is live. The agent claim, with its comment, is recorded on the agent's first start signal on the issue: its own comment, label or claim request through the issue relay, or a PR request naming it. The escalation gate therefore counts real claims only. A likely-done issue an agent already verified after the merged PR is withheld from kicks until a person comments, labels, assigns, closes or reopens it (verify once, #10509). Refs #10527 Signed-off-by: scanner <scanner@hive.kubestellar.io> Co-authored-by: Copilot <223556219+Copilot@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 |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner 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
|
β¦truct addition Signed-off-by: scanner <scanner@hive.kubestellar.io>
Resolves line-citation conflict in src/docs/scale-envelope.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <scanner@hive.kubestellar.io>
|
hive/awaiting-ci: merged origin/v5 to resolve the scale-envelope.md citation conflict; CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Read the full diff against v5 (e881de45) plus the callers in issue_request_watcher.go, pr_request_watcher.go, issue_unpark_command.go and main.go. The escalation gate, the start-signal hook and verify-once all read correctly to me; CI is green. One design question needs a maintainer before this lands, and it is a judgment call, not a bug.
Open question β a 30-minute fixed hold replaces a 2-hour claim, and a second listing silently drops the first agent's claim.
src/pkg/claims/claims.go:191βDefaultListedTTL = 30 * time.Minuteis a constant;MarkListed(claims.go:775) setsExpiresAt: now.Add(DefaultListedTTL). Before this PR the kick took an agent claim, so other agents/contributors backed off foragent_ttl_s(default 2h peroperator-reference.md:77). Now they back off for 30 min unless the agent has already produced a start signal.MarkListed(claims.go:782) accepts a new listing whenprev.Expired(now), overwriting agent A's listing with agent B's once 30 min have passed.ClaimOnStart(claims.go:826-827) then requiresli.Holder == agent. So if A's first comment /hive-open-prarrives after B was listed, A's signal matches nothing and returnsok=falseβ A's claim is never recorded (no π, noAttempt), while B is also working the same issue. That is the #8380 double-dispatch the ledger exists to prevent, and A's run becomes invisible to the escalation gate.
This only bites when a kick runs more than 30 min before the agent's first relay write on the issue, which is common for investigate-then-PR work. The window is also not operator-tunable the way agent_ttl_s was.
For @clubanderson / @Danathar to decide: is a 30-minute, non-configurable listing hold the intended trade (fewer spurious π comments vs. a shorter back-off and a dropped claim on overlap), or should the hold track agent_ttl_s (or at least be a claims.listed_ttl_s knob)? If 30 min is intended, I'd suggest ClaimOnStart log when a listed-then-overwritten agent's signal is dropped, so the overlap is at least visible.
Verified non-findings, for the record: the escalation comment's "replying /hive approve counts as progress" is true β clearIssueParkingLabels (issue_unpark_command.go:276) removes needs-human, and claimProgress (claimescalation.go) counts that unlabeled event. The start hook fires only after the issue request succeeded (issue_request_watcher.go:577) and after PR-request authorization (pr_request_watcher.go:417), with req.Agent UID-verified, so an agent cannot claim as another.
Scope note: verify-once (#10509) is bundled here but only #10527 is closed; worth stating in the body whether #10509 should close with this or stay open.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Closes #10527
Builds on @Danathar's branch
fix/claim-gate-escalate-10527(commit 9e93827, cherry-picked with his authorship kept). That commit adds the escalation gate:pkg/claimsattempt history (Stall,MarkEscalated,EscalationComment),pkg/github.IssueTimelineSince,cmd/hive/claimescalation.go, andgovernor.claims.escalate_after_claims(default 2). This PR adds the rest of the maintainer's/hive decision(option A plus the refinement):1. Kicks list issues; they don't claim them
recordAgentKickClaimsis nowrecordAgentKickListings. It records a ledgerListing: a 30-minute hold with no GitHub comment, and it is not anAttempt.HeldKeys(relayselectTask) andclaimsInflightLookup(other agents' kicks) respect the listing, so other workers still back off while the kick is live.github.Client.SetAgentStartHookfires on the agent's own authorized start signals: a relaycomment/label/claimrequest on the issue, or ahive-open-prrequest naming it in--issues. Each signal goes throughLedger.ClaimOnStart. That records the real agent claim, with the π comment and label, if a kick listed the issue to that agent within the agent claim TTL. If the agent already holds the claim, it renews it with no second comment. A signal on an issue no kick listed (for example a comment on the agent's own PR) records nothing.2. The escalation gate counts real claims only. Listings never create attempts, so an issue that just sat in a work list never escalates. The default threshold stays 2: the third no-progress claim is refused, and the issue gets
needs-humanplus one comment.3. Verify once (#10509). New
cmd/hive/verifyonce.goin-flight gate. It applies to an issue with merged-PR context that is nothive/verified-open. Once an agent claim on the issue postdates the merge (the verification), the issue is withheld from kicks until a person (not a bot or App account) comments, labels, assigns, closes or reopens it.IssueEventnow carriesActor/ActorIsBotfor this check. If the timeline can't be read, the issue is offered as before.Docs (
operator-reference.md,contributor-relay.md) and the changelog fragment are updated.Not covered: a raw
git pushof a branch is not a start signal by itself. The proxy relays the pack stream without parsing ref updates. The agent's first comment orhive-open-prrequest records the claim instead.Tests:
pkg/claims/listing_test.go,cmd/hive/verifyonce_test.go,pkg/github/agent_start_hook_test.go, plus updates toclaimswire_test.go,claimescalation_test.goandissue_timeline_test.go. None usetime.Sleep. Not run locally (CI is the verdict);gofmtis clean.β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88