Repository navigation
fix(command-code): preserve xhigh instead of rewriting it to max - #14929
Merged
diegosouzapw merged 2 commits intoSep 29, 2026
Conversation
Command Code's own validator advertises low|medium|high|xhigh|max (the quoted enum in the minimal mapping just above), so xhigh is a native and distinct tier there. The provider-wide isMaxTierTarget rule rewrote it to max unconditionally, which spent a different reasoning level than the caller asked for, and it also overwrote the nested reasoning.effort carrier that the Responses path reads. Command Code is removed from isMaxTierTarget. Everything else is unchanged: the model-level ceilings (GLM 5.1+, DeepSeek V4+, Kimi K3+) still map xhigh to max regardless of provider, as do the Ollama Cloud and OpenCode Go gateways, and OpenRouter still passes xhigh through. Unlisted models already preserved xhigh via supportsXHighEffort(); this early return was preempting that. Two tests encoded the old behaviour and are inverted to pin the new one. Three added cases bound the change: literal max still passes through, max-tier model families still collapse on command-code, and ollama-cloud is unchanged.
6 tasks done
diegosouzapw
merged commit Sep 29, 2026
1d84c47
into
cheaper-inference:release/v3.8.51
11 of 16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Command Code's validator advertises
low|medium|high|xhigh|max—xhighis a native and distinct tier. Butopen-sse/executors/base/reasoningEffort.tshad Command Code in itsisMaxTierTargetlist, which rewrotexhigh → maxunconditionally:writeEffortValuewrites to every carrier, so both top-levelreasoning_effortand the nestedreasoning.effortwere silently changed. Observed on the wire: a payload setting"reasoning": {"effort": "xhigh"}went upstream as"reasoning": {"effort": "max"}.Why it is wrong
expected one of "low"|"medium"|"high"|"xhigh"|"max"— which is the proof thatxhighis accepted.if (supportsXHigh) return body; // model accepts xhigh natively.supportsXHighEffort()defaults totruefor unlisted models, so the fix is to stop short-circuiting before it.The change
Command Code is removed from
isMaxTierTarget. Nothing else moves.command-code+xhigh, unlisted modelmaxxhighcommand-code+maxmaxmaxxhigh, any providermaxmaxollama-cloudoropencode-go+xhighmaxmaxopenrouter+xhighxhighxhighThe model-level ceilings are deliberately kept, because those families genuinely top out at
maxin their own native API.Tests
Two existing tests encoded the bug and are inverted to pin the fix:
command-code maps normalized xhigh back to maxbecomescommand-code preserves native xhigh on every carrier, asserting bothreasoning_effortand nestedreasoning.effortsurvive.xhigh → maxoncmd. It now assertsmaxonopencode-go(unchanged behaviour) andxhighoncommand-code.Three added cases bound the change so it cannot be over-applied: literal
maxstill passes through, max-tier model families still collapse oncommand-code, andollama-cloudis unchanged.Sweep: every unit test mentioning
xhighwas run — 123 suites, 1938 assertions passing.chatcore-translation-pathshas 3 failures (tests 2/64/72, none about effort) that are pre-existing — confirmed identical with this patch stashed. ESLint clean,open-sse-typecheck0 errors,check:file-sizeOK, complexity ratchets OK (2931/3218 and 1328/1437).open-sse/executors/base/reasoningEffort.tsis not in the Strykermutateset, so notap.testFilesregistration is needed.