Skip to content

Conversation

@chromaticsequence
Copy link

@chromaticsequence chromaticsequence commented Apr 21, 2025

Context

This change enables the browser_action tool 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:

  1. src/shared/api.ts: Updated the definitions for various built-in models (Anthropic, Bedrock, Gemini, etc.) to set supportsComputerUse: true where it was previously false.
  2. src/api/providers/openrouter.ts:
    • Modified the getOpenRouterModels function to set supportsComputerUse: true as a default property for all models fetched from the OpenRouter API.
    • Removed the specific case statements within the switch block that previously set supportsComputerUse = true only for claude-3.7-sonnet and claude-3.5-sonnet.
  3. Dependency Management & Fixes:
    • Ran npm install in the root directory and the webview-ui workspace to ensure all dependencies were correctly installed after noticing build errors during packaging.
    • Fixed a minor TypeScript error (Parameter 'part' implicitly has an 'any' type) in src/api/providers/openrouter.ts by 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_action tool 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

before after
(N/A - Change affects tool availability) (N/A - Change affects tool availability)

How to Test

  1. Build and install the extension from this branch (bin/roo-cline-3.12.2.vsix) or click here.
  2. Open Roo-Code and select an API provider and model that previously did not have browser_action enabled (e.g., Google Gemini via Vertex AI, or a non-Claude model via OpenRouter like mistralai/mistral-7b-instruct).
  3. Start a new task.
  4. Verify that the browser_action tool description appears in the initial system prompt's "Capabilities" section.
  5. Ask the model to perform a browser action, for example: "Launch a browser and go to example.com".
  6. Confirm the tool use is attempted (you should see the approval prompt or the action execute) rather than being rejected due to model incompatibility.

Get in Touch

unlegitapple


Important

Enables browser_action tool for all models by setting supportsComputerUse: true and fixes a TypeScript error in openrouter.ts.

  • Behavior:
    • Enables browser_action tool for all models by setting supportsComputerUse: true in src/shared/api.ts and src/api/providers/openrouter.ts.
    • Removes specific case statements for claude-3.7-sonnet and claude-3.5-sonnet in openrouter.ts.
  • Fixes:
    • Fixes TypeScript error in openrouter.ts by adding type annotation OpenAI.Chat.ChatCompletionContentPart.

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2025

⚠️ No Changeset found

Latest commit: 71d5f9e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Apr 21, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 22, 2025
@sachasayan
Copy link
Contributor

Hey @chromaticsequence, have you tested this across other models? How did it do?

@cannuri
Copy link
Contributor

cannuri commented Apr 28, 2025

@chromaticsequence you are setting all models to supportsComputerUse == true which is misleading as they are not all supporting computer use.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

Hey @chromaticsequence,
Thank you for your contribution, We noticed this PR is stale and will be closed. If you plan to revisit this, please create an issue first as required by our issue-first approach before opening a new PR.

@daniel-lxs daniel-lxs closed this May 26, 2025
@github-project-automation github-project-automation bot moved this from TEMP to Done in Roo Code Roadmap May 26, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 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.

4 participants