ChangQiu on Discord switched a provider off long ago, and magpie still
reached it. Routing, fallback, usage and balance reads, warmups,
check-ins and keepalive were already held back (On(), leftAlone,
KeepListsFresh). These were not:
- The plugin host's providers listing ran every plugin's models hook,
which asks the vendor, and its sign-in renewal (fresh), for every
plugin provider, on or off. Go now passes the ids switched off
(plugin.ListingOff, provider.pluginsOff: the provider's id and the
plugin's own id, read from providers.json alone). host.js lists such
an id without running a hook (info(..., quiet)), so its row stays and
keepListed keeps the last list.
- Sync (POST /api/sync, `magpie sync`) fetched every ready provider's
list. Both now go through provider.RefreshLists, which skips one
switched off.
- Saving or switching on in the GUI fetched the list even for one left
off; PrefillNewKeys asked one switched off too.
What still asks one switched off, by the user's own click: the TUI's
refetch, the provider Test button and `magpie provider models <id>`
refetch.
Tests: TestOffPluginProviderAskedNoModels (the fake plugin's models
endpoint counts its hits: 0 while off, the list kept, asked again once
switched on), TestPrefillAsksNoProviderSwitchedOff,
TestPluginsOffNamesThePluginsOwnIDs and
TestRefreshListsAsksNoProviderSwitchedOff.
Run on mote at this head (first at a4916aec1):
- go test -timeout 45m ./internal/provider ./internal/plugin
./internal/gui ./internal/cli ./internal/tui ./internal/gateway:
provider, plugin and tui ok. Three reds, each also red on origin/main
and filed: gui TestMainWindowCorners/macOS_26_SDK (#3949), cli
TestEveryRouteHasACommandOrIsNamed (#4826), gateway
TestCodexPoolSaysTheClientsVersion (#4807).
- After rebasing on ce2e81da1: provider and plugin again, plus darwin
vet of the four packages. One provider run went red on
TestClaudeAccountServesModelsListedSinceItsFetch (#3174, full-run
only). It is green alone 3/3 on this head and on origin/main, and the
next full provider run was ok on both.
- GOOS=windows go vet of plugin, provider, cli and gui: clean.
gofmt -l: clean. Linux go vet (WSL magpie-desktop) of plugin and
provider: clean. cli and gui can't be vetted there: the distro has no
gtk4/webkitgtk-6.0 headers for wails' cgo.
Broken by hand: with each guard taken out, its test went red ("switched
off, the vendor was asked 2 times", "the vendor asked 2 times",
"pluginsOff = [fakeco onco openai openai-plugin]", "the provider
switched off was asked 1 times").
Not tried: a real plugin provider switched off in the app. Which
provider ChangQiu had switched off isn't known, so his exact case is
not reproduced.