The Providers page asks ModelAPI of each model of every provider's list,
and it listed the protocols the provider speaks (Speaks, a new slice)
each time, though it needs only whether there are two, and most models
have no API set at all. With real accounts that was 12 MB of what forty
polls allocated. ModelAPI now looks up the API set for the model first
(apiSet) and, only with one set, counts the protocols up to two;
apisAmong passes the count of the list it already has. The answer is
the same.
Run on mote at this tree (on 7087d92a0, the previous commit before it
was picked): gofmt, go vet (darwin, windows, linux) of internal/provider
and gui ok; TestModelAPIListsNoProtocols, TestNoAPIFindsTheProvidersAPIsOnce
and TestClaudeSignedOutKeepsWhatItParsed alone 3/3 ok; broken by hand
(Speaks listed again in ModelAPI) it fails "ModelAPI allocated 112
bytes, listing the protocols 112"; go test ./internal/provider ok
(130.3s); go test ./internal/gui fails only TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949), as on the run before this
change.
Real accounts, sandbox HOME, 40 polls (abr.sh), against the v0.1.2496
build: Provider.ModelAPI and Speaks gone from the profile (12 MB
before); /api/state and the drift reply byte-identical. Footprint peak
136 MB (was 134-141).