Files
magpie/docs
ggbdpq a786c51cb0 agent: a magpie-models.json that doesn't parse is kept aside, not written over or removed whole
What changed: #2263 gave magpie's state files whose reader takes an
unparseable file as empty the lastgood.KeepUnparsed copy-aside, and its
sweep named the files it covered. Codex's magpie-models.json was in
neither its covered list nor its cache exemption, and its reader has the
exact missed shape: codexcat.Keep (#1450) returns the new list for a
file it can't parse, and the next sync, model switch or stepping back in
wrote that over the file, ending the keys the user added by hand
(supports_reasoning_summaries and friends) with no copy. Stepping out
was worse: dropList took an unparseable file for one holding nothing of
the user's and removed it outright.

Now the three writers of the list go through writeOwnList, which keeps
an unparsed file aside (magpie-models.json.bad-<time>) before the write
and stops when the copy can't be made, and dropList keeps one aside
before it removes the file.

Run:
- gofmt -l internal/agent: clean.
- go test -tags nogui -p 2 -count=1 -timeout 25m ./internal/agent: ok
  (183s).
- TestUnparsedCodexCatalogKeptAside fails on the code before this ("the
  unparsed list was written over with no copy kept"); the ablation
  replays it against this commit's parent.
- go vet -tags nogui ./... for darwin, linux and windows ok; go build
  for the three ok (reviewer, at the batch head).
Full suite: go test -tags nogui -count=1 -timeout 45m ./... ok, every
  package (reviewer, at the batch head before #2424 was added).

Generated-by: GLM-5.3-Flash (ZCode)
2026-10-16 00:16:43 +08:00
..