TestProfileSwitchesModelList and TestOldProfileKeepsModelList failed on
Windows ("Codex lists []") and passed on macOS. Their fixture wrote
model_catalog_json = "C:/Users/.../.codex/magpie-models.json"
(filepath.ToSlash). On Windows, Codex's ownCatalog takes the list as
magpie's only when it is named "magpie-models.json" (what magpie writes
there since #816), by the native backslash path, or by a path relative to
config.toml. A forward-slash absolute path is none of these, so Sync never
wrote the list and the file stayed empty.
The guess in the issue, that sandbox() blanking APPDATA/LOCALAPPDATA makes
os.UserConfigDir fail and moves the provider or catalog elsewhere, is not
the cause. Built for windows/amd64 and run on the Windows 11 box:
- fixture fixed, APPDATA/LOCALAPPDATA still blanked: both PASS
- fixture unchanged, APPDATA/LOCALAPPDATA left set: both FAIL as reported
magpie's own files sit under ~/.config/magpie and Codex's under ~/.codex
(both from the home folder), so no product write depends on APPDATA here,
and nothing changes for real users.
The fixture now names the catalog as magpie does on each OS: the full
path (a TOML literal string) elsewhere, "magpie-models.json" on Windows.
Run: internal/profile test exe on the Windows box, whole package: before
FAIL (the two tests), after PASS. macOS: go test -tags nogui
./internal/profile/... ok. gofmt -l clean; GOOS=linux and GOOS=windows
go vet -tags nogui ./internal/profile clean.