Skip to content

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

Merged
jwhelangoog merged 2 commits intomainfrom
feature/tool-output/compact-tuning
Apr 9, 2026
Merged

feat(cli): refine tool output formatting for compact mode#24677
jwhelangoog merged 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

@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.44 kB (0%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-3JRRQRVB.js 0 B -3.47 kB (removed) 🏆
./bundle/chunk-5LUDAEVF.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-H26I6HD5.js 0 B -3.16 MB (removed) 🏆
./bundle/core-UVAZNV26.js 0 B -45.4 kB (removed) 🏆
./bundle/devtoolsService-WBMJRVJ4.js 0 B -28.4 kB (removed) 🏆
./bundle/gemini-IMPW5KNU.js 0 B -552 kB (removed) 🏆
./bundle/interactiveCli-4AV62EGE.js 0 B -1.65 MB (removed) 🏆
./bundle/oauth2-provider-S4VN63UD.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-CTDABT72.js 3.16 MB +3.16 MB (new file) 🆕
./bundle/chunk-IHTNRSZF.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/chunk-WPJZTEDC.js 3.47 kB +3.47 kB (new file) 🆕
./bundle/core-KLLK7O7M.js 45.4 kB +45.4 kB (new file) 🆕
./bundle/devtoolsService-UFSTW5FG.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/gemini-WGTEPJVX.js 552 kB +552 kB (new file) 🆕
./bundle/interactiveCli-NUEMSKJB.js 1.64 MB +1.64 MB (new file) 🆕
./bundle/oauth2-provider-WCGK63XD.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-OGWWODAT.js 1.96 MB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-5T5252XQ.js 0 B -856 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/gemini.js 4.97 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-JNNGTYL3.js 980 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-6JU2ED7I.js 856 B +856 B (new file) 🆕

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

64 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
@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from 286fde7 to 75506f3 Compare April 4, 2026 10:41
@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from 75506f3 to cbc29bf Compare April 6, 2026 18:56
@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from cbc29bf to 6113f55 Compare April 6, 2026 19:11
@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from 6113f55 to ea4244d Compare April 6, 2026 20:10
@jwhelangoog
Copy link
Copy Markdown
Contributor Author

Review for PR 24677

Overall, this is a fantastic UI refinement for the compact mode. Reducing the noise from multi-file read tools and grep_search is a big win for information density.

A few specific highlights:

  • Layout Management: Utilizing flexShrink: 0 for the tool name and flexShrink: 1 for the description is a very clean and idiomatic way to handle terminal width constraints in Ink while preserving essential context.
  • Consistency: Unifying the search result verbiage (list_directory -> "Found") improves the overall cohesiveness of the tool output.
  • Testing: The new test cases using renderWithProviders and checking the layout truncation logic are well implemented and follow the project's testing conventions.

One minor observation:

  • CI Failures: I noticed that E2E (Chained) and a Windows slow test are currently failing on the PR. It might be worth a quick check to see if changing the list_directory summary text from "Listed" to "Found" tripped up any existing E2E snapshot assertions that were looking for the old string.

@jwhelangoog jwhelangoog force-pushed the feature/tool-output/compact-tuning branch from 192c79e to 6e9e75a Compare April 7, 2026 16:32
Copy link
Copy Markdown
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

…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).
- 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 6e9e75a to f2e2bcf Compare April 9, 2026 03:00
@jwhelangoog jwhelangoog enabled auto-merge April 9, 2026 03:18
@jwhelangoog jwhelangoog added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit faa7a9d Apr 9, 2026
29 checks passed
@jwhelangoog jwhelangoog deleted the feature/tool-output/compact-tuning branch April 9, 2026 03:43
student-ankitpandit pushed a commit to student-ankitpandit/gemini-cli that referenced this pull request Apr 9, 2026
flexponsive pushed a commit to flexponsive/gemini-cli that referenced this pull request Apr 9, 2026
warrenzhu25 pushed a commit to warrenzhu25/gemini-cli that referenced this pull request Apr 9, 2026
theerud pushed a commit to theerud/gemini-cli that referenced this pull request Apr 10, 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 🔒 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]

3 participants