Skip to content

Conversation

@complyue
Copy link

@complyue complyue commented Apr 22, 2025

Context

Some tools would need vscode environment to correct function, but MCP would run the tool in separate os process, so no access to vscode env from the tool side.

This PR adds tool registration facility from other vscode extensions, otherwise basically the MCP tool integration solution.

Implementation

Please see PR contents.

How to Test

https://github.com/complyue/Roo-NB is an alternative way to add Notebook functionality to Roo, with this PR and that extension run together, it's equivalently what #1729 does.

Get in Touch

complyue Discord


Important

Introduces a new interface for VSCode extensions to register and manage custom tools within the Roo environment, with updates to handle tool interactions and UI components.

  • Behavior:
    • Adds use_ext_tool functionality to allow VSCode extensions to register and use custom tools.
    • Updates Cline.ts, responses.ts, and system.ts to handle use_ext_tool requests.
    • Implements ExtensionToolManager in ExtensionToolManager.ts for managing extension tools.
  • UI Components:
    • Adds ExtToolRow.tsx and ExtToolsView.tsx for displaying and managing extension tools in the UI.
    • Updates AutoApproveMenu.tsx, ChatRow.tsx, and ChatView.tsx to support extension tool interactions.
  • Settings:
    • Updates AutoApproveSettings.tsx and SettingsView.tsx to include settings for auto-approving extension tools.
    • Adds localization strings in chat.json and settings.json for new extension tool features.

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 22, 2025

⚠️ No Changeset found

Latest commit: 55a0617

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 the size:XXL This PR changes 1000+ lines, ignoring generated files. label Apr 22, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 22, 2025

This pull request is quite large, with 37 files changed and over 1000 lines added. It includes a variety of changes such as documentation updates, new features, tests, and UI components.

To improve the review process, it might be beneficial to split this pull request into smaller, more focused ones. Here are some suggestions on how to split the changes:

  1. Documentation: Separate the changes related to the Extension Tool API documentation into its own pull request.
  2. Core Features: Group the changes related to the core functionality of extension tools, such as those in src/core and src/exports, into another pull request.
  3. UI Components: Consider creating a separate pull request for the changes in the webview-ui directory, focusing on the UI integration of extension tools.

This approach will make it easier to review and test each part independently, ensuring a smoother integration process.

Copy link
Contributor

Choose a reason for hiding this comment

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

This error message formatter duplicates the existing invalidMcpToolArgumentError. Consider consolidating these into a single function.

This comment was generated because it violated a code review rule: mrule_fYE6mUdYYxZL58YF.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a stricter type than Record<string, any> for the properties field in the inputSchema. Using unknown or a well-defined interface for tool parameters can improve type checking and reduce potential runtime errors.

Suggested change
properties?: Record<string, any>
properties?: Record<string, unknown>

This comment was generated because it violated a code review rule: mrule_QkEwsCio7v34DaCF.

@dosubot dosubot bot added the enhancement New feature or request label Apr 22, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

This is really cool - thank you for the contribution!

The main thing I'm thinking about is how to make this available without confusing people who aren't interested in it. For instance could we get by without having an auto-approve toggle for this? It seems like we might want the auto-approve to be at the tool level anyway (and we should probably clean up MCP on this front as well).

Let me sleep on this and get back to you. Impressive work overall!

@complyue
Copy link
Author

This is really cool - thank you for the contribution!

Great you are interested! I should thank you for Roo in the first place!

The main thing I'm thinking about is how to make this available without confusing people who aren't interested in it. For instance could we get by without having an auto-approve toggle for this? It seems like we might want the auto-approve to be at the tool level anyway (and we should probably clean up MCP on this front as well).

Yes, I feel MCP auto approval is already some coarse-grained than ideal, at least it implemented per-tool approval, while this PR is approving all Ext Tools as a whole, definitely not right. I thought about implementing finer grained per-tool approval for Ext Tool functions, taking MCP ui as example, but ui stuffs are more or less beyond my capacity (tho luckily Cursor + Sonnet has got me this far).

Anyway, the core idea of this PR is simple and should be rather lightweight in coding, if not messing with UI design and UX considerations. Despite this PR, I'll be very happy if Roo would officially take this idea into a generalized (MCP+, including vscode ext, maybe workspace file based etc.) framework to integrate more external/modular agentic tools, I'd greatly enjoy contributing more tools (notebook ready, a long-run ai schedule under design, and maybe more) to Roo under this framework.

Let me sleep on this and get back to you. Impressive work overall!

Thanks! And please take your time and get good sleep.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 23, 2025
@complyue complyue force-pushed the ext-tools branch 2 times, most recently from be535dd to a4f26e0 Compare April 27, 2025 07:33
@mrubens mrubens self-assigned this May 5, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to PR [Greenlit] in Roo Code Roadmap May 5, 2025
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
@complyue complyue force-pushed the ext-tools branch 3 times, most recently from 7244b61 to 0ff2b74 Compare May 12, 2025 08:14
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels May 12, 2025
@complyue complyue force-pushed the ext-tools branch 7 times, most recently from 332d8e9 to 55a0617 Compare May 19, 2025 11:02
@hannesrudolph hannesrudolph moved this from New to PR [Greenlit] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from TEMP to Needs Preliminary Review in Roo Code Roadmap May 27, 2025
@hannesrudolph
Copy link
Collaborator

@complyue Thanks for submitting this PR, and sincere apologies that it took us so long to review and respond. You deserved a quicker response from us.

We're closing this PR now because it's no longer applicable due to the recent development of the Roo Code Marketplace. If you'd like to revisit this within the new context, please start by opening a new issue using our issue-first approach.

We genuinely appreciate your patience and willingness to contribute. Thanks again!

@github-project-automation github-project-automation bot moved this from Needs Preliminary Review to Done in Roo Code Roadmap May 27, 2025
@github-project-automation github-project-automation bot moved this from PR [Greenlit] to Done in Roo Code Roadmap May 27, 2025
@axmo axmo mentioned this pull request Jun 4, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants