-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Inline thinking bubbles with summary/full modes #18033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ffer and simplifying flushing logic via handleThoughtEvent
# Conflicts: # packages/cli/src/ui/components/MainContent.test.tsx # packages/cli/src/ui/components/MainContent.tsx # packages/cli/src/ui/hooks/useGeminiStream.ts
Summary of ChangesHello @LyalinDotCom, 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 significantly refines the user experience for displaying model thinking processes within the CLI. It transitions from a potentially disruptive display to a more organized, bubble-based interface. Users now have granular control over the level of detail shown for these thoughts, choosing between a concise summary or a comprehensive view, ensuring a more stable and visually clean interaction regardless of the terminal's operational mode. Highlights
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
|
|
Build failed: Build process failed (no specific link errors found). Check logs for details. |
There was a problem hiding this 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 introduces a significant improvement to the user experience by rendering model thoughts as individual, compact bubbles with distinct 'summary' and 'full' display modes. The implementation is well-structured, encompassing new settings, UI components, and updated documentation. My review has identified two high-severity issues: one concerning a behavioral inconsistency with a deprecated setting, and another related to unsafe string truncation that could corrupt Unicode characters in the UI.
| if (description.length <= MAX_THOUGHT_SUMMARY_LENGTH) { | ||
| return { subject: description, description: '' }; | ||
| } | ||
|
|
||
| const trimmed = description | ||
| .slice(0, MAX_THOUGHT_SUMMARY_LENGTH - 3) | ||
| .trimEnd(); | ||
| return { subject: `${trimmed}...`, description: '' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The summarizeThought function uses description.length and description.slice() for truncation. These methods operate on UTF-16 code units, which can lead to incorrect truncation and rendering of garbled text if the description contains multi-byte Unicode characters (like emojis or complex scripts). For example, an emoji consisting of a surrogate pair could be split in half. To handle Unicode correctly, you should operate on grapheme clusters, for instance by converting the string to an array using Array.from().
const descriptionGraphemes = Array.from(description);
if (descriptionGraphemes.length <= MAX_THOUGHT_SUMMARY_LENGTH) {
return { subject: description, description: '' };
}
const trimmed = descriptionGraphemes
.slice(0, MAX_THOUGHT_SUMMARY_LENGTH - 3)
.join('')
.trimEnd();
return { subject: `${trimmed}...`, description: '' };| if (ui?.showInlineThinking) { | ||
| return 'full'; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecated showInlineThinking setting is being mapped to 'full' mode. However, its description in settingsSchema.ts states it's for showing "model thinking summaries". This creates an inconsistency and changes the behavior for users who had this setting enabled, as they will now see full thoughts instead of summaries. For correct backward compatibility, it would be better to map this setting to 'summary' mode.
| if (ui?.showInlineThinking) { | |
| return 'full'; | |
| } | |
| if (ui?.showInlineThinking) { | |
| return 'summary'; | |
| } |
Summary
This PR improves inline thinking UX by rendering each thought as its own compact bubble and adding distinct summary/full settings for display.
Details
Related Issues
Related to #15052
How to Validate
Thinking Subject (summary):
Full Thinking Comments:
For both, test in both regular and alternate buffer modes: bubbles should render consistently during streaming and in history.
Note:
a. In the future we should consolidate the setting to one setting that supports an enum of options
b. We should explore with actual thought summaries using Flash-lite