Saving a profile (+ Save current, magpie save, the TUI) now keeps, beside
every detected agent's fields and the library, the agent's model list as
the Agents page's Pick sets it: the models taken out one by one
(hiddenModels), or "only the models I pick" and those picks
(pickedModels), the order put on them (orderedModels), and the
visibility `magpie visible` narrows it to (visible). It is kept under the
id the lists are kept by (agent.ListsFor), in profiles.json under a
"models" key beside "library". Applying a profile puts each list back
exactly (provider.SetModelLists: one settings write, renamed providers'
ids followed), then the fields, so the model is set last over the list;
the lists are written once through catalog.Touched, the same path a pick
made by hand takes, so Codex's magpie-models.json and the other agents'
model files are rewritten. A list that changed counts in "N settings
changed".
Left out on purpose: fastPicks (how a model is sent, not whether it is
listed, and it stays with the model) and agentEfforts (Cursor Private
Inference's effort is already an agent field a profile keeps).
A profile saved before this has no "models": it is read with none, leaves
every agent's list as it is (unknown, not empty), and is written back
byte for byte. An agent a new profile doesn't name keeps its list too.
A profile's details show a Model list line per agent: "8 hidden", "only
the 3 picked" or "every model shown", in all five languages.
Verified:
- internal/profile TestProfileSwitchesModelList: three profiles (two
hidden; all shown with an order; only-picked), each applied rewrites
settings and Codex's magpie-models.json to that list. Fails with Apply's
list step removed ("applying home changed nothing", the hidden list
not restored) and with catalog.Touched taken out of SetModelLists
(Codex's file keeps the old list).
- TestOldProfileKeepsModelList: an old profile keeps codex's hidden and
claude's only-picked, writes back unchanged; one naming only codex's
list leaves claude's. Fails when a missing "models" is read as empty.
- The built nogui binary in a sandbox HOME (env -i): magpie save home /
save work / use home / use work switched Codex's magpie-models.json
between m1 and m1-m3.
- profile-details.test.cjs (en, zh window and panel, zh-TW, ja, de) in
Chromium and WebKit; fails without the app.js line. With
profile-confirm, panel-profiles, gui-ja, gui-de, gui-zh-tw, i18n-keys
and click-scroll: 38/38 in each engine.
- gofmt -l clean; go vet (darwin), GOOS=linux go vet -tags nogui,
GOOS=windows go vet on profile, provider, gui; go build, linux nogui
and windows builds; go test -tags nogui ./... under a temp HOME, all ok.
Not tried in the real window with a live gateway.