80dcd3472's "applies to" field (All of Codex / codex -p magpie only) was
refused only while Codex was Wired(). Codex routed through magpie by
openai_base_url alone (beside its ChatGPT sign-in, or for failover) reads as
not wired, yet magpie keeps config.toml and its list there. Moving the choice
to the profile then made codexIn read magpie.config.toml (nothing in it): the
row showed disconnected, config.toml's wiring stayed behind unmanaged, and
Codex went on with its own default list, magpie's models gone from the picker.
The choice now also waits while Codex is Routed() or FailingOver(). Someone
already switched stays switched: disconnect, then choose All of Codex.
Run (mote): go test ./internal/agent ./internal/gui ok; gofmt clean; go vet
darwin, linux nogui, windows ok. TestCodexScopeWaitsForBaseURLRouteToo is red
with the guard back to Wired() alone (scope changed while Codex is routed),
green with it.
Not tried: a real Codex app, the GUI row in a live window; I could not
confirm the reporter's exact state, only that this path produces it. A cache
poisoned by a timed-out refresh (#6142) is a separate cause and not changed.
The Codex agent gets an "applies to" field: All of Codex (as before) or
"codex -p magpie only". In the second mode magpie writes
<CODEX_HOME>/magpie.config.toml (model_provider, model, effort,
model_catalog_json, its own [model_providers.magpie]) and a catalog beside
it, and never touches config.toml: its top-level model_provider, model and
openai_base_url stay the user's. Disconnect deletes that file and magpie's
catalog (kept if the user added to it). Plain `codex` keeps its own provider.
Codex 0.165 reads `--profile NAME` from NAME.config.toml and refuses -p while
config.toml holds a legacy [profiles.NAME] or profile = "NAME", so this is
the file form, not a [profiles.magpie] table. Codex without profile files
(older than the May 2026 removal of legacy profiles) isn't served in this
mode. The choice changes only while Codex is disconnected, so the two wirings
never share a config. Only magpie's models are offered in this mode; no
joining, failover or subagent fields.
Run (mote, at the rebased head): go test ./internal/agent ./internal/gui ok;
gofmt clean; go vet darwin, linux nogui, windows ok; GUI i18n-keys,
i18n-en-no-cjk, gui-zh-tw, codex-signin-always, agent-connect,
agent-disconnect in Chromium and WebKit. Real codex 0.165.0 in a sandbox
CODEX_HOME against a fake server: `codex -p magpie` sent one request
(Bearer magpie, model fake/m1); plain `codex` sent none; config.toml was
byte-identical after connect, effort change, sync and disconnect.
Broken by hand: letting scope change while connected turns two
TestCodexProfileOnly tests red.
Not tried: a real account, the Codex app, the GUI row in a live window, an
older Codex without profile files. gui-de and gui-ja "has every zh string"
are red on main without this change (#6234).