canlee886 on X (2122660479411855365): a Codex App thread saved on
group/auto-gpt-6-1-sol failed every turn with 404 "magpie knows no
model", followed by every id magpie has, after azure-fte2-sea's
gpt-6.1-sol went away; other threads were fine, and switching the
thread's model did not help. The user patched the thread over Codex's
app-server RPC.
Cause: a group magpie finds needs two providers serving the model
(autoGroups). When one is removed, or its list no longer has the model,
the group is gone. Reseat moves an agent's config off it, but a Codex
thread keeps the model it was saved with and names it on every turn.
provider.AutoStandIn sent a gone found group's id to its model only
while found groups were off, or when a provider kept out of them took
it away; any other way of losing the group was a hard 404, even with a
provider still serving the very same model.
Fix:
- AutoStandInFor: with found groups on, a found group's id (group/auto-…
or auto/<model>) that is no group now, and that the user neither
changed nor removed (no providers.json record), goes to its model from
a provider that serves it (the agent's own subscription first, then
one not kept out, then the first). It is the same model, never
another; a group the user removed stays a 404.
- With no provider serving the model, the request is still 404, but
unknownModel says the model is gone and to pick another for the
conversation (Codex: the model menu under the message box), with the
three nearest ids, not every id (provider.GoneAutoGroup).
- Codex's compaction on the model a thread is leaving
(model_downshift) already compacts locally when that model 404s
(2768f04f9); TestCodexLeavingGoneGroupCompactsLocally pins it for a
gone group.
- docs/subsystems/gateway-routing.md says when a found group can go and
what a request for it gets.
Siblings: the stand-in is in serve's model resolution, so Claude Code
and every other agent saving the id are covered, as are key limits,
count_tokens, budget and Codex's own-v1 path, which already ask
AutoStandIn.
Run (mica/mote via mica-run/mote-run, at this tree):
- TestFoundGroupGoneGoesToItsModel: red on the old code (404 "magpie
knows no model ... it has ..." with b still serving gpt-6.1-sol),
green now. TestAutoGroupSkip's "group/auto-y" case (b's model alone)
now expects the stand-in b/y; group/auto-nothing still none.
- go test ./internal/provider, ./internal/gateway -run of the
group/stand-in/Codex compaction tests: ok.
- Full suite at 473de21fa (this change on fefe3f658's parent base) on
mote, mote-run: gofmt -l nothing; GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., go vet ./...: ok. go test -timeout 45m
-count=1 ./...: 101 packages ok, internal/gateway (1035s), agent,
provider, gui, cli, budget among them. Two reds, neither touched here:
internal/plugin's TestHostOnUnstartableBunSaysWhy (62s deadline, #5878)
and internal/redact, whose tests passed and whose TestMain then hung
46m in testenv.RemovePrograms on stand-in warm-ups (#5267, SIGQUIT at
47m); both commented with the output.
- After the rebase onto origin/main (fefe3f658, which changed
internal/provider/bare.go and internal/gateway), on mica: gofmt -l
internal nothing; go test ./internal/provider ./internal/gateway: ok
(149s, 1004s). On mote: ./internal/plugin ./internal/redact alone: ok.
- Rebased again onto 05d46f42e (gateway advisor, agy move; no file
shared): go vet and go test -run
"FoundGroup|Gone|AutoGroup|StandIn|Advisor|Unknown|Compact|Group" of
./internal/gateway ./internal/provider on mote: ok.
Not tried: the reporter's real Codex App thread and Azure providers;
the fixture removes the model from a provider's list rather than
reproducing why azure-fte2-sea's list lost it.