What was wrong: every write of ~/.codex/magpie-models.json rendered the
catalog from magpie's models alone, so a key the user had put into an
entry was gone after the next model switch, catalog sync (Refresh, a
provider added, a gateway start) or a switch to Codex's own default,
which also deleted the file outright. The key heng91 added,
supports_reasoning_summaries, is one Codex before 0.145 needs: its
client.rs build_reasoning sends no `reasoning` (no effort, no summary,
so no thinking shown) for a model whose entry doesn't say true, until
openai/codex#32206 (first in 0.145). 0.144 also refuses to load a
catalog an entry of which lacks the key at all.
What changed:
- codexcat: every entry says supports_reasoning_summaries, true for a
model with effort levels, false otherwise. Later Codex ignore it.
- codexcat.Keep: before a write, the keys of an entry on disk magpie
doesn't write are carried over to the entry of the same slug, and a
true of supports_reasoning_summaries stays over magpie's false. A key
magpie writes keeps magpie's value; a model magpie no longer serves
drops out; an unreadable file keeps nothing.
- agent/codex.go: the write when magpie becomes the provider and the
catalog sync go through Keep; the three places that removed the file
remove it only when nothing of the user's is in it.
Run:
- New tests TestCodexCatalogKeepsWhatTheUserAdded,
TestCodexCatalogRemovedWhenNothingAdded (agent, from the file magpie
writes, edited by hand) and TestCodexCatalogReasoningSummaries,
TestKeepUserKeys (codexcat). Each fails on origin/main's code.
- Real Codex in a sandbox CODEX_HOME against a capture server:
0.144.0 fails to load the old catalog ("missing field
supports_reasoning_summaries"), loads the new one and sends
reasoning {effort: high, summary: auto}; with the user's keys kept
it sends summary "detailed". 0.162.0 loads both and sends the same.
- gofmt -l clean; go vet, GOOS=linux and GOOS=windows go vet of
./internal/agent ./internal/codexcat; linux and windows builds;
go test -tags nogui ./... under a temp HOME, all ok.