Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Jun 6, 2025

Description

Fixes #4399

I think this has caused issues before; if you check the "Thinking Budget" box and don't change the defaults then we don't end up persisting the custom maxTokens and maxThinkingTokens in your settings. We probably should fix this on the webview side, but we still need to handle the case where these values are undefined in the settings and default to the values that we display in the webview (in this case DEFAULT_HYBRID_REASONING_MODEL_MAX_TOKENS and DEFAULT_HYBRID_REASONING_MODEL_THINKING_TOKENS).


Important

Fixes Gemini 2.5 Pro Preview thinking budget bug by defaulting to specified token values when settings are undefined and updates tests accordingly.

  • Behavior:
    • Fixes thinking budget bug in Gemini 2.5 Pro Preview by defaulting to DEFAULT_HYBRID_REASONING_MODEL_MAX_TOKENS and DEFAULT_HYBRID_REASONING_MODEL_THINKING_TOKENS when settings are undefined in model-params.ts.
    • Ensures reasoning budget does not exceed 80% of maxTokens and is at least 1024 tokens.
  • Tests:
    • Updates model-params.spec.ts to test new default behavior and clamping logic for reasoning budget and thinking tokens.
    • Renames model-params.test.ts to model-params.spec.ts for consistency with testing framework.

This description was created by Ellipsis for e50c7ab. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners June 6, 2025 05:41
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 6, 2025
@cte cte merged commit 22392e0 into main Jun 6, 2025
9 checks passed
@cte cte deleted the cte/gemini-pro-preview-thinking-budget branch June 6, 2025 05:55
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 6, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 6, 2025
Copy link
Collaborator

@jr jr left a comment

Choose a reason for hiding this comment

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

lgtm

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

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

When enabling thinking, an error occurs

3 participants