Skip to content

πŸ› fix: unowned gateway backends pick the hive's gateway for pack agents - #15130

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14678
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-14678

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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 a backend_owner stamp. If scanner/quality/guide are on litellm with no owner (written into hive.yaml, on a hive older than ownership stamping, or created via POST /api/config/governor/agents, which never stamped an owner), hiveGatewayBackend counts 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-name backend: 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/agents now stamps an explicitly named backend/model as operator-owned, like every other dashboard backend write. The defaulted claude stays unowned.
  • Tests: TestApplyPackFollowsUnownedGatewayBackends and TestApplyPackUnownedCLIBackendsDoNotChooseGateway, plus owner assertions on the add-agent endpoint.
  • Updated the docs (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 as 2d67cd530 = v5.186.4-759, and git merge-base --is-ancestor 2d67cd530 4ca1d3fd2 is false. #14817 is 50540d0ba = 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

#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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/docs/agent-configuration.md

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (style/maintainability) β€” no blockers; two advisory notes.

  • src/pkg/dashboard/api_packs.go:1165-1169 / :1182 β€” agentBackendVote.operatorOwned now also carries "unowned gateway backend", but the struct doc still reads "whether an operator picked it", and the hiveGatewayBackend doc at :1232-1234 still says "Only operator-owned backends choose the gateway". The rule-1 bullet at :1213-1214 was 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 β€” the backend == "" guard duplicates the first check inside agentOnForeignGatewayBackend (:1146); the helper can be return agent.BackendOwner == "" && s.agentOnForeignGatewayBackend(strings.TrimSpace(agent.Backend), "").

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 48b6964 into v5 Oct 28, 2026
80 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14678 branch October 28, 2026 22:23
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15130ab584de` sha256:b019f99204f7e7565501e90f21fe7fcf0fe39f6ce44830db25596a4e35641077 β€” download from the dashboard or `hivectl review evidence #15130`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› bug: reviewer agent has mysteriously inconsistent configuration for inference

0 participants