Files
magpie/internal
ggbdpq e02bc8c49b fix(agent/codex): keep the user's model_provider over a takeover or reset (#4347)
What changed: the beside wiring of a Codex takeover took the top-level
model_provider down silently whenever a magpie model was picked beside
the ChatGPT sign-in — a provider of the user's (CC Switch's custom, an
older takeover's) went with it, and every Codex thread saved with that
provider stopped resuming (modelProviderMismatch: Codex falls back to
its built-in openai, the threads name the provider they were started
on, #4347). The wiring now steps beside only from a provider magpie
puts back itself (its own, none, CC Switch's mirror of OpenAI, as Join
already has it); over a provider of the user's the takeover names
magpie instead and keeps the user's spelling in the stash, for Unwire
to put back, as any takeover does. A reset leaves the line where the
user put it too: it takes magpie's keys out, not theirs.

Run: go test -tags nogui -run 'TestCodexTakeoverKeepsUserProvider|TestCodexResetKeepsUserProvider' ./internal/agent/ (both fail on the parent, pass here); go test -tags nogui ./internal/agent/ passes.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
..
…
…
…
…
…
…
…
…
…