Skip to content

added setting errorVerbosity#20401

Open
codeafridi wants to merge 2 commits intogoogle-gemini:mainfrom
codeafridi:feat-cli-error
Open

added setting errorVerbosity#20401
codeafridi wants to merge 2 commits intogoogle-gemini:mainfrom
codeafridi:feat-cli-error

Conversation

@codeafridi
Copy link

@codeafridi codeafridi commented Feb 26, 2026

Fixes #20398

I added a new setting errorVerbosity with two options: low and full. In low mode, the chat UI now only shows real errors in the history and quietly hides info/warning “noise” from retries and recoverable tool failures .In full mode, it works like before and shows all feedback messages, so you still have a way to see everything when you’re debugging.

@codeafridi codeafridi requested a review from a team as a code owner February 26, 2026 07:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @codeafridi, 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 enhances the user experience of the CLI by introducing a configurable error verbosity setting. Users can now choose to see only critical errors in the chat history, reducing visual clutter from transient or recoverable issues, while still having the option to view all feedback for detailed debugging.

Highlights

  • New errorVerbosity setting: A new setting, errorVerbosity, has been introduced with two options: low and full. This setting controls the level of detail for error messages displayed in the interactive chat UI.
  • Improved UI feedback: In low verbosity mode (the default), the chat UI will now only display critical errors, effectively hiding informational or warning messages related to retries and recoverable tool failures. This reduces 'noise' for a cleaner user experience.
  • Full feedback option: The full verbosity mode retains the previous behavior, showing all feedback messages (errors, warnings, and info), providing a way to see comprehensive details when debugging is required.
Changelog
  • packages/cli/src/config/settingsSchema.ts
    • Added the errorVerbosity enum setting to the UI configuration schema, defining its label, category, default value ('low'), description, and available options ('low' and 'full').
  • packages/cli/src/ui/AppContainer.tsx
    • Implemented logic within the handleUserFeedback function to filter feedback messages based on the errorVerbosity setting, suppressing non-error messages when in 'low' mode.
    • Ensured that suppressed feedback with attached errors is still logged to the debug logger for diagnostic purposes.
    • Updated the useEffect dependency array to include settings.merged.ui.errorVerbosity to react to changes in the setting.
  • schemas/settings.schema.json
    • Added the errorVerbosity property to the ui section of the main settings JSON schema, including its title, description, markdown description, default value, type, and enum options.
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.

Copy link
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 a new errorVerbosity setting with low and full options to control the detail of feedback messages in the UI. While the implementation across the settings schema and the main AppContainer component correctly filters messages and updates dynamically, a critical security vulnerability has been identified. The new logging paths may leak sensitive information, as raw error objects are logged to the debug logger without redaction, which could expose API keys or other credentials. It is strongly recommended to implement a redaction mechanism for error objects and sanitize feedback messages before logging them to prevent sensitive data exposure, adhering to the principle of defense-in-depth for user-provided data.

Comment on lines 1981 to 1984
debugLogger.warn(
`[Feedback Details for "${payload.message}"]`,
payload.error,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The code logs the payload.error object directly to the debug logger. Error objects, especially those originating from network requests or external tools (like MCP servers), often contain sensitive information such as stack traces, environment variables, or credentials (e.g., API keys or tokens in request headers). These logs are written to a file (if GEMINI_DEBUG_LOG_FILE is set), which poses a risk of sensitive information leakage if the log file is shared for troubleshooting or accessed by unauthorized parties. Additionally, embedding payload.message directly into the log string allows for potential Log Injection if the message contains newline characters or format specifiers.

References
  1. Always treat user-provided data as untrusted and apply proper validation and sanitization at the point of use, even if it is believed to have been filtered or sanitized upstream. This follows the principle of defense-in-depth.

@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Feb 26, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature suggestion: reduce CLI error verbosity for cleaner UI

1 participant