ccdcn on X: in the Codex app, the models of a provider they added
(XJAI's model-code, model-work, model-test) had no reasoning effort to
pick, though the chip said 中. Nothing magpie reads knows those ids, so
their entries in magpie-models.json (and /v1/codex/models) had
supported_reasoning_levels [] and default_reasoning_level null. Codex
then hides the choice but still sends an effort (medium, or
model_reasoning_effort), and the gateway's fitEffort passes an effort on
as asked when a model's levels are unknown, so the effort went out and
couldn't be changed.
provider.CodexEfforts offers low, medium and high for a model whose
levels are wholly unknown. It is used by codexListed (GET
/v1/codex/models, the backend list, spawn models) and by
agent.magpieModels("codex") (the file Codex reads, and magpie's own
Codex effort control). A model known to have no levels keeps none: one
the vendor's catalog or models.dev lists (any provider, any spelling),
one the user marked as taking no reasoning ask, a vendor entry in
Codex's shape, and a routing group.
TestCodexDesktopEfforts' "user's own" now expects medium added to the
user's enabled-reasoning-efforts: its fixture's fake/m1 is such a model.
Run (on mote):
- go test -timeout 45m -count=1 ./internal/provider ./internal/agent
./internal/codexcat: ok
- go test -timeout 45m -count=1 ./internal/gateway ./internal/gui:
gateway ok (615s); gui red only in 10 real-window AppKit tests
(dock, panel, tray, main window), each killed at its deadline. Four of
them run alone on origin/main 024393fbb fail the same way on mote:
#4125 (mote's AppKit/launchd hang). Not run on another Mac.
- GOOS=linux / GOOS=windows go vet ./internal/provider ./internal/agent
./internal/gateway: ok; gofmt -l clean
The runs above were at base d99e213f5. Rebased on 024393fbb, which
changed internal/gateway only; at this head the new tests and every
TestCodex.*Effort test in provider, agent and gateway pass again.
Broken by hand: with codex_models.go and route.go stashed, the new
TestCodexOffersLevelsForUnknownModels and
TestCodexCatalogOffersUnknownModelsLevels fail (offered []).
TestCodexPickedEffortReachesUnknownModel checks each offered level
reaches the vendor as reasoning_effort.
Real Codex: codex-cli 0.165.0 app-server (sandbox CODEX_HOME), model/list
on the catalog codexcat writes for xjai/model-test: before,
supportedReasoningEfforts [] / default none; after, low, medium, high /
default medium.
Not tried: the Codex desktop app with a real XJAI vendor. Not changed:
other agents (OpenCode variants etc.), which send no effort for such a
model today, and groups whose members are all unknown.
#2127: a routing group Dash (over the LAN share) could run at High or Max
showed in the Codex app at High, with no effort control. Its catalog entry
lists high and max, as /v1/models does for Dash, but the Codex app offers
a model only the efforts in [desktop] enabled-reasoning-efforts, whose
default leaves max out. magpie adds the efforts its models take there
(codexEnableEfforts, #310), but on a sync only through settle, which ran
only when config.toml's model was one of magpie's. With the config on
Codex's own model (the app's last pick), the group's levels arriving
later (8c5190a20 in v0.1.1234, any catalog change) rewrote the catalog
with high and max and left the app offering high alone.
Codex's Sync now adds the missing efforts whenever Codex is routed through
magpie, whatever model the config is on. The user's entries, order and
comments stay; an inline [desktop] is still left alone; a Codex not routed
is unchanged.
Test: TestCodexDesktopEffortsFollowTheCatalog connects Codex to a model
with no levels, writes model = "gpt-5.5" as the app does, then adds a
group of glm-5.3 (low/high/max) and deepseek-v4 (high/max), checks its
levels are high,max, and syncs: max must be enabled and the app's pick
kept. Broken by hand: with the new Sync lines removed (the old code) it
fails with no [desktop] written at all.
Run (worktree on origin/main 35aa50cfb, shared GOCACHE): gofmt -l clean;
go vet -tags nogui ./internal/agent on darwin, GOOS=linux and
GOOS=windows clean; go test -tags nogui -p 1 -run Codex ./internal/agent
ok; go test -tags nogui -p 1 -count=1 -timeout 40m ./internal/agent ok
(1038s; the default 10m timeout cuts this package short at -p 1)
Not tried: a real Codex app session against the reporter's group (their
config.toml isn't known; the reply asks for its [desktop] line).
Full suite: SUITE_LINE