Commit Graph
1 Commits
Author SHA1 Message Date
yetone a9667daad5 codex: CC Switch's OpenAI mirror's threads follow OpenAI, and OpenAI's follow the mirror
Chris on Discord (the Codex app on a Mac): "Model provider mismatch.
This chat uses OpenAI, but your current provider is OpenAI. Switch to
OpenAI to continue." The Codex app names a provider by its table's
name. CC Switch's OpenAI mirror ([model_providers.custom], name
"OpenAI", requires_openai_auth, no base_url) is named OpenAI as the
built-in openai is, and Codex up to 0.167 resumes a thread only on the
provider id it is on now (app-server config_manager.rs load_for_resume
and check_thread_model_provider_for_input: ModelProviderMismatch;
0.168.0-alpha drops that check). magpie left the mirror out of every
thread move: bringBeside skipped it as the provider it took down,
lendOwn skipped it at the top, and bringOfficial took only
cc-switch-official. So a thread on the mirror stayed refused with Codex
on OpenAI beside magpie, and OpenAI's threads with Codex on the mirror.

Both are the ChatGPT account's threads, so they follow whichever of the
two Codex is on:
- bringOfficial moves every mirror table's threads to the provider
  Codex is on with magpie (openai or magpie), unless the mirror is at
  the top, a profile names it, or it is the provider magpie took down
  (stash codex.provider);
- bringBeside takes that one, recorded, and giveBeside gives its
  threads back at the Disconnect that puts the mirror back on top;
- lendOwn moves OpenAI's threads to a mirror at the top, and giveLent
  back once Codex is on OpenAI.
Existing threads: each sync moves them, "custom" in place (OpenAI's
length), a paginated one by its row, any age; others' ids the last 30
days with a copy kept, as before. Config.toml and the provider ids
magpie writes are unchanged.

Run: real codex 0.167.0 in a sandbox CODEX_HOME, `codex exec resume`
of a thread on custom with Codex on openai: "This chat uses custom, but
your current provider is openai" (modelProviderMismatch), resumed past
the check after the relabel to openai; the reverse (custom at the top,
thread on openai) refused the same way.
mote (go 1.26.8): go test -count=1 ./internal/agent/ ./internal/sessions/
ok (408s, 58s); go vet ./internal/agent/ native, GOOS=windows, GOOS=linux
ok; gofmt -l clean.
Broken by hand: the three old exclusions back, all three new tests red
(thread left on custom / on openai); bringOfficial without the stash
skip, TestCodexMirrorAtTopJoinsWithItsThreads red (the mirror's thread
left on openai after the Disconnect).
Not tried: the Codex desktop app itself (not on any test box), and
Chris's config.toml wasn't seen, so which way round his threads were is
inferred from the two ids that name "OpenAI". A thread on a mirror with
a profile naming it stays; after the Disconnect, OpenAI's own threads
stay on OpenAI as before.

Reported-by: Chris (Discord)
2026-11-07 03:00:10 +08:00