cybershape asked for a client's model list to show only a group, not
every model behind it. A provider could already be kept for routing
groups (Provider.Unlisted), but that hides the whole provider, and the
models a group names may come from providers used elsewhere too.
Group.Unlists (json "unlists"): the models a group names (a member fixed
at an effort counts as its model) and those its patterns match leave
Catalog(), so `magpie models`, /v1/models and every agent's list
(CatalogFor) show the group without them. They stay in Served(), so a
group routes over them and a request naming one as provider/model is
still answered, and Unlisted() returns them for the GUI as it does an
unlisted provider's. A nested group keeps its own setting; a group
switched off or hidden keeps nothing out. With no group unlisting,
Catalog() takes a fast path and is unchanged.
- Routing view: the group editor's "Model lists" (Its models too / The
group alone, segmented, with a hint), saved with Save; the card shows
"Its models unlisted". Both group Save paths send unlists. zh, zh-TW,
ja, de.
- CLI: `magpie group set <id> listed=no|yes`; `magpie group <id>` shows
listed: no.
- TUI: the group member picker offered Catalog(), so models kept out of
the lists (an unlisted provider's, before this too) couldn't be put in
a group from the TUI. It offers Served(), as the GUI's picker does.
- docs/reference.md, Routing groups: listed=no.
Product call: a per-group switch, off by default, rather than hiding
members of every group, so existing lists don't change under anyone.
Run:
- go test ./internal/provider -run 'Group|Catalog|Unlisted|Served',
./internal/gui, root package, ./internal/tui: ok.
TestGroupUnlistsItsModels fails with the Catalog filter removed;
TestMemberOptionsOfferUnlistedModels fails with the picker on
Catalog(); TestApplyGroupPairs covers listed=no/YES/maybe.
- GUI group-unlists.test.cjs, Chromium and WebKit, en zh zh-TW ja de, at
1100px and 420px: 20/20. i18n-keys: ok.
- gofmt; go vet darwin, windows, linux (-tags nogui): clean.
Not tried: with the reporter's own client; a real agent's model file
written after toggling (CatalogFor is covered by the test).
provider.GroupFor tries the group's id and the model's spellings first, as
before, then the one group whose name (by its slug) is the id asked. A
name two groups share names neither, and a model a provider serves by
that id stays the provider's.
Verified: TestGroupAskedByItsName fails on the old GroupFor with 404
"magpie knows no model \"DS Flash\""; TestGroupRenameSaysTheIDStays fails
without the message. internal/provider and internal/gateway pass in a
sandbox HOME.
wherever a ref is read back from an agent's settings
An agent on a routing group is shown, on the Providers page, on each of
that group's providers — the row's middle holds one button per agent, and
`uses` is what the Routing page's "n agents routed through it" counts.
A group whose model has a 1M window is written into Claude Code's
settings with the mark Claude Code itself puts on it
(`group/auto-deepseek-v4-1-flash[1m]`), and GroupFor takes the mark off
for the gateway; the rest did not. So the group was not found, and an
agent Claude Code had on it was listed on none of the group's providers,
while every request it made went through them.
Four places read such a ref back:
- provider.GroupFinder, which the Providers page asks (agentUses)
- agent.sameModel, which moves an agent whose group is gone to the same
model from a provider still serving it — the mark left on made the
comparison against AutoGroupOf find nothing, and the agent stayed on a
group nobody serves
- agent.groupNamed, which says whether two values of a field reach the
same group, one of them read back from the agent's own settings
- the CLI's groupUses, which lists "← agent" beside a group: the marked
id was filed under one no group has, and Claude Code was on no row
Each takes the mark off, as GroupFor does. A group's own members are not
touched: those are the group's structure, never a ref from an agent's
settings, and a [1m] there is a model's, not the group's.
group_uses_test covers the page (a group found with and without the mark,
and the row naming the agent on the group's provider); applied_test covers
groupNamed; reseat_test covers the move (the marked group ref finds the
same model elsewhere, and a group that is nobody else's still gives
nothing); groups_cli_test covers the CLI, with Claude Code's settings.json
as the reporter's reads. Each fails without its fix. go build, go vet
pass; go test ./internal/agent/ passes, and the failures that remain are
the ones a clean origin/main has too (Aside's symlinks, ~/.codex
dependence, VSCode's launchers, a flaky Zed case).
Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>