Conversation
Summary of ChangesHello @gundermanc, 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 addresses an issue where users might encounter 'message too large' errors by enhancing the chat compression service. The core improvement lies in its strategy for handling chat history when previous compression attempts have failed. Instead of completely bypassing compression, the service now intelligently applies truncation to reduce message size, thereby preventing repeated failures and optimizing resource usage, ultimately leading to a more robust messaging experience. Highlights
Changelog
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 aims to fix an issue where a message can be too large to send by improving the chat history compression logic. The change correctly removes the logic that prevented re-attempting compression after a failure. However, the new fallback logic for failed summarizations is incomplete and could lead to an unrecoverable state if the history is too large due to many small messages rather than large tool outputs. I've provided a critical suggestion to implement a more robust hard truncation fallback, ensuring the context size can always be managed and preventing the tool from getting stuck, aligning with the rule on preventing infinite loops in recursive handlers.
|
Size Change: +1.18 kB (0%) Total Size: 24.5 MB
ℹ️ View Unchanged
|
| @@ -285,6 +282,35 @@ export class ChatCompressionService { | |||
| config, | |||
| ); | |||
|
|
|||
| // If summarization previously failed (and not forced), we only rely on truncation. | |||
| // We do NOT attempt to invoke the LLM for summarization again to avoid repeated failures/costs. | |||
| if (hasFailedCompressionAttempt && !force) { | |||
There was a problem hiding this comment.
consider factoring this out into a helper
Summary
Fixes an issue where users can see an error message indicating that a message is too long to send.
Pre-Merge Checklist