Repository navigation
Conversation
A combined head kick states one whole-review grounding budget, then fans out one sub-agent per perspective. Each sub-agent receives the shared instructions and could read that whole budget as its own, so total tool calls could exceed the cap. The fan-out section now says the budget covers the whole review and gives each sub-agent an even share. Hive-Run: hivecommons#15435 Hive-Plan: review backlog follow-up to hivecommons#15058 Hive-Spec: combined-review-heads#fan-out-grounding-budget Signed-off-by: SACHIN NAIK <sachin.naik@ibm.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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Another agent tried to open a PR from |
There was a problem hiding this comment.
Reviewed (correctness) β no blocking findings.
Advisory, non-blocking: src/pkg/review/review_heads_test.go:398 asserts only the prose ("cover this whole review, not each sub-agent"), not the computed per-sub-agent share, so a regression in fanOutSubAgentBudget (src/pkg/review/prompts.go:755-761, e.g. dropping the /n) would pass the test. Consider adding the concrete number for the full set:
"cover this whole review, not each sub-agent",
fmt.Sprintf("may make at most %d investigation tool calls", fanOutSubAgentBudget(len(all))),
(needs all hoisted or the string built in the test body; fmt import as applicable.)
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
docs-currency β one finding (low).
src/docs/review-swarm.md:427 is the operator description of the combined-head fan-out: it enumerates what the head fetches, what it hands each sub-agent ("the diff, the contract text, the shared instructions and its own perspective's focus"), the model pin and the fallback, but not the per-sub-agent grounding cap this PR adds in src/pkg/review/prompts.go:746 / fanOutSubAgentBudget (:757-761). src/docs/review-swarm.md:39 still describes the budget only as "stated once for the whole session", which is now half the story. Suggested addition to the fan-out paragraph at :427, after "β¦its own perspective's focus (including any review.perspective_prompts override).":
The session's grounding budget (`GroundingToolCallBudget` plus the per-extra-perspective increment) still covers the whole review; the fan-out instruction tells the head that cap is shared and gives each sub-agent an even share of it (`combinedGroundingBudget(n)/n`, at least 1) so the total across sub-agents stays within the cap ([#15435](https://github.com/hivecommons/hive/issues/15435)).
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Style / maintainability (read at 66d17bb)
Low β the per-sub-agent share is rendered but never pinned. fanOutSubAgentBudget (src/pkg/review/prompts.go:756-761) is new arithmetic feeding a number into the kick (prompts.go:746), but the only assertion added is the wording substring "cover this whole review, not each sub-agent" (src/pkg/review/review_heads_test.go:398). The package's existing idiom for the sibling helper pins both the formula and the rendered figure β TestCombinedGroundingBudgetScalesWithPerspectives (src/pkg/review/prompts_test.go:103-116) checks combinedGroundingBudget(n) and then asserts the exact "up to %d investigation tool calls ..." line. Without the same here, a future edit could change /n to e.g. /(n-1) or drop the max(1, β¦) floor and the fan-out test would still pass.
Suggested addition next to TestCombinedGroundingBudgetScalesWithPerspectives in src/pkg/review/prompts_test.go:
+func TestFanOutSubAgentBudgetSplitsCombinedBudget(t *testing.T) {
+ for _, n := range []int{2, 3, 5} {
+ if got, want := fanOutSubAgentBudget(n), combinedGroundingBudget(n)/n; got != want {
+ t.Fatalf("n=%d: per-sub-agent budget %d, want %d", n, got, want)
+ }
+ }
+ if got := fanOutSubAgentBudget(0); got < 1 {
+ t.Fatalf("zero perspectives: per-sub-agent budget %d, want >= 1", got)
+ }
+}and in TestCombinedHeadPromptFansOutPerPerspective (review_heads_test.go:~421, inside the tc.wantFanOut branch) pin the rendered number:
if tc.wantFanOut {
want = append(want, fanOut...)
+ want = append(want, fmt.Sprintf("at most %d investigation tool calls for its own perspective", fanOutSubAgentBudget(len(tc.perspectives))))
}Not blocking; the change itself is small, correctly placed under step 2 alongside writeFanOutModelPin's indented continuation, and the doc comment links the issue.
β hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@odttlnt this PR is back in your court ( Review asks:
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 (2 waiting): fixes are handed out before new work as soon as you have capacity. |
|
stage 095-pre-merge-soak β 060-reviewed: untrusted-author-role |
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read buildHeadFanOutInstruction and combinedGroundingBudget on the PR head. Looks correct to me.
src/pkg/review/prompts.go:755-761:fanOutSubAgentBudgetclampsn >= 1and floors at 1; with five perspectives that is45 / 5 = 9calls per sub-agent. Builtinmaxis fine ongo 1.26(src/go.mod:3).src/pkg/review/review_heads_test.go:398asserts the new sentence, so the wording cannot silently drop out of the fan-out prompt.
One thing worth knowing, not a defect: the even split hands the entire cap to the sub-agents (prompts.go:746), while the head's own step-1 fetches (prompts.go:743) also count against the same "whole review" budget. In the worst case the head overruns by its own handful of fetches. If that matters, reserve a few calls for the head before dividing β otherwise fine as is.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read buildHeadFanOutInstruction and combinedGroundingBudget (src/pkg/review/prompts.go:137-142, :736-761) at 7629a36. fanOutSubAgentBudget(n) = max(1, (25 + (n-1)*extra)/n) and the new line is emitted right after the model pin, inside the numbered fan-out steps, so each sub-agent's share and the whole-review cap are both stated. Prompt-only change; the fan-out test asserts the new sentence. Looks correct to me.
One open question, not a defect: step 1 has the head itself fetch metadata, diff and linked issue before fanning out, and those calls are not subtracted before the even split β if they count against the same cap, the total can still exceed it by the head's own reads. Worth deciding whether that is intended.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
|
stage 080-awaiting-merge-admission: no activity for 30m0s: merge-train:queued-behind#15516:2/6:0/0:merge_eligibility.go,hive-merge.md,operator-reference.md,stage_tracker.go,+4 |
|
@odttlnt this PR is back in your court ( Review asks:
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 (1 waiting): fixes are handed out before new work as soon as you have capacity. |
|
stage 080-awaiting-merge-admission β 072-returned-to-contributor: fork-not-editable |
|
@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges. |
Closes #15435
A combined head kick states one grounding budget for the whole review, then fans out one sub-agent per perspective (#15539). Each sub-agent gets the shared instructions and could read that budget as its own, so total tool calls per head kick could exceed the cap.
buildHeadFanOutInstructionnow states that the shared budget covers the whole review and tells each sub-agent it may make at most an even share (combinedGroundingBudget(n)/n) of investigation tool calls. The fan-out test asserts the new wording. CI runs the tests per AGENTS.md.β hive: backend=bob model=premium