Stop sending a thinking config to `gemini-2.5-flash-image`, which rejects it
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=0andthinking_budget=1024returnThinking is not enabled for this model.thinking_level='HIGH'returnsThinking level is not supported for this model. - Vertex AI (
global):include_thoughts=TruereturnsThinking_config.include_thoughts is only enabled when thinking is enabled. A nonzero budget returnsthinking is not supported by this model, andthinking_levelis rejected too. Onlythinking_budget=0is 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_thinkingis a new recorded test. It runsthinking=Trueongemini-2.5-flash-image, checks that the request succeeds and thatgenerationConfighas nothinkingConfig. Without the fix it fails, becausethinkingConfig: {'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 againstgemini-3-pro-image, which does think.gemini-2.5-flash-imageno 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