fix(patch): cherry-pick d351f07 to release/v0.18.0-preview.1-pr-12535 to patch version v0.18.0-preview.1 and create version 0.18.0-preview.2#13813
Conversation
Summary of ChangesHello @gemini-cli-robot, 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 automates the creation of a new patch release for the CLI, specifically addressing user experience improvements related to interactive shell tools. The core changes involve implementing an inactivity timer to provide visual cues to users when an interactive shell is waiting for input, and enhancing the loading indicator to reflect this state. These updates aim to make the interactive shell experience more intuitive and responsive by guiding users to focus on the shell when necessary. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces several UI enhancements, primarily focused on improving user feedback during tool execution and interactive shell sessions. A key change is the addition of a focus hint for interactive shells, which appears after a period of inactivity to guide the user. This is implemented using a new useInactivityTimer hook and by tracking the last output time from tools and shell commands. The logic for loading phrases has also been updated to prioritize this new actionable state. Additionally, some magic numbers have been refactored into constants, and user-facing messages for certain finish reasons have been clarified. Overall, these are solid improvements to the user experience. I have a couple of suggestions to improve the robustness of shell tool detection.
| const isThisShellFocused = | ||
| (name === SHELL_COMMAND_NAME || name === 'Shell') && | ||
| status === ToolCallStatus.Executing && | ||
| ptyId === activeShellPtyId && | ||
| embeddedShellFocused; |
There was a problem hiding this comment.
The logic to identify a shell tool is incomplete and uses a hardcoded string. It's missing a check for SHELL_TOOL_NAME (the internal tool name) and it hardcodes 'Shell' instead of using the SHELL_NAME constant. This could lead to inconsistent behavior for identifying shell tools.
To fix this, you should import SHELL_NAME from ../../constants.js and SHELL_TOOL_NAME from @google/gemini-cli-core and update the condition.
| const isThisShellFocused = | |
| (name === SHELL_COMMAND_NAME || name === 'Shell') && | |
| status === ToolCallStatus.Executing && | |
| ptyId === activeShellPtyId && | |
| embeddedShellFocused; | |
| const isThisShellFocused = | |
| (name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME) && | |
| status === ToolCallStatus.Executing && | |
| ptyId === activeShellPtyId && | |
| embeddedShellFocused; |
| const isThisShellFocusable = | ||
| (name === SHELL_COMMAND_NAME || name === 'Shell') && | ||
| status === ToolCallStatus.Executing && | ||
| config?.getEnableInteractiveShell(); |
There was a problem hiding this comment.
Similar to the check for isThisShellFocused, this condition is incomplete for identifying a shell tool. It should also check for SHELL_TOOL_NAME and use the SHELL_NAME constant instead of a hardcoded string to ensure all shell tools are correctly identified as focusable.
| const isThisShellFocusable = | |
| (name === SHELL_COMMAND_NAME || name === 'Shell') && | |
| status === ToolCallStatus.Executing && | |
| config?.getEnableInteractiveShell(); | |
| const isThisShellFocusable = | |
| (name === SHELL_COMMAND_NAME || name === SHELL_NAME || name === SHELL_TOOL_NAME) && | |
| status === ToolCallStatus.Executing && | |
| config?.getEnableInteractiveShell(); |
|
Size Change: +3.59 kB (+0.02%) Total Size: 21.1 MB
ℹ️ View Unchanged
|
843b019
into
release/v0.18.0-preview.1-pr-12535
This PR automatically cherry-picks commit d351f07 to patch version v0.18.0-preview.1 in the preview release to create version 0.18.0-preview.2.