Goose's model field asked ownOptions each poll, for the picker and again
for Drift, and each provider's models were made into options anew
(catalog.Provider, options, group, its icon): ownOptionsFrom was 21.2 MB
of forty polls with real accounts. For agents without a registry of
their own (native == nil), each provider's options are now kept in
ownBuilt per provider.StampNow (a minute at most) and copied into the
caller's list; Pi's and omp's, which read their own registries, are
built as before (ownProvider is the old loop body).
TestOwnOptionsKept: a catalog of 200 OpenAI models; asking again takes a
fifth or less of the allocations building does, a caller's write doesn't
reach what is kept, and a model the catalog lists since is offered.
Run on mote at c1457f2ee plus this commit and the next one (Goose's own
options kept), together:
- gofmt; go vet darwin, windows, linux: ok
- TestClaudeViaMagpieKept and TestOwnOptionsKept alone 3/3 ok
- go test ./internal/agent -timeout 45m: ok (267.7s)
- real accounts, sandbox HOME, network blocked, 40 polls, both commits
against c1457f2ee: state and drift answers byte for byte the same;
footprint peak 134 MB, RSS at end 177 MB
- broken by hand (ownOptionsFrom builds each time): red, "took 211
allocations, building them 202"
- ownOptionsFrom 21.2 -> 7.0 MB, gooseIn.func10 28.9 -> 16.0 MB; Picks
134 -> 118 MB with the commit before
Not run: the GUI suite (no GUI file changed), Windows and Linux test runs.
Picked onto ef63ef4a2 (with ef63ef4a2, Codex's subagent models kept, and gateway, redact and GUI commits; none in internal/agent); not run again there.