Add `thinking_summary` to return readable thinking across providers, and `anthropic_thinking_display` and `bedrock_thinking_display`

Merged
DO
8d ago
+3357-202

Unified thinking=True on the newer Claude models returned empty, signed thinking blocks. Opus 4.7/4.8 and every 5.x model default to display: 'omitted', so you paid for thinking and saw none of it. More generally, whether thinking text comes back depended on a different provider-specific setting per API, so switching providers silently lost it (#10887).

This adds a unified thinking_summary model setting and a matching Thinking(summary=...) field. It asks the provider to return readable thinking where it has a switch: a summary, or raw reasoning on some open models. It keeps anthropic_thinking_display and bedrock_thinking_display, which win when set, as the native settings. Those come from @sevakva's #5652; this PR carries their commits forward, because the API-compatibility waiver for the new ModelSettingName member lives under .github/, which only a maintainer PR can change.

[!WARNING]
Compatibility impact: On Anthropic and Claude on Bedrock, a request that sets the unified thinking setting now sends thinking.display: 'summarized'. The newer Claude models then return their thinking summarized instead of empty, which can add a little latency before the first text token.

Why this can ship in a minor release: Empty thinking blocks after asking for thinking are the reported bug. Older Claude models already defaulted to 'summarized', and Google already returns thoughts for unified thinking.

Migration: Set thinking_summary=False, or anthropic_thinking_display='omitted', to keep the blocks empty.

Providerthinking on, thinking_summary unsetTrueFalse
Anthropic, Bedrock (Claude)display='summarized''summarized' (an explicit adaptive block on models that think by default)'omitted'
Googleinclude_thoughts=True (as before)include_thoughts=True, also on models that think by defaultinclude_thoughts=False
Groqreasoning_format='parsed' (as before)'parsed''hidden'
OpenAI Responses (incl. Meta, Bedrock Mantle)unchangedreasoning.summary='auto'unchanged
OpenRouterunchangedunchangedreasoning.exclude=True
Bedrock GPT-5.6, GPT-6unchangedreasoning.summary='auto'unchanged
Bedrock gpt-oss, vLLMunchangedunchangedinclude_reasoning=False
Cerebras gpt-ossunchangedunchangedreasoning_format='hidden'

Notes on the table:

  • Overrides warn, as for thinking. A provider-specific setting from a broader scope (say the model's settings) that beats a run's thinking_summary raises the same UserWarning that thinking gets.

  • OpenAI-style APIs stay opt-in. OpenAI says reasoning summaries may need organization verification, so a default could break requests that work today.

  • display is never attached to disabled or between_tools. Both reject it.

  • On Anthropic routes, OpenRouter still returns the text in reasoning_details. This is documented rather than stripped client-side.

  • Requests that set neither setting are unchanged on every provider.

Each mapping was checked live (2026-10-22) where a key was available. Cerebras and vLLM are covered by mocks only. Recorded tests cover Opus 4.7 and 5.5, Gemini, Groq gpt-oss and GPT-6.1 Sol.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.

šŸ¤– Generated with Claude Code