feat: replace fixed per-provider reasoning effort with per-model default and max#26974
Draft
DanielleMaywood wants to merge 1 commit into
Draft
feat: replace fixed per-provider reasoning effort with per-model default and max#26974DanielleMaywood wants to merge 1 commit into
DanielleMaywood wants to merge 1 commit into
Conversation
Docs preview📖 View docs preview for |
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.
Reasoning effort was a fixed per-model setting stored at provider-specific paths in
chat_model_configs.options(e.g.provider_options.openai.reasoning_effort), so offering the same model at multiple efforts required duplicate model configs. Each model config now carries a top-levelreasoning_effort{default, max}pair instead.This PR is behavior-preserving: generation resolves the configured default (clamped to max and the provider's supported set), which matches the old fixed value after migration. Per-turn user selection lands in the follow-up PR.
Changes
ChatModelReasoningEffortConfig(default/max) onChatModelCallConfig; the per-provider effort fields (openai.reasoning_effort,anthropic.effort,openaicompat.reasoning_effort,openrouter/vercelreasoning.effort) are removed.minimal..xhigh, anthropiclow..max, openrouterlow..high, vercelnone..xhigh) withdefault <= maxon the global scalenone < minimal < low < medium < high < xhigh < max; a single value mirrors into the other. Updates fail when the config's provider has been soft-deleted.chat_model_configs.optionsso the legacy effort value (selected provider-aware viaai_providers.type, with a COALESCE fallback) becomes bothdefaultandmax, stripping the legacy keys. Also addschats.last_reasoning_effort,chat_messages.reasoning_effort, andchat_queued_messages.reasoning_effort, which stay unused until the per-turn follow-up. Down migration restores the provider-appropriate legacy path.chatprovider.ResolveReasoningEffortclamps and snaps the effective effort into the provider's supported set before injecting it into the fantasy provider options (azure routes via openai, bedrock via anthropic).default <= max. New admin UI placement and the chat slider land in follow-ups.Stack: this PR → per-turn API (#26975) → models page UI (#26976, on this PR) and chat slider (#26977, on #26975).
🤖 Generated by Coder Agents on behalf of @DanielleMaywood