1ccacad63281094de8a3372d5a507d38f9969e5c
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
77aabb9a46 |
agent, codexcat: the effort new sessions are set to lasts a switch of model in Codex, Claude Code and Grok Build, at the model's nearest level where it lacks it (Creat.wu on Discord)
Creat.wu set magpie's "New sessions" effort to the highest level. A new
session started at it, but picking another model (a routing group) dropped
the effort back to the model's default.
Codex: on a switch, the TUI's /model highlights and saves the picked model's
preset default_reasoning_effort. The desktop app keeps the current effort only
if the new model lists it, and otherwise uses defaultReasoningEffort. Both come
from magpie's catalog default_reasoning_level, which codexcat.DefaultEffort
always set to the middle level. A group's levels are the intersection of its
members' levels, so a group often lacks xhigh or max.
- The catalog default is now codexcat.ModelDefault: the model_reasoning_effort
set in config.toml when the model takes it. Otherwise it is the model's
nearest level (catalog.NearestEffort: by rank, a tie going up, never
"none"), so xhigh on low/high/max gives max. When the effort is left at
Default, the default is still the middle of the road.
- This covers both magpie-models.json and the list the gateway hands a
signed-in Codex. The effort is now part of that list's tag, so Codex asks
for the list again.
- Setting the effort in magpie rewrites the list, or marks Codex's cached
list stale.
- An effort the model picked in magpie doesn't take now settles on the
nearest level, not the middle.
- The gateway's fitEffort uses the same NearestEffort.
Claude Code: Opus 5.5 and later read only
modelSettings.<model>.effortLevel. A level set while on one of them was
written only there, so a routing group or another vendor's model picked
afterwards (which reads the top effortLevel) started at its own default.
- The top effortLevel is now written too.
- A reset takes the top one out only when it is the level written beside
the model's own; a top level the user set themselves stays.
- max was already written to the env and applied to every model.
Grok Build: picking a model without the chosen default_reasoning_effort
deleted the key. It now keeps the model's nearest level.
Checked and not affected:
- WorkBuddy, ZCode, Kimi and MiniMax keep per-model levels (keptEffort).
- Qoder and Command Code keep one level for each model by their own design.
- AtomCode keeps one model table each.
What was run:
- Real codex 0.162.1, `codex debug models` with CODEX_HOME in the
scratchpad, on a catalog from CatalogAt(..., "xhigh"). It renders
default_reasoning_level max for low/high/max, high for a low/medium/high
group and xhigh for a model that has xhigh.
- New tests TestCodex/Grok/ClaudeNewSessionEffortLastsModelSwitch,
TestNearestEffort and TestModelDefault. The three agent tests, plus the
updated TestCodexCustomProviderModelHasEfforts and
TestClaudeEffortModelSettings, fail on the old code: the source files were
checked out from the parent with the tests kept.
- gofmt -l is clean. go vet -tags nogui ./internal/... passes for GOOS
darwin, linux and windows.
- go test -tags nogui: internal/agent, catalog, codexcat and provider pass in
full before the rebase.
- In gateway, only TestOTelWaterfallIncludesUnbilledFallback failed. The
root span was in a second export, which is #1794, fixed on main by
|
||
|
|
5aca7d0924 |
codex: effort left at Default stays Default and says the level Codex takes then ("default (medium)"), and isn't written over with medium when a model is picked or the catalog synced (lgtm on Discord)
lgtm set Codex · WSL Ubuntu's 推理强度 to 默认 and it came back as 中.
Two things did that, on every platform (the WSL row is the same codexIn
code as the local one):
- The effort field's Get answered an unset model_reasoning_effort on a
magpie model with codexcat.DefaultEffort (medium), so right after the
pick the slider and the row read 中, not 默认.
- settle() counted an unset effort as one the model doesn't take and
wrote DefaultEffort into config.toml: on every Sync for a magpie
model, on Join, and on a model pick, Codex's own models included. So
Default was pinned as medium, and on Codex's own models whose default
is low (gpt-6.1-sol, gpt-6-astra, gpt-5.6-sol in 0.162's models.json)
magpie overrode Codex's own default.
With model_reasoning_effort unset, Codex takes the catalog entry's
default_reasoning_level (core/src/client.rs build_reasoning). Checked
for real with codex-cli 0.162.0 in a sandbox CODEX_HOME: a
model_catalog_json entry with default_reasoning_level "low" and no
model_reasoning_effort sent {"reasoning":{"effort":"low"}} to a stand-in
Responses endpoint.
Now settle replaces only a set effort the model doesn't take, Get
returns the unset value, and the effort control's options start with
Default carrying Takes: the level Codex then takes, from the entry it
reads (codexcat.TakesEffort: Codex's own models_cache entry for its
models and a ChatGPT account's codex/ ones, else the one Entries writes).
The GUI shows it as "default (medium)" / 默认(中) / 預設(中) /
デフォルト(中) / Standard (mittel). A stopped WSL distro's options get the
same Default (codexEfforts).
Tests: TestCodexDefaultEffortStaysDefault fails on the old settle
("Default written over: model_reasoning_effort = \"high\"", "Default
shows as \"high\"") and passes now. TestCodexCustomProviderModelHasEfforts
now expects Default first with Takes "high" and an unset value read as
"". codex-default-effort.test.cjs (window at 560 and 360px, tray panel;
en, zh, ja, de; Chromium and WebKit) fails on the old effortName and
passes now.
Run: gofmt -l (clean); go vet -tags nogui on darwin, GOOS=linux and
GOOS=windows for ./internal/agent ./internal/codexcat ./internal/gui
./internal/tui and the main package; go test -tags nogui of those and
./internal/catalog under a scratch HOME (all ok); the GUI effort, gui-ja,
gui-de, gui-zh-tw and i18n-keys tests (all pass), and the whole GUI suite
in both engines: 4711 pass, 8 fail, all in library-servers-bulk
(chromium, ".lib-everyon moved from 290 to 288") and purpose-filter
(webkit), which fail the same way run alone on origin/main
|
||
|
|
d6784bd114 | codex: a model a custom provider serves takes the reasoning levels models.dev gives it from the others serving it, so the Codex app offers an effort for it (a Volcengine endpoint's glm-5.3-flash showed 中 with nothing to pick, and magpie's effort control a "none" Codex never used) — levels were only taken from models.dev's entry for the vendor itself, and a vendor it doesn't list (a custom provider, a proxy) had none, so Codex's catalog carried no supported_reasoning_levels; a model models.dev doesn't list for its vendor now takes, by bare id as the context window is found, the levels most of the providers giving any give it (glm-5.3-flash: low, high, max, default high), one no one gives levels for keeps none. Codex's effort is settled on one the model takes when a model is picked and when the catalog is synced, magpie shows the catalog's default where none is set, and the gateway sends a Chat vendor reasoning_effort at the model's nearest level (Codex's medium goes to glm-5.3-flash as high), as asked where the model's are not known |