Skip to content

Conversation

@naga-k
Copy link
Contributor

@naga-k naga-k commented Jan 17, 2026

Summary

  • Models like gemini-2.5-flash only support thinkingBudget, not thinkingLevel
  • When shouldUseReasoningBudget() returned false, the code was incorrectly falling through to effort-based logic and sending thinkingLevel, causing a 400 INVALID_ARGUMENT error
  • Added a check for model.supportsReasoningEffort before attempting to use thinkingLevel

Test plan

  • Tested locally with gemini-2.5-flash - error no longer occurs
  • Added unit tests for budget-only model scenarios

Fixes #4490

@changeset-bot
Copy link

changeset-bot bot commented Jan 17, 2026

🦋 Changeset detected

Latest commit: 5a4b44f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Models like gemini-2.5-flash only support thinkingBudget, not thinkingLevel.
When shouldUseReasoningBudget() returns false (due to settings), the code
was incorrectly falling through to effort-based logic and sending thinkingLevel,
causing a 400 INVALID_ARGUMENT error: "Thinking level is not supported for
this model."

Added a check for model.supportsReasoningEffort before attempting to use
thinkingLevel, ensuring budget-only models don't receive unsupported params.

Fixes Kilo-Org#4490
@naga-k naga-k force-pushed the fix/gemini-thinking-level branch from 19e0c09 to 608fc3e Compare January 17, 2026 00:48
Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini provider fails in every Mode due to unsupported thinking_level parameter

3 participants