ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4dfdd0cd63 |
provider: a provider switched off is asked for nothing, its plugin's model list included
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 |
||
|
|
0431793db4 |
provider: a key added beside others takes the models its own list has
Young on Discord: a provider of several keys, each of a relay group that serves some of its models, had every key added or imported allow every model, so the user narrowed each by hand, and requests went to a key that can't serve the model. A key added now (GUI Add key, Import keys, several keys pasted in the provider's key field, and Import local configurations, CC Switch's entries folded into one provider included) is asked for its own /models, with that key alone, within the add's 8s wait and beside the provider's own Fetch. What it answers becomes its AccountModels when it leaves out a model the provider's other keys serve. Only a new key with no models of its own is given a list: the keys a provider had keep theirs (none, or the user's), and a pick the user makes while the list is asked is kept. A key whose list can't be told keeps every model, as before, and no empty list is written: a refused key, an empty list, one past the wait, a base that didn't answer (its part would be the provider's old list), a vendor with no list (Preset.NoList, plan-only presets, Cline and Kilo's feeds), a provider of one key, and a key that lists every model the others do (a list would only hold back what the vendor adds later). The CLI has no key add (`provider key` replaces the key), so it is unchanged. Run on mote at the pushed head (on origin/main |