Enable browser_action tool for all models #2818
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This change enables the
browser_actiontool for all supported AI models within Roo-Code. Previously, this tool was restricted to specific models (Claude 3.5 and 3.7 Sonnet via OpenRouter), limiting its usability. The goal is to allow users to leverage browser interaction capabilities regardless of the selected model provider or specific model, provided the underlying model could potentially support tool use.Implementation
The implementation involved modifying the model capability flags:
src/shared/api.ts: Updated the definitions for various built-in models (Anthropic, Bedrock, Gemini, etc.) to setsupportsComputerUse: truewhere it was previouslyfalse.src/api/providers/openrouter.ts:getOpenRouterModelsfunction to setsupportsComputerUse: trueas a default property for all models fetched from the OpenRouter API.casestatements within theswitchblock that previously setsupportsComputerUse = trueonly forclaude-3.7-sonnetandclaude-3.5-sonnet.npm installin the root directory and thewebview-uiworkspace to ensure all dependencies were correctly installed after noticing build errors during packaging.Parameter 'part' implicitly has an 'any' type) insrc/api/providers/openrouter.tsby adding an explicit type annotation (OpenAI.Chat.ChatCompletionContentPart).No significant refactoring was required. The main tradeoff is that the UI/prompt might now offer the
browser_actiontool even for models that might not effectively use it, but this aligns with enabling the capability flag broadly based on potential rather than confirmed support for every single model.Screenshots
How to Test
bin/roo-cline-3.12.2.vsix) or click here.browser_actionenabled (e.g., Google Gemini via Vertex AI, or a non-Claude model via OpenRouter likemistralai/mistral-7b-instruct).browser_actiontool description appears in the initial system prompt's "Capabilities" section.Get in Touch
unlegitapple
Important
Enables
browser_actiontool for all models by settingsupportsComputerUse: trueand fixes a TypeScript error inopenrouter.ts.browser_actiontool for all models by settingsupportsComputerUse: trueinsrc/shared/api.tsandsrc/api/providers/openrouter.ts.casestatements forclaude-3.7-sonnetandclaude-3.5-sonnetinopenrouter.ts.openrouter.tsby adding type annotationOpenAI.Chat.ChatCompletionContentPart.This description was created by
for 71d5f9e. You can customize this summary. It will automatically update as commits are pushed.