Skip to content

fix(patch): cherry-pick 8432bce to release/v0.34.0-preview.1-pr-22069 to patch version v0.34.0-preview.1 and create version 0.34.0-preview.2#22205

Merged
abhipatel12 merged 2 commits intorelease/v0.34.0-preview.1-pr-22069from
hotfix/v0.34.0-preview.1/0.34.0-preview.2/preview/cherry-pick-8432bce/pr-22069
Mar 12, 2026
Merged

fix(patch): cherry-pick 8432bce to release/v0.34.0-preview.1-pr-22069 to patch version v0.34.0-preview.1 and create version 0.34.0-preview.2#22205
abhipatel12 merged 2 commits intorelease/v0.34.0-preview.1-pr-22069from
hotfix/v0.34.0-preview.1/0.34.0-preview.2/preview/cherry-pick-8432bce/pr-22069

Conversation

@gemini-cli-robot
Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit 8432bce to patch version v0.34.0-preview.1 in the preview release to create version 0.34.0-preview.2.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refactors the handling of Multi-Component Protocol (MCP) tool names and their registration within the agent system. It introduces a standardized naming convention for MCP tools, enhances support for wildcard tool selection, and simplifies the internal logic for registering and retrieving tool schemas. These changes aim to improve the flexibility and robustness of tool configuration for agents, allowing for more dynamic and expressive tool assignments.

Highlights

  • Standardized MCP Tool Naming and Validation: Introduced a new 'mcp_server_tool' naming convention for Multi-Component Protocol (MCP) tools, replacing or augmenting the previous 'server__tool' format, and implemented stricter validation rules for these names, including checks for empty components and invalid characters.
  • Enhanced Tool Wildcard Support: Added comprehensive support for wildcard tool names, allowing agents to register all available tools (''), all MCP tools ('mcp_'), or all tools from a specific server ('mcp_server_*'), significantly increasing flexibility in tool configuration.
  • Simplified MCP Tool Registration: Removed the 'asFullyQualifiedTool()' method and associated logic, streamlining the registration of 'DiscoveredMCPTool' instances in the 'ToolRegistry' and 'LocalAgentExecutor' by directly using their fully qualified names.
  • Refactored Agent Tool Loading: Updated the 'LocalAgentExecutor' to leverage the new wildcard capabilities and simplified tool schema retrieval, ensuring that all registered tools' schemas are correctly included.
Changelog
  • packages/core/src/agents/agentLoader.ts
    • Updated tool name validation in agent schema to permit wildcards.
  • packages/core/src/agents/local-executor.ts
    • Imported new types and utilities for MCP tool handling.
    • Refactored tool registration logic to support wildcard patterns for global, MCP, and server-specific tools.
    • Removed redundant tool name collection during schema generation.
    • Modified tool schema retrieval to include all registered tool declarations.
  • packages/core/src/tools/mcp-tool.ts
    • Clarified parsing logic for MCP tool names to ensure non-empty server and tool components.
    • Removed the 'asFullyQualifiedTool' method from 'DiscoveredMCPTool'.
  • packages/core/src/tools/tool-names.test.ts
    • Improved property access safety in 'isValidToolName' mock.
    • Updated tests for MCP tool name validation to reflect the new 'mcp_server_tool' format.
    • Adjusted tests for invalid tool names and wildcard handling to match updated validation rules.
  • packages/core/src/tools/tool-names.ts
    • Added imports for MCP tool utility functions.
    • Rewrote 'isValidToolName' to implement new MCP tool naming conventions, including wildcard support and stricter validation.
  • packages/core/src/tools/tool-registry.test.ts
    • Updated test cases to remove references to the deprecated 'asFullyQualifiedTool' method.
    • Simplified tool registration in tests by removing redundant fully qualified tool registrations.
    • Adjusted tests to reflect the direct registration of MCP tools without explicit qualification.
  • packages/core/src/tools/tool-registry.ts
    • Removed special handling for 'DiscoveredMCPTool' during registration, allowing direct registration by name.
    • Ensured that 'DiscoveredMCPTool' schemas returned by 'getFunctionDeclarations' use their fully qualified names.
    • Removed redundant lookup for fully qualified MCP tool names in 'getTool'.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 12, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for wildcard tool names in agent definitions (e.g., *, mcp_*, mcp_server_*) and refactors the naming convention for MCP tools to a more explicit mcp_server_tool format. The changes are consistently applied across agent loading, execution, and tool validation logic. This includes updating the agent loader schema, adding wildcard expansion logic in the LocalAgentExecutor, and adjusting the tool name validation. The removal of the asFullyQualifiedTool method and related logic simplifies the tool registration process. The accompanying test updates correctly reflect these new features and refactoring. The changes appear solid and I have no high or critical severity concerns.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 12, 2026

Size Change: +168 B (0%)

Total Size: 26.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 26 MB +168 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

This commit fixes an issue where LocalAgentExecutor would push the schema of an instantiated tool twice during agent invocation, leading to 'Duplicate function declaration' API errors.
Copy link
Copy Markdown
Contributor

@abhipatel12 abhipatel12 left a comment

Choose a reason for hiding this comment

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

Approved

@abhipatel12 abhipatel12 merged commit 4085b4f into release/v0.34.0-preview.1-pr-22069 Mar 12, 2026
25 checks passed
@abhipatel12 abhipatel12 deleted the hotfix/v0.34.0-preview.1/0.34.0-preview.2/preview/cherry-pick-8432bce/pr-22069 branch March 12, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants