Conversation
… into cli_activeskill
2. token statistics 3. generate code step by step, forbid super large code generation in one step
2. support stream with claude
Summary of ChangesHello, 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 enhances the user experience of the CLI by introducing real-time streaming of agent responses with detailed token usage statistics, making interactions more dynamic and transparent. It also bolsters the CLI's stability through improved interrupt handling and refines agent behavior with updated prompting guidelines, leading to more predictable and controlled execution of tasks. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 introduces a significant enhancement to the CLI by adding a real-time streaming interface for agent interactions, complete with token usage statistics. The changes also include substantial improvements to user experience, such as more graceful handling of keyboard interrupts and cleaner exit behavior. Additionally, several agent prompts have been refined to provide clearer instructions and constraints, which should improve agent performance and reliability. My review includes a couple of suggestions to enhance the robustness of the new streaming logic and error handling.
| except Exception: | ||
| pass |
There was a problem hiding this comment.
Using a bare except Exception: pass is generally discouraged as it can silently swallow any and all errors, making debugging difficult. It would be more robust to catch specific expected exceptions (e.g., AttributeError) or at least log the exception that was caught.
except Exception as e:
logger.debug(f"Could not get prompt buffer content on interrupt: {e}")
pass| for tc in chunk.tool_calls: | ||
| if tc.function.name == "unknown" and llm_response.tool_calls: | ||
| last = llm_response.tool_calls[-1] | ||
| last.function.arguments = (last.function.arguments or "") + (tc.function.arguments or "") | ||
| else: | ||
| llm_response.tool_calls.append(tc) |
There was a problem hiding this comment.
The logic to merge tool call arguments for chunks with tc.function.name == "unknown" seems fragile. It assumes that such a chunk always belongs to the immediately preceding tool call. This might not hold true if tool call chunks arrive out of order or if a new tool call starts with an "unknown" name. This could lead to incorrectly merged arguments. Consider making this logic more robust, for example by using the tool call index (if available from the provider) to ensure arguments are appended to the correct tool call.
2.1 llm_agent output chunk, ignore empty chunk
2.2 token statistics
2.3 tool_calls array type parameter