-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(gemini): add minimal and medium reasoning effort levels #9973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add GeminiThinkingLevel type with minimal, low, medium, high values - Update getGeminiReasoning() to accept all four thinking levels - Add comprehensive tests for new reasoning levels
Re-review of the latest commit (173814d) is complete. No new issues were identified; the PR remains ready to merge.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
src/api/transform/reasoning.ts
Outdated
| } | ||
|
|
||
| // Valid Gemini thinking levels for effort-based reasoning | ||
| const GEMINI_THINKING_LEVELS: readonly GeminiThinkingLevel[] = ["minimal", "low", "medium", "high"] as const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more traditional way to do this is to define the array of values as const and then derive the type from the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Please fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. Now defines GEMINI_THINKING_LEVELS array as const first, then derives GeminiThinkingLevel type from it. All local checks passed.
| // Effort-based models on Google GenAI support minimal/low/medium/high levels. | ||
| if (!GEMINI_THINKING_LEVELS.includes(selectedEffort as GeminiThinkingLevel)) { | ||
| return undefined | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roomote Let's make this a proper type guard function called isGeminiThinkingLevel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixaroo
See task on Roo Cloud
Added isGeminiThinkingLevel type guard function. All local checks passed.
* fix: preserve dynamic MCP tool names in native mode API history (RooCodeInc#9559) * fix: preserve tool_use blocks in summary message during condensing with native tools (RooCodeInc#9582) * Add support for images api (RooCodeInc#9587) * Make it clear that BFL Flux 2 is free (RooCodeInc#9588) * Add BFL models to openrouter (RooCodeInc#9589) * chore: add changeset for v3.34.4 (RooCodeInc#9590) * Changeset version bump (RooCodeInc#9591) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: set native tools as default for minimax-m2 and claude-haiku-4.5 (RooCodeInc#9586) * feat: enable multiple native tool calls per turn with failure guardrails (RooCodeInc#9273) * feat: add Bedrock Opus 4.5 to global inference model list (RooCodeInc#9595) Co-authored-by: Roo Code <[email protected]> * fix: update API handler when toolProtocol changes (RooCodeInc#9599) * Make single file read only apply to xml tools (RooCodeInc#9600) * Revert "Add support for Roo Code Cloud as an embeddings provider" (RooCodeInc#9602) * feat(web-evals): enhance dashboard with dynamic tool columns and UX improvements (RooCodeInc#9592) Co-authored-by: Roo Code <[email protected]> * fix(webview): pass taskId to finishSubTask when canceling or deleting tasks * chore: add changeset for v3.34.5 (RooCodeInc#9603) * Changeset version bump (RooCodeInc#9604) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Feature/bedrock embeddings support (RooCodeInc#9475) * feat: add AWS Bedrock support for codebase indexing - Add bedrock as a new EmbedderProvider type - Add AWS Bedrock embedding model profiles (titan-embed-text models) - Create BedrockEmbedder class with support for Titan and Cohere models - Add Bedrock configuration support to config manager and interfaces - Update service factory to create BedrockEmbedder instances - Add comprehensive tests for BedrockEmbedder - Add localization strings for Bedrock support Closes RooCodeInc#8658 * fix: add missing bedrockOptions to loadConfiguration return type * Fix various issues that the original PR missed. * Remove debug logs * Rename AWS Bedrock -> Amazon Bedrock * Remove some 'as any's * Revert README changes * Add translations * More translations * Remove leftover code from a debugging session. * fix: add bedrock to codebaseIndexModelsSchema and update brace-expansion override - Add bedrock provider to codebaseIndexModelsSchema type definition to fix empty model dropdown in UI - Update pnpm override for brace-expansion from '>=2.0.2' to '^2.0.2' to resolve ESM/CommonJS compatibility issues * Improvements to AWS Bedrock embeddings support - Enhanced bedrock.ts embedder implementation - Added comprehensive test coverage in bedrock.spec.ts - Updated config-manager.ts for better Bedrock configuration handling - Improved service-factory.ts integration - Updated embeddingModels.ts with Bedrock models - Enhanced CodeIndexPopover.tsx UI for Bedrock options - Added auto-populate test for CodeIndexPopover - Updated pnpm-lock.yaml dependencies * Restore openrouter config * Remove debug log * Fix config-manager.spec.ts unit test. * Add translations for "optional" * Revert unnecessary change related to open ia embedder --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: Smartsheet-JB-Brown <[email protected]> * fix: restore content undefined check in WriteToFileTool.handlePartial() (RooCodeInc#9614) * fix: exclude access_mcp_resource tool when MCP has no resources (RooCodeInc#9615) * fix: prevent model cache from persisting empty API responses (RooCodeInc#9623) * fix: update default settings for inline terminal and codebase indexing (RooCodeInc#9622) Co-authored-by: Roo Code <[email protected]> * feat(mistral): add native tool calling support (RooCodeInc#9625) * feat: wire MULTIPLE_NATIVE_TOOL_CALLS experiment to OpenAI parallel_tool_calls (RooCodeInc#9621) * feat(bedrock): allow global inference selection when cross-region is enabled (RooCodeInc#9616) Co-authored-by: Roo Code <[email protected]> * fix: defer new_task tool_result until subtask completes for native protocol (RooCodeInc#9628) * fix: convert line_ranges strings to lineRanges objects in native tool calls (RooCodeInc#9627) * fix: filter non-Anthropic content blocks before sending to Vertex API (RooCodeInc#9618) * Add fine grained tool streaming for OpenRouter Anthropic (RooCodeInc#9629) * Release v3.34.6 (RooCodeInc#9631) * Changeset version bump (RooCodeInc#9632) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * fix: OpenRouter GPT-5 strict schema validation for read_file tool (RooCodeInc#9633) * fix: create parent directories early in write_to_file to prevent ENOENT errors (RooCodeInc#9640) * Fix openrouter tool calls (RooCodeInc#9642) * fix(claude-code): disable native tools and temperature support (RooCodeInc#9643) * Enable native tool calling for z.ai (RooCodeInc#9645) * Moonshot native tool call support (RooCodeInc#9646) * Support native tools in the anthropic provider (RooCodeInc#9644) Co-authored-by: Roo Code <[email protected]> * Add 'taking you to cloud' screen after provider welcome (RooCodeInc#9652) * chore: add changeset for v3.34.7 (RooCodeInc#9651) * Changeset version bump (RooCodeInc#9654) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * fix: race condition in new_task tool for native protocol (RooCodeInc#9655) The pendingNewTaskToolCallId was being set AFTER startSubtask() returned. However, startSubtask() contains a 500ms delay during which the subtask could complete. If the subtask completed during this window, completeSubtask() would be called before pendingNewTaskToolCallId was set, causing it to fall through to the XML protocol path and add a text message instead of a proper tool_result block, breaking the API conversation structure. This fix moves the pendingNewTaskToolCallId assignment to happen BEFORE calling startSubtask(), ensuring the ID is set before the subtask starts. If the subtask creation fails, the pending ID is cleared. * chore: add changeset for v3.34.8 (RooCodeInc#9657) * Changeset version bump (RooCodeInc#9658) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: add model-specific tool customization via excludedTools and includedTools (RooCodeInc#9641) * feat: add model-specific tool customization via excludedTools and includedTools - Add excludedTools and includedTools to ModelInfo schema - Implement applyModelToolCustomization helper to filter tools based on model config - Integrate model tool filtering into filterNativeToolsForMode for native protocol - Add comprehensive tests for tool customization functionality - Wire up modelInfo through buildNativeToolsArray and Task.ts This allows providers to override which native tools are available on a per-model basis via MODEL_DEFAULTS, enabling better control over tool selection for models with specific needs. * feat: add customTools for opt-in only tools - Add customTools array to ToolGroupConfig for defining opt-in only tools - Update getToolsForMode() to exclude customTools from default tool set - Modify applyModelToolCustomization() to include customTools only via includedTools - Add tests for customTools functionality - Add comprehensive documentation with usage examples customTools allows defining tools that are NOT available by default, even when a mode includes their group. These tools are only available when explicitly included via a model's includedTools configuration. This enables: - Gradual rollout of experimental tools - Model-specific specialized capabilities - Safe experimentation without affecting default tool sets * Add assertions for customTools tests per review feedback * test: add tests for including customTools via includedTools
Summary
Adds support for
minimalandmediumreasoning effort levels in the Gemini provider implementation, expanding beyond the previously supportedlowandhighlevels.Changes
GeminiThinkingLeveltype with all four levels:minimal,low,medium,highGeminiReasoningParamstype to use the newGeminiThinkingLeveltypeGEMINI_THINKING_LEVELSconstant array for validation ingetGeminiReasoning()getGeminiReasoning()function to accept all four thinking levelsminimalandmediumeffort levelsthinkingBudgetImportant
Adds
minimalandmediumGemini thinking levels with updated validation, types, and tests, including budget precedence and default-effort fallback.GEMINI_THINKING_LEVELS(minimal|low|medium|high); addGeminiThinkingLevel; updateGeminiReasoningParamsto use it.getGeminiReasoning()to accept all four levels, returnundefinedfordisable/invalid values, and prioritizethinkingBudgetwhen applicable; falls back to model default effort when unset.reasoning.spec.tsto coverminimal/medium, all four levels,disable/nonehandling, budget-over-effort precedence, and default-effort fallback.roo-cline.This description was created by
for 173814d. You can customize this summary. It will automatically update as commits are pushed.
Note
Adds
minimalandmediumGemini thinking levels with updated validation, types, and tests, including budget precedence and default-effort fallback.GEMINI_THINKING_LEVELS(minimal|low|medium|high); addGeminiThinkingLevel; updateGeminiReasoningParamsto use it.getGeminiReasoning()to accept all four levels, returnundefinedfordisable/invalid values, and prioritizethinkingBudgetwhen applicable; falls back to model default effort when unset.reasoning.spec.tsto coverminimal/medium, all four levels,disable/nonehandling, budget-over-effort precedence, and default-effort fallback.roo-cline.Written by Cursor Bugbot for commit 9838370. This will update automatically on new commits. Configure here.