fix(ide): use CLI version in MCP client handshake (#3487)#19874
fix(ide): use CLI version in MCP client handshake (#3487)#19874Aman071106 wants to merge 2 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @Aman071106, 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 addresses an issue where the IDE client was reporting a static version during its handshake with the server. By integrating a utility function to dynamically retrieve the CLI's actual version, the change ensures that the client-server communication is based on accurate version information, which is crucial for compatibility and debugging. 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
|
There was a problem hiding this comment.
Code Review
The pull request successfully addresses the issue of hardcoded version numbers in the MCP client handshake by integrating the getVersion() utility. This ensures that the IDE receives the actual CLI version, improving consistency and maintainability. The changes are well-contained and directly resolve the identified problem.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
Replaces the hardcoded
version: '1.0.0'in both MCP client initializations (StreamableHTTPClientTransportandStdioClientTransport) with a call togetVersion()fromutils/version.ts, so the IDE receives the actual CLI version during the MCP protocol handshake.Details
The
Clientconstructor inide-client.tswas using a hardcoded'1.0.0'string in two places (lines 591 and 626). The existinggetVersion()utility already resolves the CLI version fromCLI_VERSIONenv var orpackage.json, so this change simply imports and uses it. Both call sites are inasyncfunctions, soawait getVersion()works directly.Related Issues
Fixes #3487
How to Validate
Run the IDE client tests:
npm test -w @google/gemini-cli-core -- src/ide/ide-client.test.tsAll 26 tests should pass.
Verify the import and usage:
grep -n "getVersion" packages/core/src/ide/ide-client.tsShould show the import on line 25 and usage on lines 590 and 624.
Run full preflight:
Pre-Merge Checklist