Files
magpie/docs
yetone 80dcd34729 codex: connect Codex through codex -p magpie alone (hpnjstar on X)
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).
2026-11-12 10:10:28 +08:00
..