Tool summarizer overly aggressive for data access commands
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:
- Provide the full conversation to the summarizer call and adjust the prompt to decide whether summarization is appropriate.
- Create a summarization for display to the user in the UI, but provide the full tool output to the model.
- 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
Login information
No response
Anything else we need to know?
No response
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).
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.
PR 4140 adds this as a setting.
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.
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.