Repository navigation
✨ review: fan a combined head kick out to one sub-agent per perspective - #15539
Conversation
A combined review head (#15068) judges every perspective in one record-only kick, but nothing told it how to spend that kick, so a head walked the perspectives one after another and its kick took the sum of all of them. The combined head prompt now carries a FAN-OUT section: fetch the PR metadata, the diff and any linked issue or contract once, start one sub-agent per perspective in parallel with the diff, the contract text, the shared instructions and that perspective's focus, then collect their verdict objects into the one JSON array and record it once with --record-verdict. Sub-agents post nothing, never call hive-review and do not refetch the PR. Without sub-agents the head reviews the perspectives in sequence; the array contract is unchanged. The wording is backend-neutral (Task tool on Claude Code, sub-agents on Codex). A single-perspective re-ask carries no fan-out section, and plain combined kicks are unchanged. Refs #15058 Signed-off-by: Gregory Hunt <greg@on-board.ai> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fan-out told a head to start one sub-agent per perspective without naming a model, while the head's independent-review section pins a single sub-agent to the head model. On a backend whose sub-agent facility defaults to another model, per-perspective verdicts could come from a model other than the one the head is stamped with. Each fan-out sub-agent is now launched with the head's model and replaces (not adds to) the pinned independent-review sub-agent; a head that cannot pin it reviews the perspectives itself. Docs and test updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Gregory Hunt <greg@on-board.ai>
|
[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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether this adoption (#15539) is closed in favour of the original #15431, whose head 3ee9bfa is now fully green with an identical diff, or whether the adopted branch is preferred so the hive can push follow-ups.
This is a byte-for-byte duplicate of #15431. Flagging for a maintainer: one of the two should close; I have not closed anything.
What I verified
gh pr diffof #15539 (ed1f3c8) and #15431 (3ee9bfa) are identical: same 4 files, 140 additions, 0 deletions (changelog.d/changed-15058-combined-head-fanout.md,src/docs/review-swarm.md,src/pkg/review/prompts.go,src/pkg/review/review_heads_test.go).- Both branches carry the same two content commits (
75cd757,09bf904) plus v5 merges; this branch's only extra commit ised1f3c8 Merge branch 'v5' into hive/adopt-15431. - This PR's body says it was adopted because CI on #15431 "went red" and the fork was not editable. That premise has lapsed: #15431's current head
3ee9bfashows every required check SUCCESS (onlytidepending), the same state as this PR.
Code read (applies to both PRs)
BuildCombinedPrompt (src/pkg/review/prompts.go:716) adds the fan-out section only on the HeadRecordOnly branch, so plain combined kicks and the decision prompt are untouched. buildHeadFanOutInstruction returns "" for len(perspectives) < 2 (prompts.go:737), so a single-perspective re-ask gets no section — matched by the "head, single perspective re-ask" case in review_heads_test.go. writeFanOutModelPin emits backend/model when both are set and a model-only pin otherwise, with the model == "" fallback keeping sub-agents on the session model. No defects found; this looks correct to me.
Recommendation
Since the original is green and the diffs are identical, closing this adoption in favour of #15431 preserves @gregoryhunt's authorship with no loss. If the hive would rather hold the pushable branch for a future rebase, close #15431 instead — but merging both is not possible, and merging one makes the other a no-op.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether to close this adoption (#15539) in favour of the contributor's original #15431, now that #15431 is green and its author is active.
Tree-identical to #15431 — only one of the two can land, and #15431 now looks like the better survivor.
What I verified (checkout of both heads):
git diff 3ee9bfab…(#15431) ed1f3c89…(#15539)is empty — the trees are byte-identical. Both addbuildHeadFanOutInstruction/writeFanOutModelPininsrc/pkg/review/prompts.go:737-772, the test insrc/pkg/review/review_heads_test.go, thereview-swarm.mdparagraph and the changelog fragment.- This PR's body says it was adopted "after CI went red and the contributor was unavailable". That is no longer the state: #15431's current head
3ee9bfais a signed-off merge ofv5pushed by @gregoryhunt after the adopteddcf16aa, and every check on #15431 is green (tidepending only). The contributor is active and the fork PR is mergeable. - #15431 also keeps the author's DCO trail cleanest: the three
Merge branch 'v5'commits on this branch (5844efc,d87392b,ed1f3c8) carry noSigned-off-by.
The code itself is correct on both: the fan-out block is only emitted on the HeadRecordOnly path (prompts.go:712-716), returns "" for a single-perspective re-ask (:738), and its "independent review described above" reference is accurate — writeIndependentReviewSection runs earlier in BuildCombinedPrompt (:690) with the same backend/model target form as independent.go:33-43.
Recommendation for a maintainer: merge #15431 and close this one as superseded-by-original. I have not closed anything.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @ed1f3c8, 62/63 checks green, 1 pending, DCO yes, soak 0s of 30m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether this adoption (#15539) or the original #15431 lands — their diffs are byte-identical, so only one should merge.
Duplicate of #15431 — identical content, pick one.
I fetched both diffs (gh pr diff) and they are byte-for-byte identical (186 lines each, diff empty). Both branches carry the same two content commits, 75cd757 and 09bf904; they differ only in Merge branch 'v5' commits (3ee9bfa on #15431 vs ed1f3c8/3ece062 here). Same four files: changelog.d/changed-15058-combined-head-fanout.md, src/docs/review-swarm.md, src/pkg/review/prompts.go, src/pkg/review/review_heads_test.go.
The body here says #15431 was adopted "after CI went red and the contributor was unavailable". That no longer holds: #15431's current head 3ee9bfa has every check green except tide (pending, same as here), and it already carries a hive approve verdict. So the reason for the adoption has lapsed and the two PRs now race.
Correctness read of the shared change (same as my read of #154313ee9bfa): buildHeadFanOutInstruction is only reached on the HeadRecordOnly branch of BuildCombinedPrompt (src/pkg/review/prompts.go:716) and returns "" for len(perspectives) < 2, so single-perspective re-asks and plain combined kicks are untouched; PromptOptions.ReviewBackend/ReviewModel exist at prompts.go:274-275. Prompt-text only — no runtime behaviour change outside the kick text. Looks correct to me.
Recommendation: merge #15431 (original author's branch, already verdict-approved) and close this one as redundant — or, if the hive policy is that adopted branches win because they are editable, merge this and close #15431. Either way, only one should land; the second becomes an empty merge. I have not closed anything.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether to merge the adoption #15539 or the original fork PR #15431 (both green, byte-identical diffs) and close the other, so the second does not sit in the queue as a no-op.
Conclusion: this PR is a byte-identical copy of #15431 (gh pr diff of both, minus index lines, has no differences: same 4 files, +140/−0). The code looks correct to me; the only open question is which of the two should land.
What I verified
src/pkg/review/prompts.go:716—buildHeadFanOutInstructionis appended only inside theHeadRecordOnlybranch ofBuildCombinedPrompt, afterbuildHeadRecordOnlyInstruction, so plain combined kicks and the decision prompt are untouched. It returns""forlen(perspectives) < 2(prompts.go:737), so a single-perspective re-ask carries no fan-out section, as the body claims.writeFanOutModelPin(prompts.go:759) falls back to "run on the model you are running on now" whenReviewModelis empty and prefixesbackend/only whenReviewBackendis non-empty — no nil/empty-string edge I could find.review_heads_test.go:382TestCombinedHeadPromptFansOutPerPerspectivecovers every case the body lists (all perspectives, partial re-ask, single re-ask, non-head kick, pinned vs unpinned model). CI is green on both PRs, includingtest,coverageandgolangci-lint.- Prompt text and
src/docs/review-swarm.mdagree with each other and with the changelog fragment.
Why a human is needed: this was adopted because #15431's fork was not pushable while CI was red; CI on #15431 is now green at 3ee9bfa and the hive already recorded an approve verdict for it. Whichever merges first makes the other a no-op against v5. Since #15431 preserves @gregoryhunt as the PR author, I'd lean toward merging the original and closing this one — but that is a maintainer's call. I have not closed anything.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @e256209, 59/61 checks green, 2 pending, DCO yes, soak 0s of 30m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15431 (adopted after CI went red and the contributor was unavailable; original commits by @gregoryhunt preserved).
This branch is #15431's head
dcf16aa3978aas pushed by @gregoryhunt (forkgregoryhunt/hive), unchanged. Last lane reason on the original:fork-not-editable.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.