Repository navigation
Conversation
Clients that hardcode OpenAI's "minimal" or "none" got a 400 from the chat request path, which validates through the same normalizer as the live-settings POST. Cherry Studio's translate pane sends one on every call and exposes no effort picker, so the whole pane was unusable against a server whose vocabulary starts at "low". Map minimal/none/off/disable/disabled onto the lowest level. None of them can mean "no reasoning" here -- that is `reasoning: off` or chat_template_kwargs.enable_thinking -- and reasoning_effort can only answer with a level, so the lowest one is the closest available answer. The canonical vocabulary is unchanged and junk values still raise. The aliases only widen what arrives over the wire: argparse gates --reasoning-effort on REASONING_EFFORT_CHOICES and `mtplx config set` compares against the same tuple, so an alias never reaches either.
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, preserves the canonical vocabulary/contracts, and is covered by a targeted regression test for the new alias behavior.
Pull request overview
This PR updates MTPLX’s shared reasoning_effort normalizer to accept several OpenAI client “off-ish” reasoning_effort values (e.g., none, minimal) by mapping them to the lowest supported effort level instead of returning a 400, improving compatibility with clients that hardcode these values.
Changes:
- Add an alias map in
normalize_reasoning_effortto coerceminimal/none/off/disable/disabledto the lowest effort level. - Add a regression test covering alias mapping (including case/whitespace variants) while preserving existing behavior for canonical values and junk inputs.
File summaries
| File | Description |
|---|---|
| tests/test_qwen38_family.py | Adds a new test ensuring OpenAI “off-ish” reasoning_effort values normalize to the lowest supported level and invalid values still raise. |
| mtplx/reasoning_effort.py | Introduces _OPENAI_EFFORT_ALIASES and applies it during normalization without changing the canonical REASONING_EFFORT_CHOICES vocabulary. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…from PR #433 by sypsyp97 minimal / none / off / disable / disabled map onto the lowest reasoning level in normalize_reasoning_effort, the one place the request path and the live-settings POST share. Clients that hardcode OpenAI's values (Cherry Studio's translate pane sends one on every call with no effort picker) stop receiving 400s. Junk values still raise; the canonical vocabulary, the CLI argparse choices and mtplx config set are unchanged. Deliberately not wired to reasoning-off: an effort level request must not silently disable thinking. Technique credit: sypsyp97 (PR #433) Verification here: tests/test_qwen38_family.py, tests/test_openai_bridge.py, tests/test_public_cli.py pass on the port branch (outputs/pr433-port-tests.log, rc 0).
Flash-Next speed lane on by default (PR #391 restack by davidtai, ported with his authorship), K2 flash-decoding verify route on in turbo for the 27B, copy-lane streaming fixed at the engine (server release pacer) and app (typewriter pacer) layers, per-request memory gate for the fixed-M4 lane, Route Tape fixes, fixes for #441 (Anthropic image blocks), #427 (--allow-swap), #420 (ar_batch cache-family guard), #436 (client cap diagnostics), #433 port (sypsyp97), #423 opt-in Steel sparse-GQA prefill (Thanh Pham), light appearance for the app (#428), the app in twelve languages, and the 2.11.1 stamps. Gates on the merged tree fa19b873: pytest 5,615 passed / 31 skipped / 0 failed; Swift 746 tests, 0 failures, 1 skipped; eleven translation tables validated key-for-key; bundle 2.11.1 (2011001) built, installed and driven in light mode.
|
Merged for 2.11.1 with your authorship (commit f47199f): the off-ish |
|
Thanks for the merge! |
Summary
A client that hardcodes OpenAI's
reasoning_effort: "minimal"or"none"gets a 400 out of the chat request path. Cherry Studio's translate pane sends one on every call and exposes no effort picker, so the entire pane is unusable against MTPLX — reproduced against 2.11.0:This maps
minimal/none/off/disable/disabledonto the lowest level innormalize_reasoning_effort, the one place the request path and the live-settings POST share.None of those values can mean "no reasoning" on this server — that is
reasoning: offorchat_template_kwargs.enable_thinking— andreasoning_effortcan only answer with a level, so the lowest one is the closest available answer rather than a rejected request. Deliberately not wired to reasoning-off, because a client asking for an effort level should not have thinking silently disabled underneath it.Scope is narrow by construction:
REASONING_EFFORT_CHOICESis untouched, so every family'seffort_levelscontract and the app's picker are unchanged."banana"→ 400).--reasoning-effortis gated by argparsechoices=REASONING_EFFORT_CHOICESandmtplx config setcompares against the same tuple, so an alias cannot reach either surface.I left CHANGELOG.md alone since entries there look maintainer-written at release time; happy to add one in whatever wording you prefer.
Verification
macOS 15.6 (arm64), Python 3.12.13, this branch installed with
-e ".[dev,server]".New test
test_normalize_reasoning_effort_maps_openai_off_valuescovers the five aliases plus case and whitespace variants, asserts every canonical choice still round-trips, and asserts junk still raises.End to end on a live server (Qwen3.8-27B-UD-Q4_K_XL, one M5 Pro,
--profile turbo --reasoning on --reasoning-effort xhigh):minimal,none,off,disableall return 200 after the change andbananastill returns 400.Benchmark Evidence
No runtime performance change: the added lookup is one dict
geton the request-validation path, before generation.