Files
magpie/internal/codexcat
yetone 71075af726 codex: "subagents on any model" tells Codex V1 for a relay of the ChatGPT backend too (brethhbbm on X)
brethhbbm on X: lead on relay/gpt-6-astra, subagent model set to
relay/gpt-6.1-terra, "Codex subagents on any model" on. A new session's
subagents still ran on Astra, and Routing said the task was sealed and
only a ChatGPT account could read it. The model's catalog entry still
said multi_agent_version "v2".

Cause: the setting (settings.CodexAgentsV1) stamped V1 only on the
ChatGPT account's own models (codex/) and the groups one is in (Fast).
The relay lists Codex's own entry for gpt-6-astra (a sub2api asked with
Codex's client_version), "v2" included, and a relay offering Ultra is
given "v2" (AgentsV2) besides. In V2 Codex hands the lead the
collaboration namespace (spawn_agent etc.), whose arguments a relay of
the ChatGPT backend seals as the backend does (#1109), so
codexSubagentPick kept the subagent on the lead's model (sealedKept).

Fix: catalog.Model.Seals (provider.CodexSeals) marks a model whose
provider is of no sign-in on the Responses API, as the gateway's
canSeal, or a group with such a member. With the setting on, its entry
says V1 like the ChatGPT account's, listed by its relay or made by
magpie, so the task goes as text and the model set for subagents takes
it. Seals is in the list's tag, so Codex asks for the list again. A
model of an account that seals nothing (Copilot's Ultra, #656) keeps
V2, and with the setting off every entry is as before. No prompt text
or instructions change.

Real Codex (0.165.0, sandbox HOME/CODEX_HOME, fake Responses server,
model_catalog_json with the user's gpt-6-astra entry as
relay/gpt-6-astra): with "v2" the first request carries the
collaboration namespace (spawn_agent, send_message, followup_task,
wait_agent, ...); with "v1" it has none.

Run (Linux box via wsl-run; mote refused SSH for the whole session):
- go vet -tags nogui (linux), GOOS=windows go vet, GOOS=darwin
  CGO_ENABLED=0 go vet -tags nogui on codexcat, provider, agent,
  catalog, settings: ok; gofmt -l clean
- go test -tags nogui -count=1 ./internal/codexcat ./internal/catalog
  ./internal/settings ./internal/provider: ok
- ./internal/agent, and -run 'Codex|Ultra|Subagent|Sealed|Collab|AgentsV1'
  ./internal/gateway, were still running when this was pushed; their
  results go on the release's issue thread if red
- at the pushed head (rebased on c2c2c82ca), Windows box: go vet on the
  five packages, and -run 'CodexSeals|CodexAgentsV1|Ultra' codexcat and
  provider: ok
- earlier on mote: -run 'CodexSeals|CodexAgentsV1|Ultra|CodexListed|Listed'
  ./internal/codexcat ./internal/provider: ok

Broken by hand: dropping m.Seals from both V1 conditions in codexcat
makes TestCodexAgentsV1SealingRelay red ("on: map[... relay/gpt-6-astra:v2]");
CodexSeals setting false makes TestCodexSeals red ("relay/gpt-6-astra:
Seals false, want true").

Tests: TestCodexAgentsV1SealingRelay (a relay's listed v2 entry and a
made Ultra entry say v1 with the setting, Copilot's keeps v2, all as
before with it off), TestCodexSeals.

Not tried: a real relay of the ChatGPT backend end to end with a real
subagent spawn; Codex 0.165 exec showed no V1 spawn tools in its first
request (they are deferred), so the V1 side was checked by the
collaboration namespace being gone. No GUI is reachable from this
change. A thread started before keeps the version it started with; a
new session is needed.
2026-11-10 21:05:34 +08:00
..
test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass.
2026-10-01 23:15:07 +08:00