Repository navigation
π fix(contribute): remote task MCP URL is this hive's own address, never the hub's - #16908
Conversation
β¦ver the hub's With task_mcp.remote_enabled, the mcp.url in task_assign fell back from dashboard.public_url to hub.dashboard_url (hub enabled or not) and then to hub.url. hub.url is the hub itself and has a default on every hive, so a hive with no public address sent https://hive.hivecommons.dev/api/contribute/mcp together with its own lease bearer, and the relay wrote both to .mcp.json. The URL is now dashboard.public_url, or hub.dashboard_url while the hub is enabled; resolveSpokeDashboardURL has had the same hub.enabled condition for hub-launched agents since issue 10282. hub.url is never used. With no address left the hive sends no mcp block, mints no bearer and logs why at info level. The docs now say which URL contributors are given. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Danathar <Danathar@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
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether remote contributors on a hub spoke that has no hub.dashboard_url (and on hub-less hives that relied on hub.url) should lose the task MCP entirely, as this PR does, rather than falling back to the derived https://<hive_id>. address that resolveSpokeDashboardURL still uses.
The code is correct and fixes a real credential misrouting; I'm routing it because it changes where a lease bearer is sent and drops one fallback, and that sign-off belongs to a maintainer.
Verified in the tree
src/pkg/config/defaults.go:236setsHub.URL = "https://hive.hivecommons.dev"on every hive, so the old third candidate intaskMCPURLreally did put the hub intomcp.urlβ with this hive's bearer β for any hive lackingdashboard.public_url/hub.dashboard_url.- The new gate (
hub.dashboard_urlonly whilehub.enabled) mirrorsresolveSpokeDashboardURLatsrc/cmd/hive/main.go:1859. mintTaskMCPForAssignmentalready returnednilon an empty endpoint, so no bearer is minted now either; the new log line usesh.logger, whichNewContributeWSHubdefaults when nil.- Tests cover the three withheld cases and the kept cases.
The one decision (low severity, behaviour change) β task_mcp_lease.go:46: resolveSpokeDashboardURL (main.go:1870-1874) still derives https://<hive_id>.<hub-host> for a hub spoke without hub.dashboard_url. taskMCPURL deliberately does not, so such spokes now hand out no task MCP until the operator sets a URL. The PR body states this as intended; a maintainer should confirm that trade-off is acceptable (safe default) versus adopting the same derived address.
I have not approved or changed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Looks correct to me, and it is a strict tightening: the old third candidate Verified against the tree:
One non-blocking observation for the operator-facing behaviour change: |
Summary
With
task_mcp.remote_enabledon, a hive could name the hub as its own task MCP. The contributor's agent then sent this hive's lease bearer to the hub. Any hive withoutdashboard.public_urland without a hub-assigned dashboard URL did this, becausehub.urlhas a default on every hive. The URL is now only ever this hive's own address. A hive with no such address hands out no task MCP at all, and its contributors work without it.What went wrong
The URL was taken from
dashboard.public_url, thenhub.dashboard_url, thenhub.url.hub.urlis the hub, not this hive. A hub-less hive with nodashboard.public_urlput this in everytask_assign:The relay writes that block into the contributor's
.mcp.json. The agent then calls that address with this hive's bearer. It is the hub's address, not this hive's, so the call cannot reach this hive's task MCP either.Two more cases did the same. A hive whose hub link is off still used an old
hub.dashboard_url. A hub spoke with nohub.dashboard_urlyet used the bare hub URL.What changes
dashboard.public_url, orhub.dashboard_urlwhilehub.enabledis true. The URL given to hub-launched agents already ignoreshub.dashboard_urlon a hive whose hub link is off (issue 10282).hub.urlis never used.mcpblock and mints no bearer. It logs one info line per task that points atdashboard.public_url.dashboard.public_url, or a hub spoke with itshub.dashboard_url, sees no change.dashboard.public_urlstill comes first.hub.dashboard_urlmust now setdashboard.public_url.Files
src/pkg/dashboard/task_mcp_lease.go:taskMCPURLreturns only this hive's own address.mintTaskMCPForAssignmentlogs when there is none.src/pkg/dashboard/task_mcp_remote_url_test.go: new testsTestRemoteMCPBlockWithheldWithoutAPublicAddressOfThisHive,TestRemoteMCPURLNamesThisHiveandTestSelectTaskAssignCarriesRemoteMCPBlockOnlyForThisHive.src/docs/design/task-mcp.md: which URL contributors get, and when none is sent.src/docs/contributor-relay.md: the same, in short, for contributors.src/docs/operator-reference/README.md: thedashboard.public_urlrow now mentions the task MCP.changelog.d/security-task-mcp-remote-url-never-hub.md: the release note.Tests
mcpblock and no bearer: hub-less with nodashboard.public_url, hub-less with an oldhub.dashboard_url, and a hub spoke with nohub.dashboard_urlyet. All three fail without the change.task_assignfrom task selection has nomcpkey when the hive has no public address. This fails without the change. Withdashboard.public_urlit carries this hive's URL.dashboard.public_url(used exactly as the operator wrote it), a hub spoke with itshub.dashboard_url, anddashboard.public_urlfirst when both are set.go test -count=1 -run 'TaskMCP|ContributeMCP|RemoteMCP|Lease' ./pkg/dashboard/passes. So does-run 'SelectTask|Standby'.π€ Generated with Claude Code