fix: drop sampling knobs for Claude 4.7+ and clamp xhigh on 4.6 - #42
Merged
Conversation
The Anthropic engine forwarded temperature, top_p and top_k whenever the gateway had not itself mapped a thinking request, which was right for Claude 4.6 and wrong for every later generation: Opus 4.7+, Sonnet 5, Opus 5 and the Fable family reject those parameters with a 400, and OpenAI-compatible clients send a temperature by default. The knobs are now dropped for the adaptive+summarized dialect regardless of thinking. map_thinking passed the client's effort through verbatim, so xhigh (new with Opus 4.7) reached Claude 4.6, which does not accept it; it clamps to high there. The live matrix gains a claude-opus-5 row with the effort tiers including xhigh, a temperature-carrying chat call and a native adaptive summarized stream, so the dialect every current Claude id resolves to has live coverage.
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.
Problem
claude_engine::build_bodykepttemperature/top_p(andtop_kvia raw extras) unless the gateway had itself mapped areasoningrequest intothinking. That gate models Claude 4.6, where sampling parameters are accepted until thinking is on. Every later generation — Opus 4.7/4.8, Sonnet 5, Opus 5, Fable 5/5.1 — rejects the three parameters outright with a 400, and OpenAI-compatible clients sendtemperatureby default, so a plain chat request toclaude-opus-5failed upstream.map_thinkingalso passed the client's effort through verbatim, soreasoning_effort: xhigh(introduced with Opus 4.7) or an OpenRouter-style budget ≥ 20480 reached Claude 4.6 asoutput_config.effort: xhigh, which 4.6 does not accept. The live matrix already knew (its 4.6 tiers omitxhigh), the engine did not.Change
AdaptiveSummarized(4.7+ and the 5 family), and still only after a thinking mapping onAdaptive(4.6); the ≤4.5 budget dialect keeps them.map_thinkingclampsxhigh → highon theAdaptivedialect only.docs/api.mdstates both rules;scripts/live-matrixgains aclaude-opus-5row with effort tiers includingxhigh, atemperature-carrying chat call and a nativeadaptive+summarizedstream, so the dialect every current Claude id resolves to has live coverage (none existed).Evidence
sampling_knobs_follow_the_model_generation(4.5 and 4.6 keep the knobs,claude-opus-5andclaude-fable-5-1drop all three) andxhigh_clamps_to_high_on_claude_4_6_only(effort and budget forms; 4.7+ keepsxhigh). Two integration tests that asserted the old passthrough onclaude-fable-5now assert the drop.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(workspace): green.python3 -m py_compileon the live matrix: clean. The new live cases need vendor keys and were not run here.Hot path: one
anthropic_thinking_dialectstring scan per request, which the reasoning branch already paid; no new allocation.