feat(core): multi-registry architecture and tool filtering for subagents#22712
feat(core): multi-registry architecture and tool filtering for subagents#22712abhipatel12 merged 1 commit intomainfrom
Conversation
|
Hi @akh64bit, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's ability to manage isolated tool environments, which is crucial for the subagent tool isolation initiative. By introducing a multi-registry architecture and refined tool filtering mechanisms, it provides the foundational components necessary for more complex agent interactions and resource management without altering the main agent's current operational behavior. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +3.85 kB (+0.01%) Total Size: 26.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring to support a multi-registry architecture for subagents with isolated toolsets. The changes to McpClientManager and McpClient, particularly the use of a clientKey to manage multiple client instances, are a solid approach. The addition of mainAgentTools for filtering the main agent's tools is also a good enhancement. The changes are logical and the tests have been updated appropriately.
Note: Security Review did not run due to the size of the PR.
Summary
This PR is part 2 of the subagent tool isolation rollout. It refactors the MCP and ToolRegistry architecture to support maintaining multiple discrete environments (i.e. isolated sets of tools, prompts, and resources) simultaneously rather than relying exclusively on a single global registry.
Details
McpClientandMcpClientManagerto support discovering and updating an arbitrary set ofRegistrySetinstances (toolRegistry,promptRegistry,resourceRegistry).mainAgentToolstoConfigand integrated it intoToolRegistry.getActiveTools()so that the main agent can correctly filter its tools when isolated environments are active.McpClientManager. Since only "main" registries are connected in this step, there is no change tomain's runtime execution behavior.Child of: #22708
Related Issues
Fixes #21901
How to Validate
npm run typecheckandnpm run testto verify no regressions in the MCP discovery or tool registry flows.Pre-Merge Checklist