Drop `temperature` and `top_p` for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse instead of failing with a 400

Merged
KI
1mo ago
+630-8

Setting temperature, top_p or top_k on OpenAI GPT-5.6 Sol/Luna/Terra or GPT-6 Sol/Luna/Astra through bedrock: failed with a 400 from Converse ("This model doesn't support the temperature field"). BedrockConverseModel now drops these settings with a UserWarning for those models, using the same path it already uses for Claude Opus 4.7+.

New public surface

BedrockModelProfile.bedrock_disallows_sampling_settings (default False), set for the six models above in bedrock_openai_model_profile.

Verification

Live probe with raw Converse calls, us-east-1:

  • All six models reject temperature (0.2 and 1), topP and top_k, including with reasoning.effort set to 'none' or 'low'. So the settings are always dropped, not only while reasoning is on.
  • GPT-6 Astra can't turn reasoning off ('none' is rejected), and rejects temperature at every effort level too.
  • openai.gpt-oss-120b-1:0 accepts all three settings, so it stays unflagged.

Tests, all recorded live against Converse (us-east-1):

  • test_bedrock_openai_api_rejects_sampling_settings, per model: Converse's own 400 for temperature, via the raw client.
  • test_bedrock_openai_drops_sampling_settings, per model: warning emitted, inferenceConfig sent without the settings, body-matched.
  • test_bedrock_openai_gpt_oss_keeps_sampling_settings: gpt-oss still sends temperature and topP, and gets a 200.
  • test_bedrock_converse_accepts_gpt_5_6_and_gpt_6_models: the flag is set for all six models.

Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • 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. (Not applicable.)
  • PR title is fit for the release changelog.