From a786c51cb01efc76bca1fb7c0e243ceb8201519e Mon Sep 17 00:00:00 2001 From: ggbdpq Date: Thu, 15 Oct 2026 22:22:08 +0800 Subject: [PATCH] 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-