Stop sending a thinking config to `gemini-2.5-flash-image`, which rejects it

Merged
DO
1mo ago
+99-8

google_model_profile marked gemini-2.5-flash-image as supports_thinking=True because it matches the Gemini 2.5 family, but the model doesn't think. Unified thinking=True sent thinking_config={'include_thoughts': True}, and the API rejected the request instead of the setting being ignored, as it is on other models without thinking.

Verified live on 2026-10-23 with the google-genai SDK:

  • Gemini API: every thinking config returns 400 INVALID_ARGUMENT. include_thoughts=True, thinking_budget=0 and thinking_budget=1024 return Thinking is not enabled for this model. thinking_level='HIGH' returns Thinking level is not supported for this model.
  • Vertex AI (global): include_thoughts=True returns Thinking_config.include_thoughts is only enabled when thinking is enabled. A nonzero budget returns thinking is not supported by this model, and thinking_level is rejected too. Only thinking_budget=0 is accepted.

The other image models accept every thinking config on the Gemini API: gemini-3.1-flash-image[-preview], gemini-3-pro-image[-preview] and gemini-3.1-flash-lite-image. gemini-2.5-flash-image-preview is retired (404 on both APIs), so only gemini-2.5-flash-image changes.

This PR makes google_model_profile report supports_thinking=False for gemini-2.5-flash-image, so unified thinking sends no thinking config there. An explicit google_thinking_config is still sent as given.

Tests:

  • test_google_2_5_flash_image_ignores_thinking is a new recorded test. It runs thinking=True on gemini-2.5-flash-image, checks that the request succeeds and that generationConfig has no thinkingConfig. Without the fix it fails, because thinkingConfig: {'include_thoughts': True} is sent.
  • The profile tests and the resolution-matrix snapshot are updated. The explicit check on the strict-tool guard (supports_thinking and not is_image_model) now runs against gemini-3-pro-image, which does think. gemini-2.5-flash-image no longer reaches that guard.

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