DecidesModel answered for a remote magpie, and for a provider that lists
its decision models (OpenRouter's), by building decideListed's whole
list (catalog.Live copies every chat model) and scanning it. Every model
of such a provider is asked this from available(), pluginDecisions and
the decider list, so a list of n models was copied n times per look:
0.43 GB of the 4.1 GB a real config allocated over 20 polls of
/api/drift, /api/state and /api/providers (v0.1.2430,
DecidesModel -> decideListed -> catalog.Live -> catalog.Chat).
It now looks the model up in the list as kept (catalog.LiveByID, which
readLive indexes once per read), and catalog.LiveListed says whether the
list has any model, for the Jev fallback decideListed has. The answers
are decideListed's: a remote magpie's models its list marks Decides; a
listed decision list's models; with none listed, OpenRouter's Jev unless
the server marks its own.
TestDecidesModelCopiesNoList: 2000 decision models, each ask under a
twentieth of the list's bytes, for both kinds, and the answers above.
Red on the old code (an ask 869,336 bytes, the list 869,829).
Run at 6a900e0d0 plus this change, on mote: go vet (darwin, windows, linux)
and gofmt of internal/provider and internal/catalog clean;
go test -count=1 -timeout 45m ./internal/provider ./internal/catalog
./internal/agent ./internal/gateway all ok (126s, 0.6s, 612s, 1305s).