Map unified `thinking` to `reasoning.effort` for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse

Merged
RS
1mo ago
+551-14

Unified thinking was dropped without a warning for the OpenAI GPT-5.6 and GPT-6 models on BedrockConverseModel, so they always reasoned at their default effort. This maps it the way Converse expects for these models, the Responses API shape additionalModelRequestFields={'reasoning': {'effort': ...}}. The flat reasoning_effort that the gpt-oss 'openai' variant sends is rejected for them as an unknown parameter.

  • BedrockModelProfile.bedrock_thinking_variant gets a new 'openai_responses' value, set by bedrock_openai_model_profile for the seven GPT-5.6 and GPT-6 ids, with supports_thinking=True and thinking_always_enabled taken from openai_model_profile (GPT-6 Astra and GPT-6.1 Sol reject effort='none').
  • thinking=False sends effort='none' where accepted, 'minimal' maps to 'low' (both families reject minimal), every other level passes through. A user-supplied reasoning key in bedrock_additional_model_requests_fields still wins, like the other variants.
  • These models accept a forced toolChoice while they reason (checked live with any and tool), so _effective_thinking_type returns None for the new variant. Without that, setting thinking would raise the gpt-oss/Qwen UserError for ToolOutput or move auto structured output to prompted mode. Behavior for users who don't set thinking is unchanged: no request field is added.
  • Docs: the "Bedrock (OpenAI GPT-5.6 and GPT-6)" row in the thinking provider table now shows the mapping instead of "Not mapped".

Tests are VCR recordings against us.openai.gpt-5.6-luna and global.openai.gpt-6-astra: False/'minimal'/'xhigh' on the wire with a reasoning block present or absent, the always-on drop, and ToolOutput with thinking='low' (fails with the UserError without the _effective_thinking_type change). The full live matrix behind the mapping is in the issue.

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