Repository navigation
Address review of the high reasoning default: OpenRouter Haiku budget, fit boundary, retired-variable warning - #551
Merged
Conversation
…dary, retired-variable warning - OpenRouter: Haiku is sent its level's budget as reasoning.max_tokens (an effort would be a share of an unset max_tokens), no reasoning field for none, and no temperature while it thinks, as on the Claude Platform path. - _fit_thinking_budget: a max_tokens between 1025 and 2047 gets the 1024 minimum instead of failing; a callers own budget is never lowered. - default_thinking loses its budget parameter and DEFAULT_THINKING_BUDGET_TOKENS: the default level's budget is the one source. - get_settings warns when the retired ANTHROPIC_THINKING_BUDGET_TOKENS is set. - Tests: routing fixtures pin max output tokens; boundary, explicit-budget and temperature cases; the process environment no longer decides a result. Tested: 3720 offline tests; 11 mutations killed.
…riable warning Tested: not applicable (docs).
8 tasks
5 tasks done
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.
Closes #550. Follows #549.
#549 merged before its independent review was addressed; this carries those fixes.
Changes
reasoning: {"max_tokens": 4096}athigh, noteffort: OpenRouter turns an effort into a share ofmax_tokens, which is unset on this path (its models listing also gives Haiku nosupported_efforts).nonesends no reasoning field, and no temperature is sent while Haiku thinks, as on the Claude Platform path (Anthropic does not allow one with thinking). Sonnet, Luna and gpt-oss are unchanged (checked in the request body).max_tokensfrom 1025 to 2047 now gets the 1024 minimum budget instead of failing every request; 2048 and above leave the minimum budget's worth for the answer; 1024 or less is still refused. A budget a caller names is never lowered (a test now pins it).ANTHROPIC_THINKING_BUDGET_TOKENS:get_settingslogs a warning namingreasoning_effortas the replacement when it is still set (an operator who lowered it on purpose would otherwise get 4096 silently).default_thinkingloses itsbudgetparameter andDEFAULT_THINKING_BUDGET_TOKENSgoes: the default level's budget inTHINKING_BUDGET_TOKENSis the one source._THINKING_OFF, router,thinkingdocstring,.contextnote); CHANGELOG and ADR 0015 updated, including that Haiku on a caller's own OpenRouter key now reasons.Tests
none, dropped otherwise), OpenRouter Haiku per level andnone, the other models keeping their temperature, and the warning (by name, any case, not when unset, startup unaffected).anthropic_max_output_tokens, and the tests pass withANTHROPIC_MAX_OUTPUT_TOKENS=4000. One warning test was itself not hermetic (a shell exporting the variable hid a case-sensitivity mutation); fixed.Not verified by a request
reasoning.max_tokenson OpenRouter is documented as used as given (1024 at least) andmax_tokensunset is not documented, so what OpenRouter fills in is unknown; BYOK only. No live Anthropic or OpenRouter request has been made.