feat: add compactToolOutputAllowlist setting#25877
feat: add compactToolOutputAllowlist setting#25877dolphprefect wants to merge 4 commits intogoogle-gemini:mainfrom
Conversation
Introduces a new UI setting compactToolOutputAllowlist (string[]) that extends the built-in compact tool output list. When compactToolOutput is enabled, any tool whose name appears in this list is rendered using the compact DenseToolMessage instead of the full ToolResultDisplay. This allows external tools (e.g. MCP servers) to opt in to compact rendering by adding their tool names during setup, without requiring changes to the built-in allowlist.
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 introduces a flexible mechanism for users to control which tools are rendered in a compact format. By adding a configurable allowlist, users can now enable compact output for custom or external tools, such as those provided by MCP servers, without requiring changes to the core codebase. This improves the UI experience for users with custom tool integrations. 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
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a compactToolOutputAllowlist setting to the CLI configuration, allowing users to specify additional tools for compact display. The changes update the settings schema and integrate the allowlist into the ToolGroupMessage component and useGeminiStream hook. Feedback suggests memoizing the allowlist as a Set to optimize lookup performance from O(N) to O(1) within frequently called rendering functions.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Closed in favor of the much simpler proposal #25912 |
feat: add compactToolOutputAllowlist setting
Introduces a new UI setting
compactToolOutputAllowlist(string[]) that extends the built-in compact tool output list. WhencompactToolOutputis enabled, any tool whose name appears in this list is rendered using the compactDenseToolMessageinstead of the fullToolResultDisplay.This allows external tools (e.g. MCP servers) to opt in to compact rendering by adding their tool names during setup, without requiring changes to the built-in allowlist.
Summary
The existing
compactToolOutputsetting collapses verbose tool output into a single summary line, but only for a hardcoded set of built-in Gemini tools. MCP server tools — which can have any name and are user-defined — were always rendered verbosely regardless of this setting.This PR adds a
compactToolOutputAllowlistUI setting (string array, default empty) that extends the built-in list at runtime. Any tool name in the allowlist is treated as compact-eligible whencompactToolOutputis enabled. MCP server setup scripts can populate this list insettings.jsonso their tools benefit from compact rendering without requiring upstream code changes.Details
compactToolOutputAllowlistis defined insettingsSchema.tsas an array of strings, not shown in the settings dialog (it's intended for programmatic population by tool setup scripts).isCompactTool()inToolGroupMessage.tsxgains an optionalextraAllowlistparameter (defaults to[]) checked alongside the built-inCOMPACT_OUTPUT_ALLOWLIST.ToolGroupMessage.tsxanduseGeminiStream.tspass the allowlist read from settings. Hook dependency arrays updated accordingly.Related Issues
How to Validate
~/.gemini/settings.json:{ "ui": { "compactToolOutput": true, "compactToolOutputAllowlist": ["my_mcp_tool"] } }my_mcp_tool.my_mcp_tool.compactToolOutput: falseand confirm the tool reverts to full output (allowlist has no effect when compact mode is off).Pre-Merge Checklist