gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Tool summarizer overly aggressive for data access commands

Open bbiggs opened this issue 1 year ago • 5 comments

What happened?

The shell summarizer added in 23197151c2384c3ef9b72e3c83b6e0d87d738d14 prevents gemini-cli from making full use of the output of commands that read files or provide context to the model. For example, if you ask gemini-cli:

Please run 'git show 23197151c2384c3ef9b72e3c83b6e0d87d738d14' and perform a thorough code review of the change.

Neither the text of the question asked, nor the previous context from the session, are provided to the summarizer. Hence, the summary output is insufficient for the model to perform the task of code reviewing.

What did you expect to happen?

Possible solutions here could be:

  1. Provide the full conversation to the summarizer call and adjust the prompt to decide whether summarization is appropriate.
  2. Create a summarization for display to the user in the UI, but provide the full tool output to the model.
  3. Adjust the prompt to ask the model to only summarize boilerplate or redundant output from the tool.

The feature does break a set of functionality where the model interacts with commands intended to provide rich data or context to the model, such as git show or git diff, hence we could consider disabling the feature until a good solution is found.

Client information

```console │ CLI Version 0.1.12 │ │ Git Commit b018e2d3 (local modifications) │ │ Model gemini-2.5-pro │ │ Sandbox no sandbox │ │ OS darwin │ │ Auth Method OAuth │ ```

Login information

No response

Anything else we need to know?

No response

bbiggs avatar Jul 13 '25 22:07 bbiggs

affected too over here.

I suggest rolling back and running some quick SxS evals to see how this change impacts certain workflows that rely on data retrieval (in my case is documentation analysis and this removes much of the labels I need to have).

rmedranollamas avatar Jul 14 '25 09:07 rmedranollamas

I just save anything to file first and have ♊ run Unix shell based tools on it. Gemini also calls other LLMs too now and then, instead. Summarizer, well, summarizes, to save the tokens, and the GUI would be cluttered if it be shown. If needed very much, to debug, I ask ♊ to quote what summarize tool said.

Manamama avatar Jul 14 '25 10:07 Manamama

PR 4140 adds this as a setting.

bbiggs avatar Jul 16 '25 13:07 bbiggs

I noticed this issue because Gemini started hallucinating shell outputs to me. Since it couldn't actually see the output, it just constructed something plausible from the summary, but told me that it was giving me the real output.

To add some further suggestions:

  • Make the model aware of the summarizing behavior from the start, so that it doesn't make plans which depend on seeing long tool outputs in the first place.
  • Add a way for the model to control the summarizer. This could be a simple flag whether summarizing should happen at all, a desired maximum output length, or even custom instructions that are passed to the summarizer to tell it what the main model needs from the output.

Medo42 avatar Jul 18 '25 22:07 Medo42

We have an updated tool summarizer which writes to a local file and only shows a limited set of output lines. Closing this bug for now.

anj-s avatar Oct 14 '25 14:10 anj-s