The row under the MCP router said "Claude Code, Claude Desktop, Codex and
Pi find tools themselves and are given every one", but hubOnDemand gives
every tool to Droid and omp too (hubSearchesItself). The words now come
from the code: gateway.HubFindsItself (the ordered list hubSearchesItself
is built from) and gateway.HubOnDemandOver reach the library's view as
hubFindsItself (each agent by its name, its id when none is found) and
hubOnDemandOver, and the row joins them with the language's list
separator. Two keys replace the old sentence in zh, zh-TW, ja and de; the
CJK sentences follow each other with no space.
Tests:
- TestHubFindsItselfIsWhoGetsEveryTool: every named agent (and its WSL
id) is given every tool, every agent given every tool is named, and
other agents get theirs on demand.
- TestHubFindsItselfInTheView: /api/library carries the gateway's list
and threshold, each agent by its name.
- library-mcp-router-tools.test.cjs: the row's text is built from the
view's list and count (fixture: 12, six agents), names each one, never
says 10, and has no "。 ".
Run (wsl-run, magpie-desktop; mote was at load 46-49 of 18, mica's disk
full), at this tree on 35a03fee0:
- gofmt -l internal/gateway internal/library internal/gui: clean
- go vet -tags nogui, and GOOS=windows go vet -tags nogui, of
./internal/gateway ./internal/library ./internal/gui: ok
- go test -count=1 ./internal/gateway -run 'Hub|MCP': ok
- go test -count=1 ./internal/gui ./internal/testenv: ok (134s)
- go test -count=1 ./internal/library: ok (183s)
- node --test i18n-keys, library-mcp-router-tools,
library-mcp-router-note, library-mcp-hub (chromium and webkit; 1100
and 420 wide; en, zh, zh-TW, ja, de): 70 of 70 ok
Broken by hand (a copy of this tree): dropping omp from the list while
omp still gets every tool, TestHubFindsItselfIsWhoGetsEveryTool fails
"omp is given every tool but not named"; putting the old hardcoded "10"
and four names back into the row, library-mcp-router-tools fails in
every language. That run also showed "。 " in zh, fixed here.
Not run: the full go test ./... and the whole GUI suite; the real app.