fix: suppress duplicate extension warnings during startup#26208
fix: suppress duplicate extension warnings during startup#26208cocosheng-g merged 2 commits intomainfrom
Conversation
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 addresses an issue where CLI startup triggered redundant extension-related warnings by initializing the extension manager multiple times. By introducing a skip mechanism for the initial configuration load, the system now ensures that extension processing occurs only when necessary, improving the user experience during startup without compromising configuration validity. Highlights
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. Footnotes
|
|
Size Change: +232 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a skipExtensions option to the CLI configuration loading process, allowing the CLI to bypass extension loading when necessary, such as in gemini.tsx. It refactors loadCliConfig to conditionally initialize the ExtensionManager and introduces a SimpleExtensionLoader as a fallback. Feedback was provided regarding the need for more robust handling of the potentially undefined extensionManager when accessing extension plan settings to ensure compliance with repository standards for optional properties.
452856e to
baeccee
Compare
There was a problem hiding this comment.
from /review-frontend
Code Review
This PR provides a clean and effective fix for the duplicate startup warnings issue (Fixes #23172). By introducing the skipExtensions flag to loadCliConfig and utilizing it for the initial partialConfig load in gemini.tsx, we avoid initializing the ExtensionManager twice. This not only cleanly suppresses the duplicate warnings but also directly addresses an existing TODO to avoid loading extensions during auth and sandbox setup, subtly improving startup performance.
Findings
- Correctness: The logic is sound. Skipping extension loading in the pre-sandbox phase works perfectly because the CLI only needs a minimal configuration object at that stage. The optional chaining (
extensionManager?.getExtensions()?.find(...)) is implemented safely. - Maintainability: The fallback mechanism (
finalExtensionLoader = extensionManager ?? new SimpleExtensionLoader([])) cleanly guarantees that downstream properties likeConfig.extensionLoaderare never undefined and remain strictly typed, preventing structural breakages elsewhere in the codebase. - Missing Test File: The PR description mentions an "included unit test" (
packages/cli/src/config/skipExtensions.test.ts), but this file is missing from the commits.
The implementation is correct and works exactly as intended. However, please push the missing skipExtensions.test.ts file so we have proper regression coverage for this flag.
baeccee to
9aae18d
Compare
…i-cli#26208+26207 - BerriAI/litellm#26793 feat(proxy): durable agent workflow run tracking (needs-discussion — sequence-number race + missing tenancy scoping + Prisma error leak) - google-gemini/gemini-cli#26208 fix: suppress duplicate extension warnings (merge-after-nits) - google-gemini/gemini-cli#26207 Add @ mention the gemini robot (request-changes — critique-semantics flip + comment-step if guard regression + PAT scope concern)
|
addressed all! |
9aae18d to
054b301
Compare
Summary
This PR fixes an issue where extension-related warnings (missing settings, MCP server deprecations, etc.) were displayed twice during CLI startup.
Details
The CLI startup flow in
gemini.tsxcallsloadCliConfigtwice—first to establish a minimalpartialConfigfor authentication/sandbox setup, and then for the full interactive session. Both calls were unconditionally loading all extensions.I've added a
skipExtensionsoption toloadCliConfigand set it totruefor the first call. When skipped, aSimpleExtensionLoader([])is used as a fallback to ensure theConfigobject remains valid and type-safe for downstream components.Related Issues
Fixes #23172
How to Validate
gemini.Alternatively, run the included unit test (manual steps if not using the repo's test runner):
Pre-Merge Checklist