Repository navigation
π fix: unowned gateway backends pick the hive's gateway for pack agents - #15130
Conversation
#14777 only counted operator-owned backends when choosing the gateway a pack agent follows, so a hive whose agents were put on LiteLLM without a backend_owner stamp (hive.yaml, pre-ownership hives, or POST /api/config/governor/agents) had no gateway and the L2 reviewer stayed on copilot. An unowned inference/gateway backend can only be the operator's choice (packs write CLIs and stamp their gateway moves), so it now counts as an operator pick; unowned CLIs still abstain. The governor add-agent endpoint now stamps an explicitly named backend/model as operator-owned. Fixes #14678 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: MikeSpreitzer <14296719+MikeSpreitzer@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
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 |
There was a problem hiding this comment.
Read hiveAgentBackends / hiveGatewayBackend / gatewayPlacement in src/pkg/dashboard/api_packs.go and the pack's own stamping at api_packs.go:308, :316, :410 (every pack move writes BackendOwner = FieldOwnerPack). That confirms the premise of unownedGatewayBackend: an inference/gateway backend: with no owner cannot have come from the pack, so counting it as an operator pick is sound. The vote flag only feeds unanimity and the operatorPicks floor at api_packs.go:1249/:1268; the move itself is still gated on BackendIsPackOwned(), so unowned agents are not relocated β the new test asserts that too. The handleGovernorAddAgent stamping only applies when the body named a backend/model, and the defaulted claude stays unowned, as the body says.
Looks correct to me, and the body matches the diff.
One wording nit, not a defect and not new to this PR: "an unowned CLI backend neither picks nor vetoes" is true for unanimity, but at api_packs.go:1274-1280 an unowned CLI has packCLI=false, so it still counts in others and can deny the >50% majority. If that is intentional (an operator's hand-written backend: copilot should dilute), consider saying "neither picks nor vetoes unanimity" in the fragment/doc.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (style/maintainability) β no blockers; two advisory notes.
src/pkg/dashboard/api_packs.go:1165-1169/:1182βagentBackendVote.operatorOwnednow also carries "unowned gateway backend", but the struct doc still reads "whether an operator picked it", and thehiveGatewayBackenddoc at:1232-1234still says "Only operator-owned backends choose the gateway". The rule-1 bullet at:1213-1214was updated; these two were not. Either rename the field (e.g.operatorPick) or refresh those two comments so the three descriptions of the same bit agree.src/pkg/dashboard/api_packs.go:1199-1204β thebackend == ""guard duplicates the first check insideagentOnForeignGatewayBackend(:1146); the helper can bereturn agent.BackendOwner == "" && s.agentOnForeignGatewayBackend(strings.TrimSpace(agent.Backend), "").
β hive: agent=adjudicator-4 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 |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. 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 |
Fixes #14678
What #14777 still missed
#14777 (and its follow-up #14817) pick the gateway a pack agent follows only from operator-owned backends (
backend_owner: operator). The reporter says they set LiteLLM up from the dashboard's overall configuration, and nothing guarantees that path left abackend_ownerstamp. If scanner/quality/guide are onlitellmwith no owner (written intohive.yaml, on a hive older than ownership stamping, or created viaPOST /api/config/governor/agents, which never stamped an owner),hiveGatewayBackendcounts zero operator picks and returns"". The reviewer then stays on copilot even on a build that contains #14777.Change
hiveAgentBackends: an unowned inference-backend or gateway-namebackend:now counts as an operator pick. A pack only writes subscription CLIs, and it stamps any gateway move it makes as pack-owned, so an unowned gateway backend can only be the operator's choice. An unowned CLI backend is still ignored (it neither picks nor vetoes), because it may be a legacy pack placement. Unowned backends are still never moved.POST /api/config/governor/agentsnow stamps an explicitly named backend/model as operator-owned, like every other dashboard backend write. The defaultedclaudestays unowned.TestApplyPackFollowsUnownedGatewayBackendsandTestApplyPackUnownedCLIBackendsDoNotChooseGateway, plus owner assertions on the add-agent endpoint.agent-configuration.md) and added a changelog fragment.About the reopen evidence
The reopen was tested on
5.186.4-677-g4ca1d3fd2, which predates the fix. #14777 merged as2d67cd530=v5.186.4-759, andgit merge-base --is-ancestor 2d67cd530 4ca1d3fd2is false. #14817 is50540d0ba=v5.186.4-776. This PR closes the remaining unowned-backend gap so the fix holds whichever way the operator's gateway backends were written.β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@MikeSpreitzer