Commit Graph
2 Commits
Author SHA1 Message Date
ggbdpq 3b7fe8e5f3 fix(cli): visible <agent> all clears the models taken out and the only-picked switch
What changed: `magpie visible <agent> all` took only the visibility
narrowing out, leaving HiddenModels and PickedModels in place. An agent
shown none of them — shown only the models picked for it with none picked,
then switched to --show-new, which keeps what it is shown by taking the
rest out — stayed none through `all`, the very recovery `magpie models`
and the gateway's refusal to name a model point at; only deleting
hiddenModels.<agent> from settings.json brought the models back (#4587, a
DSH behind a Docker gateway saw an empty model list; #3432, closed as not
planned, the same for an only-picked agent). `all` now takes the hidden
models and the only-picked switch out together with the narrowing, and its
usage line says so.

Run: go test ./internal/cli/ -run 'TestVisibleAll' -tags nogui — two new
tests fail before the change and pass after it.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
AnxForever 6794cccd53 cli: models and visible find a WSL agent by its id, in any case (#271)
`magpie models --agent` and `magpie visible <agent>` turned the typed name
into an agent through usage's AgentOf, which knows the built-in agents
only, so a WSL agent's id (claude@wsl:Ubuntu) was "no agent". Both now
use agent.Find, as every other agent command does, and visible keeps its
key lowered, as VisibleTo looks it up.

Landed from #271 (AnxForever), merged onto main by hand. The test moved
from the repo root into internal/cli, where the code it tests lives, with
one more case added: TestWSLAgentByIDInModelsAndVisible.

Run (merged onto 5b14ebf49): gofmt clean; go vet darwin, GOOS=linux -tags
nogui, GOOS=windows ok; go test -tags nogui ./... ok (agent, gateway,
plugin and provider passed on a rerun with -timeout 45m, after timing out
at 10m under load average ~30). Break-check: with providers_cli.go and
visible_cli.go put back to main's, TestWSLAgentByIDInModelsAndVisible
fails. Not run: a real WSL distro.
2026-10-13 09:56:06 +08:00