Repository navigation
π fix(unpark): a re-parked owner step recommends /hive done, not the /hive approve that looped - #17010
Conversation
β¦/hive approve that looped An owner step the hive parks again after an accepted reply is now read from its own text, so the issue body's answered recommendation no longer keeps /hive approve bolded. /hive done is the recommended reply when the owner-step text asks for it or when an accepted /hive approve already answered the same step; /hive approve is dropped there, and a second approve gets a reply pointing at /hive done while the issue stays parked. Lane policies now ask for -R <owner/repo> (or the web path) on every gh command handed to the owner, so it works outside a clone. Refs Danathar/goodreads-mcp#443 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 |
88d389b
βΉοΈ Sentinel notice β informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @Danathar, head
Hive did not add the |
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. |
There was a problem hiding this comment.
Read the Go changes against v6 and the surrounding unparkMenuFor / tryUnparkIssue flow. The logic looks correct to me.
What I checked:
- The new early return in
tryUnparkIssue(issue_unpark_command.go:608-615) sits aftereligibleUnparkCommand(:576), so an untrusted commenter's/hive approvestill never gets a reply. It reusespostUnparkReply, so no new write site. approveAnsweredonly becomes true when the re-park's marker is byte-identical to the one the accepted approve answered (issue_unpark_menu.go:140-142, :159-161, :207;ownerStepMarkerREatissue_owner_step.go:21captures the whole<!-- hive:owner-step β¦ -->tag). A re-park on a different step keeps/hive approveavailable, which is the conservative side.unparkReplyAnswersApproveresolves the command comment throughbyIDand rejects hive-authored comments and a 0/absent ID (issue_unpark_command.go:1187-1195), so a dashboard release reply (no per-comment marker) correctly does not count as an answered approve.answeredis reset on every owner-step-marker comment (issue_unpark_menu.go:214) and the body-level options/recommendation are cleared only on an owner-step re-park after an accepted reply (:208-212); a withdrawn park already cleared them before this change, so the two paths now agree.replies():addApprovemasksrecommendedwheneverdoneRecommended()is true, and them.ownerStep && m.approveAnsweredcase precedes the recommendation cases, so no path can both drop approve and recommend it.
One note, not a defect: unparkAsksDone (:80-82) is a substring match on /hive done anywhere in the park text. It fits the current park texts, which only mention the command when asking for it; a park that says "do not reply /hive done yet" would still bold it. Cheap to tighten later if that ever shows up.
The 48 policy-file edits are the same -R <owner/repo> paragraph in both policy copies and are declared in the body; TestLanePoliciesParkOwnerOnlyHandOffs pins them.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Style/maintainability review at head 88d389b (read the diff plus 1. 2. - if command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled) &&
- menu.ownerStep && menu.approveAnswered {
+ approveHandledHere := command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled)
+ if approveHandledHere && menu.ownerStep && menu.approveAnswered {
if err := c.postUnparkReply(ctx, owner, repo, number, candidate.GetID(), unparkApproveAnsweredReply); err != nil {
return false, err
}
result.Replies++
return true, nil
}
- if command.Kind == unparkCommandApprove && !(releasePolicy.enabled && menu.releaseStep != nil) && (!labelDriven || la.enabled) &&
- !menu.ownerStep && menu.releaseStep == nil && !unparkTextsProposeOwnerStep(issue, comments) && !labelPresent(issueLabelNames(issue.Labels), issueBlockedLabel) {
+ if approveHandledHere &&
+ !menu.ownerStep && menu.releaseStep == nil && !unparkTextsProposeOwnerStep(issue, comments) && !labelPresent(issueLabelNames(issue.Labels), issueBlockedLabel) {Minor: the bead-only lanes' insert (e.g. |
There was a problem hiding this comment.
Read issue_unpark_menu.go and issue_unpark_command.go at this head against v6, and traced the loop the PR describes. The fix matches the code.
- The cause is as stated: on
v6an accepted reply clearsownerStepbut leavesrecommendationSourcefrom the body, soreplies()keeps bolding/hive approve, andtryUnparkIssueskips the "nothing to accept" check for owner steps (issue_unpark_command.go:605), so each approve un-parks again. - The new refusal is safe against re-looping:
unparkApproveAnsweredReplygoes out viapostUnparkReply(issue_unpark_command.go:1746), whose per-comment marker puts the second approve intoansweredUnparkCommentIDs, and the reply body carries nounparkAcceptedMarker, sounparkMenuFor(issue_unpark_menu.go:154) does not misread it as an acceptance on the next pass. unparkReplyAnswersApproveignores dashboard release replies (no reply marker β ID 0 β nil) and hive-authored command comments, soapproveAnsweredonly fires when a human's/hive approveon the same marker was accepted; a re-park on a different marker starts clean.unparkReplyAnsweredIDis a straight extraction of the existing parse, same" "terminator the%d -->marker format produces.- The
src/pkg/policies/defaultsandsrc/policiescopies are byte-identical for the files I diffed, andTestLanePoliciesParkOwnerOnlyHandOffsnow enforces the-R <owner/repo>rule.
One behaviour note, not a defect: unparkAsksDone is a substring match on /hive done, so any owner-step text that mentions /hive done as the completion signal now bolds it over /hive approve. The PR says so and updates the two issue_unpark_notice_last_test.go expectations accordingly; it reads as intended.
Looks correct to me.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
When an agent parks an issue again on the same owner-only step after the owner's
/hive approve, the "What to reply" notice now recommends/hive doneand stops offering/hive approve. Before this change it kept recommending/hive approveoff the issue body's old "Recommendation" heading. Following that advice un-parked the issue, the agent parked it again, and the loop repeated. A second/hive approveon such a step now gets a reply that points at/hive done, and the issue stays parked. Lane policies now also ask agents to give everyghcommand they hand the owner-R <owner/repo>, so the command works outside a clone of the repo.What went wrong
Danathar/goodreads-mcp#443 (on a private hive, build older than v6; the code path below is unchanged on v6 tip
f7acdbf5d):<!-- hive:owner-step kind=release tag=2026.11.0 target=e22b3b0β¦ -->). Its body has a## Recommendationheading with the release command./hive approve(01:20:58Z). The hive un-parked it with "go with the recommendation" (01:25:50Z)./hive done."/hive approveβ go with the recommendation (recommended), with/hive doneunmarked.The cause is in
unparkMenuFor(src/pkg/github/issue_unpark_menu.go:95-170@f7acdbf5d). The body's recommendation becomesrecommendationSource(line 104). An accepted reply clears the owner step (lines 112-116) but not the recommendation. The re-park comment says nothing about a recommendation, so the body's survives, andreplies()bolds/hive approvefor it (line 246)./hive doneis always added unbolded (line 218). On an owner step,/hive approveskips the "nothing to accept" check (issue_unpark_command.go:605@f7acdbf5d), so each approve un-parked the issue again.The owner-step command (
gh workflow run release.yml --ref main) is agent prose. The hive only appends the marker (issue_owner_step.go:143,issue_unpark_menu.go:409@f7acdbf5d). The lane policies' owner-only park rule (for examplesrc/pkg/policies/defaults/architect-full.md:36-41@f7acdbf5d) never asked for-R.What changes
/hive doneis recommended when the owner-step text asks for/hive done, or when an accepted/hive approvealready answered the same step (same marker). In those cases/hive approveis never bolded./hive approveis dropped from the notice for a step it already answered. A second/hive approvethere gets a new reply pointing at/hive done, and the issue stays parked. It goes through the existingpostUnparkReplysite, so there is no new write site.unparkReplyAnsweredID.-R <owner/repo>on eachghcommand, or the web path (Actions β workflow β Run workflow). Both policy copies are updated (src/pkg/policies/defaultsandsrc/policies).release_on_approve: true) is unchanged.Also checked
/hive doneis a real un-park command on v6:parseUnparkCommand(issue_unpark_command.go:1293@f7acdbf5d), recorded withunparkCommandDecisionText.pkg/github/pr_reply_options.go) doesn't use the issue menu, and offers neither/hive donenor a recommended/hive approve. It needs no change.Files
src/pkg/github/issue_unpark_menu.go: menu reading and reply ordering, plus the new reply text.src/pkg/github/issue_unpark_command.go: refusal of a repeat approve; the shared marker-ID helper.src/pkg/policies/defaults/*.mdandsrc/policies/*.md:-Rrule.src/docs/maintainer-commands.md,changelog.d/fixed-owner-step-menu-recommends-done.md.Tests
TestUnparkMenuReparkedOwnerStepRecommendsDone: the Add knowledge promoter for cross-layer fact promotionΒ #443 shape recommends/hive doneand offers no/hive approve. Also covers a re-park that doesn't mention done, a different step, an answered/hive decision, and a body that asks for done.TestSweepIssueUnparkReapproveOnAnsweredOwnerStepStaysParked: a second approve is refused and nothing is un-parked.TestLanePoliciesParkOwnerOnlyHandOffsnow requires the-R <owner/repo>rule.f7acdbf5dand pass with this change. Two assertions inissue_unpark_notice_last_test.gonow expect/hive donebolded, because those owner steps ask for it.go testof./pkg/github/ ./pkg/policies/ ./pkg/writeback/ ./pkg/promptsrc/,go vet, and the docs citation and link checks.Refs Danathar/goodreads-mcp#443
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1