Repository navigation
π review: split the grounding budget across fan-out sub-agents - #15617
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: #15435 Hive-Plan: review backlog follow-up to #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
|
There was a problem hiding this comment.
Looks correct to me, and this is a byte-identical adoption of #15564 (both heads are ba20c782733e), so a maintainer can close #15564 in favour of this one β the fork branch cannot be pushed to by the hive, this branch can. I have not closed anything.
What I verified at ba20c78:
src/pkg/review/prompts.go:746adds the per-sub-agent budget line tobuildHeadFanOutInstruction;fanOutSubAgentBudget(prompts.go:755-761) returnsmax(1, combinedGroundingBudget(n)/n)withnclamped to β₯1, so it cannot divide by zero or hand a sub-agent a zero budget.combinedGroundingBudget(prompts.go:137-141) is unchanged; the head's own whole-review cap atprompts.go:697still states the same total, so the two numbers in the prompt are consistent.src/pkg/review/review_heads_test.go:398asserts the new wording inTestCombinedHeadPromptFansOutPerPerspective.- Changelog fragment name
fixed-15435-fanout-grounding-budget.mdfollows the<category>-<slug>.mdrule.
Scope matches #15435 exactly; no unrelated changes.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Style review (head 87124cd) β approve, one advisory.
src/pkg/review/review_heads_test.go:398pins only the prose fragment"cover this whole review, not each sub-agent"; the newfanOutSubAgentBudget(src/pkg/review/prompts.go:773-778) and the renderedat most %d investigation tool callsnumber (prompts.go:763) are asserted nowhere. The sibling helper is covered byTestCombinedGroundingBudgetScalesWithPerspectives(combined_boilerplate_test.go:103-124), which checks the value for 0/1/N perspectives and the exact rendered line. Following that convention (e.g.fanOutSubAgentBudget(len(DefaultPerspectives))*len(DefaultPerspectives) <= combinedGroundingBudget(...)plus the rendered line) would keep a future budget-constant change from silently breaking the split. Non-blocking.
β hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (docs-currency) β approve, one advisory.
src/docs/review-swarm.md:483(the Combined heads fan-out paragraph) still describes each sub-agent being handed "the diff, the contract text, the shared instructions and its own perspective's focus" with no mention of the per-sub-agent grounding cap this PR adds atsrc/pkg/review/prompts.go:763(fanOutSubAgentBudget,:773-778).:39likewise says the budget "is stated once for the whole session", which under a fan-out is now also split per sub-agent. A one-sentence addition at:483(e.g. "β¦and a per-sub-agent share of the session's grounding tool-call budget, so the whole-review cap is not read as each sub-agent's own") would keep the operator doc in step. Changelog fragment is present and correctly named.
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:Sign-off survives the squash |
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Read src/pkg/review/prompts.go at this head. Same patch as #15564 (identical git patch-id; that head already has a hive approve). fanOutSubAgentBudget (prompts.go:770-778) returns max(1, combinedGroundingBudget(n)/n), and combinedGroundingBudget (prompts.go:142-147) already floors n at 1, so the division is safe and the per-sub-agent figure can never exceed the shared cap. The sentence is injected at prompts.go:763, right after the model pin and before the "sub-agents must NOT post" rule, and TestCombinedHeadPromptFansOutPerPerspective asserts it. Looks correct to me.
One observation, not a defect: integer division drops the remainder, so with 5 perspectives a handful of the combined budget goes unallocated. Acceptable β the point of the change is that the sum stays under the cap.
β hive: agent=reviewer-2 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 |
Supersedes #15564 (adopted after CI went red and the contributor was unavailable; original commits by @odttlnt preserved).
Closes #15435
This branch is #15564's head
ba20c782733eas pushed by @odttlnt (forkodttlnt/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.