Skip to content

feat: replace fixed per-provider reasoning effort with per-model default and max#26974

Draft
DanielleMaywood wants to merge 1 commit into
mainfrom
dm/reasoning-effort-1-model-config
Draft

feat: replace fixed per-provider reasoning effort with per-model default and max#26974
DanielleMaywood wants to merge 1 commit into
mainfrom
dm/reasoning-effort-1-model-config

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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-level reasoning_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

  • codersdk: new ChatModelReasoningEffortConfig (default/max) on ChatModelCallConfig; the per-provider effort fields (openai.reasoning_effort, anthropic.effort, openaicompat.reasoning_effort, openrouter/vercel reasoning.effort) are removed.
  • Validation: values must be in the provider's runtime-supported set (openai/openaicompat minimal..xhigh, anthropic low..max, openrouter low..high, vercel none..xhigh) with default <= max on the global scale none < minimal < low < medium < high < xhigh < max; a single value mirrors into the other. Updates fail when the config's provider has been soft-deleted.
  • Migration (000537): rewrites chat_model_configs.options so the legacy effort value (selected provider-aware via ai_providers.type, with a COALESCE fallback) becomes both default and max, stripping the legacy keys. Also adds chats.last_reasoning_effort, chat_messages.reasoning_effort, and chat_queued_messages.reasoning_effort, which stay unused until the per-turn follow-up. Down migration restores the provider-appropriate legacy path.
  • chatd: new chatprovider.ResolveReasoningEffort clamps 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).
  • site: compile fallout only; the admin form schema loses the old per-provider effort selects, known-model catalog defaults populate the new pair, and form logic validates 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

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/admin/security/audit-logs.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant