feat(cli): introduce compact tool output layout#18728
Conversation
- Update useGeminiStream to detect dense tool batches (non-verbose, non-shell). - Update useHistoryManager to merge consecutive tool_group items into a single history entry. - Add unit tests for history manager merging logic.
- Add DenseToolMessage component for single-line tool output. - Update ToolGroupMessage to support dense layout and conditional borders. - Improve padding and layout in ShellToolMessage and ToolMessage. - Add padding to ShowMoreLines and update UI snapshots.
- Introduce 'ui.enableCompactToolOutput' (default: true) to control tool output layout. - Separated the overloaded 'output.verbosity' setting into two distinct concerns: 'output.verbosity' now strictly filters history content, while 'ui.enableCompactToolOutput' toggles between dense and boxed layouts. - Update useGeminiStream and ToolGroupMessage to respect the new architectural separation.
- Add 'ui.enableCompactToolOutput' to configuration guide. - Regenerate settings documentation to reflect schema changes.
- Update all UI snapshots to synchronize with the new 'compact' default and minor layout tweaks. - Update legacy UI regression tests to explicitly disable 'enableCompactToolOutput' to verify boxed layout behavior (overflows, sticky headers). - Refactor 'useGeminiStream.test.tsx' to resolve TypeErrors and use consistent mock settings supporting the new UI options. - Fix EPERM failures by using 'os.tmpdir()' in a2a-server and CLI theme tests to resolve macOS Seatbelt issues.
Summary of ChangesHello @jwhelangoog, 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 significantly enhances the user experience of the CLI by introducing a compact tool output layout, which condenses most tool results into single-line summaries, thereby reducing visual clutter and improving the readability of the conversational history. It also refines output verbosity controls, allowing users to tailor the level of detail displayed, and includes important bug fixes for test reliability and temporary directory handling across different operating systems. 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
This pull request introduces a significant improvement to the CLI's user experience with the new compact tool output layout and verbosity controls. The implementation is well-structured, touching on UI components, state management, and configuration. The accompanying documentation and test updates are thorough. I've found one issue with the new verbosity logic that could cause autonomous tool calls to be displayed incorrectly. The fix is straightforward and detailed in the review comment.
|
Screenshot (link):
|
PR Review: feat(cli): introduce compact tool output layoutThe PR introduces a compact tool output layout, enabled by default, improving terminal ergonomics by merging tool groups and using single-line summaries. Analysis
Prompt ImpactThe change in @anj-s Please review the |
…text Establishes core data contracts and state management for enhanced tool outputs. - Introduces GrepResult, ListDirectoryResult, and ReadManyFilesResult types. - Updates tools to return structured data instead of flat strings. - Preserves confirmation details and diff stats in terminal tool states. - Ensures backward compatibility in standard CLI views via safe type guards.
Adds a disableColor mode to DiffRenderer and CodeColorizer. This allows for rendering uncolored diffs (for rejected tool calls) while maintaining full layout features like line numbers and indentation.
Introduces a modular architecture for compact tool output in the CLI. - Separates single-line summaries from multiline payloads across all tools. - Implements specialized handlers for file operations and ReadManyFiles. - Passes terminal dimensions to ensure accurate diff rendering in dense mode. - Ensures state persistence for rejected operations in history. - Includes unit tests for all new layouts, result types, and terminal states.
…attern - Support structured summaries and payloads in ToolGroupMessage/DenseToolMessage. - Add specialized box-layout rendering for file and read-many-files tools. - Refine tool state management in useGeminiStream during cancellations. - Update UI tests and snapshots to reflect new compact rendering styles.
…lMessage - Implement persistent expansion state in ToolActionsContext. - Add [Show/Hide Diff] toggle button for compact tool outputs. - Integrate ScrollableList with 120-column max-width for expanded diffs. - Ensure diffs are hidden by default in Alternate Screen Buffer mode. - Add comprehensive test coverage for toggle behavior.
|
Closing this PR. See #20974 for this work. |

Summary
This PR introduces the
ui.enableCompactToolOutputsetting (labeled as "Compact Tool Output"), which defaults totrue. This significantly improves terminal ergonomics by rendering most tool outputs as high-signal, single-line summaries. This "Compact View" reduces box clutter in the conversational history while maintaining immediate visual feedback for agent actions.Details
• Compact Tool Rendering: Implemented a new layout for standard tools (file operations, grep, etc.) that presents Name, Description, and Result in a single line.
• Improved History Clarity: Intelligently merges consecutive tool outputs and removes redundant box borders, resulting in a cleaner and more readable chat history.
• User Choice: Added the
ui.enableCompactToolOutputboolean setting (enabled by default). Users can toggle back to the traditional "Boxed" view at any time for a more detailed display.• Test Reliability:
• Updated UI tests and snapshots to reflect the new default experience.
• Resolved hardcoded path issues in macOS Seatbelt environments.
• Documentation: Updated
settings.jsonschema and configuration guides to reflect the refined setting name.Related Issues
Fixes #16190
Fixes #14569
How to Validate
/ls. Verify the output appears as a single line with a status indicator.settings.jsonto set"ui": { "enableCompactToolOutput": false }. Run the same tool and verify it appears in the traditional boxed layout with full borders.npm run test -w @google/gemini-clito verify CLI tests pass.