Files
magpie/internal
yetone 2fa79aef35 provider: a save of the bytes the file already holds changes nothing (#6289) (KdhsiiKshshhs on X)
writeLogins and writePrivate rewrote logins.json with identical bytes, which
moved its mtime and called filememo.Forget, so every read after parsed the
230 KB file again (anton1615 measured 182 reads in 15 s, CPU 3.3x after each
write). Now a file that holds exactly these bytes, at the mode the write
would give it, is left alone: no lastgood generation, no rename, no Forget.
A stat or read that fails is "not equal" and writes as before. Real changes
keep steady.WriteFile's temp-and-rename. The same check is in writePrivate,
writePrivateQuiet and (writeChanged) the sibling writers of codex-autoreset,
codex resets-used and Kiro's token file.

Nothing else bumped the mtime in the reporter's path: the other writers of
logins.json (rememberLogins, Claude/Codex sign-in syncs) all go through
writeLogins. Changed() still runs on a told save, so a list built before it
is not reused (TestLoginsListedOnceARequest unchanged).

Run on mote: TestUnchangedLoginsSaveKeepsFileAndParse and
TestWritePrivateSameBytesLeavesFile, -count=20 green; both red with
fileHolds forced to return false (mtime moved). gofmt clean; go vet on
darwin, linux nogui, windows nogui; go test -tags nogui ./internal/provider
./internal/filememo ./internal/lastgood (result below in the push notes).
Not tried: the reporter's 130-account gateway; the full suite before the tag.
2026-11-13 01:18:47 +08:00
..
…
…
…
…
…
2026-11-11 08:14:28 +08:00
…
…
…