Skip to content

fix(cli): deduplicate startup extension warnings in terminal UI#23178

Closed
moisgobg wants to merge 19 commits intofeat/builtin-conductorfrom
fix/duplicate-extension-warnings
Closed

fix(cli): deduplicate startup extension warnings in terminal UI#23178
moisgobg wants to merge 19 commits intofeat/builtin-conductorfrom
fix/duplicate-extension-warnings

Conversation

@moisgobg
Copy link
Copy Markdown

@moisgobg moisgobg commented Mar 20, 2026

Background

During startup, loadCliConfig is called twice (once for initial settings and again after auth/admin policy fetch). This leads to ExtensionManager being instantiated and loaded twice, causing duplicate warnings in the UI.

Changes

Introduces a module-level emittedWarnings Set in ExtensionManager.ts to deduplicate identical warning strings within a single process run.

Long-term solution

A full refactor to avoid double-loading extensions is tracked in #23171.

Fixes #23175

jerop and others added 18 commits March 17, 2026 17:45
- Introduce support for bundled 'builtin' extensions in ExtensionManager
- Migrate conductor extension to packages/core/src/extensions/builtin/conductor
- Add automatic migration logic to cleanup manual conductor installations
- Make extension versioning optional for built-ins, defaulting to CLI version
- Update build and bundle scripts to include builtin extensions
- Enhance documentation to highlight conductor as a core feature
This replaces the manual regex for ${extensionPath} with the standardized
hydrateString utility, automatically enabling support for other variables
like ${workspacePath} and ${/} in custom extension commands.

Added a test case to verify ${workspacePath} hydration.
- Renamed built-in extension 'Conductor' to 'Spec-Driven Development (SDD)'.
- Updated commands from '/conductor:<action>' to '/spec <action>'.
- Migrated default artifact storage from 'conductor/' to '.gemini/specs/'.
- Updated documentation, security policies, and internal references.
- Refactored FileCommandLoader to use standardized variable hydration.
- Replaced automatic Conductor deletion with a non-destructive migration prompt.
- Added step in setup to ensure .gemini/specs/ is exempted from .gitignore.
…t handling

- Renamed 'Conductor' to 'Spec-Driven Development (SDD)'.
- Migrated artifact storage to '.gemini/specs/'.
- Updated commands to '/spec <action>'.
- Added Plan Mode and SDD workflow notes to README.
- Replaced automatic extension migration with a warning prompt to preserve user files.
- Added .gitignore exemption for .gemini/specs/ in setup.
@moisgobg moisgobg requested a review from a team as a code owner March 20, 2026 00:10
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Mar 20, 2026

Hi @moisgobg, 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!

@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 addresses two distinct areas: it resolves an issue causing redundant startup warnings in the CLI by introducing a deduplication set, and it undertakes a significant refactoring of the Spec-Driven Development (SDD) framework. The SDD refactor involves a comprehensive terminology update, replacing 'track' with 'spec' throughout its commands and policies, alongside implementing migration paths for older directory structures.

Highlights

  • Warning Deduplication: Implemented a mechanism in the ExtensionManager to prevent duplicate startup extension warnings from being displayed in the terminal UI.
  • SDD Terminology Refactor: Renamed all instances of 'track' to 'spec' across the Spec-Driven Development (SDD) framework's command definitions and related files for consistency.
  • Legacy Migration Support: Added logic to the SDD setup command to automatically migrate legacy conductor/ directories and tracks.md files to the new .gemini/specs/ structure and 'spec' terminology.
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.

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.

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 addresses the issue of duplicate startup extension warnings in the terminal UI by introducing a deduplication mechanism. It also updates terminology from "track" to "spec" and "conductor" to "sdd" across various configuration and documentation files within the SDD extension. The terminology changes improve consistency and reflect the updated naming conventions.

import { themeManager } from '../ui/themes/theme-manager.js';
import { getFormattedSettingValue } from '../commands/extensions/utils.js';

const emittedWarnings = new Set<string>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The emittedWarnings Set is declared at the module level, making it a global state. While this effectively deduplicates warnings within a single process run, it introduces a dependency on the module's lifecycle. If the ExtensionManager were ever to be instantiated multiple times within a long-running process, or if the CLI supports distinct, isolated contexts where warnings should be unique per context, this global state could lead to unintended suppression of warnings or persistence of warnings across unrelated operations. Consider scoping emittedWarnings to the ExtensionManager instance (e.g., this.emittedWarnings = new Set<string>(); in the constructor) and ensuring proper lifecycle management (e.g., clearing it on re-initialization if applicable). This would improve modularity and prevent potential issues in more complex application scenarios.

Copy link
Copy Markdown
Author

@moisgobg moisgobg Mar 20, 2026

Choose a reason for hiding this comment

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

This is correct, the module-level state is generally an anti-pattern. This is a tactical hotfix to resolve the immediate UX issue for users. The proper architectural fix is tracked in #23171. Once that refactor is complete, this module-level state will be removed entirely.

This change introduces a module-level Set to deduplicate warning messages
emitted by the ExtensionManager. This prevents identical warnings (like
missing settings or built-in replacements) from being displayed twice
due to loadCliConfig being invoked multiple times during startup.

Fixes #23175
See also #23171 for the planned long-term refactor.
@moisgobg moisgobg force-pushed the fix/duplicate-extension-warnings branch from 02e8892 to 6bc2f89 Compare March 20, 2026 00:19
@moisgobg moisgobg self-assigned this Mar 20, 2026
@moisgobg moisgobg added area/extensions Issues related to Gemini CLI extensions capability 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 20, 2026
@moisgobg moisgobg marked this pull request as draft March 20, 2026 00:23
@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Mar 20, 2026
@jerop jerop force-pushed the feat/builtin-conductor branch from c0bf255 to 15bb451 Compare March 20, 2026 02:00
@jerop jerop force-pushed the feat/builtin-conductor branch from 15bb451 to c879453 Compare March 20, 2026 15:00
@jerop jerop deleted the branch feat/builtin-conductor April 1, 2026 16:18
@jerop jerop closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality area/extensions Issues related to Gemini CLI extensions capability 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants