Skip to content

feat(cli): refine tool output formatting for compact mode#24677

Open
jwhelangoog wants to merge 2 commits intomainfrom
feature/tool-output/compact-tuning
Open

feat(cli): refine tool output formatting for compact mode#24677
jwhelangoog wants to merge 2 commits intomainfrom
feature/tool-output/compact-tuning

Conversation

@jwhelangoog
Copy link
Copy Markdown
Contributor

Summary

Refine tool output formatting in the CLI's compact (dense/grouped) mode to improve readability and information density. This PR makes search and read tools truly terse by removing multi-line payloads and ensures consistent verbiage across listing tools.

Details

1. Compact Mode Refinements

  • Terse Summaries: Removed multi-line match lists and file lists from the dense/grouped view for grep_search and read_many_files.
  • Consistent Verbiage: Updated list_directory (ReadFolder) summary from "Listed" to "Found" to align with other search tools.
  • UI Logic: Updated hasDensePayload to return false for grep and multi-file read results, ensuring the UI doesn't reserve space for expandable payloads that are no longer present.

2. Wrapping & Truncation Logic

  • Tool Name Retention: Modified the layout of DenseToolMessage to ensure tool names (up to 25 chars) are not truncated by long descriptions. The tool name now has flexShrink: 0, while the description uses flexShrink: 1 to fill the remaining space and truncate if necessary.
  • Single-Line Lock: Guaranteed that the tool name and description appear on the first line of the output, with the result summary allowed to wrap to a second line if space is limited.

Related Issues

Fixes #24634
Fixes #24644

How to Validate

  1. Compact View: Run a command that groups multiple grep_search or read_many_files calls. Verify they appear as single-line summaries without lists of matches/files.
  2. Truncation: Trigger a tool call with a very long description and a tool name < 25 chars. Verify the tool name remains fully visible while the description truncates.
  3. Verbiage: Run list_directory and verify the summary starts with "Found".
  4. Tests: Run npm test -w @google/gemini-cli and npm test -w @google/gemini-cli-core.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

…irectory

  - Remove multi-line payloads from the dense view of search and read_files tools to keep the UI compact.
  - Update list_directory summary/result text to use 'Found' instead of 'Listed' (consistent with verbiage from other tools).
@jwhelangoog jwhelangoog requested review from a team as code owners April 4, 2026 09:54
@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 refines the CLI's compact output mode to enhance readability and information density. By removing verbose multi-line payloads and standardizing terminology across various tools, the interface becomes cleaner and more consistent. Additionally, layout adjustments were implemented to ensure that tool names are prioritized and remain visible even when descriptions are long.

Highlights

  • Compact Mode Refinements: Removed multi-line match and file lists from dense/grouped views for grep and multi-file read tools to improve information density.
  • Consistent Verbiage: Updated the summary verbiage for directory listing tools from 'Listed' to 'Found' to ensure consistency across the CLI.
  • Layout and Truncation: Improved the layout of tool messages to prevent long descriptions from truncating tool names, ensuring tool names remain visible.
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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Size Change: -1.47 kB (0%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-DJ3KCY7M.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-I64H5SQM.js 0 B -3.15 MB (removed) 🏆
./bundle/core-5QYYRYFK.js 0 B -45.2 kB (removed) 🏆
./bundle/devtoolsService-I5PFXSEG.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-RGAWM3SE.js 0 B -1.64 MB (removed) 🏆
./bundle/oauth2-provider-5PSMK5YW.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-BWRJD2W2.js 3.15 MB +3.15 MB (new file) 🆕
./bundle/chunk-DTLGCYMU.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/core-K2EUWS7X.js 45.2 kB +45.2 kB (new file) 🆕
./bundle/devtoolsService-HDGBXLZX.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-S4RHKPKP.js 1.64 MB +1.64 MB (new file) 🆕
./bundle/oauth2-provider-REWZSWP2.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./bundle/bundled/third_party/index.js 8 MB
./bundle/chunk-34MYV7JD.js 2.45 kB
./bundle/chunk-5AUYMPVF.js 858 B
./bundle/chunk-5PS3AYFU.js 1.18 kB
./bundle/chunk-664ZODQF.js 124 kB
./bundle/chunk-DAHVX5MI.js 206 kB
./bundle/chunk-GFUOVHXW.js 1.96 MB
./bundle/chunk-IUUIT4SU.js 56.5 kB
./bundle/chunk-RJTRUG2J.js 39.8 kB
./bundle/devtools-36NN55EP.js 696 kB
./bundle/dist-T73EYRDX.js 356 B
./bundle/events-XB7DADIJ.js 418 B
./bundle/gemini.js 552 kB
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB
./bundle/memoryDiscovery-ACCRGPX3.js 980 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB
./bundle/src-QVCVGIUX.js 47 kB
./bundle/tree-sitter-7U6MW5PS.js 274 kB
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB

compressed-size-action

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 refactors the DenseToolMessage component to provide a more compact UI by removing detailed item lists, such as file lists and grep matches, from the output. It also updates the ls tool's summary terminology from 'Listed' to 'Found' and introduces a new test case for description truncation. Feedback was provided regarding a layout issue in DenseToolMessage.tsx where a missing flexShrink property on a wrapping Box could prevent the description from truncating correctly when terminal width is exceeded.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

58 tests passed successfully on gemini-3-flash-preview.

🧠 Model Steering Guidance

This PR modifies files that affect the model's behavior (prompts, tools, or instructions).

  • ⚠️ Consider adding Evals: No behavioral evaluations (evals/*.eval.ts) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.
  • 🚀 Maintainer Reminder: Please ensure that these changes do not regress results on benchmark evals before merging.

This is an automated guidance message triggered by steering logic signatures.

@gemini-cli gemini-cli bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Apr 4, 2026
- tool 'name' will not be truncated up to 25 chars
- tool invocation 'description' locks to first line of output (and truncates if nec)
- result 'summary' will appear on first line if space is available, otherwise can wrap to second line. (no content wrapping expected beyond second line)
@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from 286fde7 to 75506f3 Compare April 4, 2026 10:41
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 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup Edit tool compact output on tool failure Search text tool can generate large amounts of output [standard/compact formats]

1 participant