feat(cli): improve /agents refresh logging#26442
Conversation
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 enhances the user experience for the agent refresh command by replacing a generic success message with a comprehensive summary of the reload operation. By tracking agent state changes and capturing errors during the loading process, the CLI now provides actionable feedback to users about the status of their local and remote agents. 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. Footnotes
|
|
Size Change: +1.21 kB (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request enhances the agent reload process by returning a detailed AgentReloadSummary, which includes counts for local and remote agents as well as lists of new and updated agents. The CLI has been updated to display this summary to the user. Review feedback suggests avoiding the use of a global event listener for error tracking to prevent race conditions in concurrent environments and recommends using metadata hashes instead of JSON stringification for more efficient and accurate detection of agent updates.
|
Size Change: +1.21 kB (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enhances the agent reload process by introducing an AgentReloadSummary that provides detailed information about the operation, including agent counts, lists of new or updated agents based on metadata hashes, and any errors encountered. The CLI UI is updated to present this summary to the user. Feedback points out redundant map clearing in the reload method and suggests optimizing the agent count calculation into a single pass. A security concern regarding the implementation of cryptographic hash verification for remote agents to prevent TOCTOU vulnerabilities was also raised.
a28f5fb to
7a5d7d6
Compare
|
/gemini review |
|
Size Change: +1.88 kB (+0.01%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
|
From Thanks for this PR! The detailed summary for the I noticed a few minor items that we should consider before merging:
Great work on improving the error collection and display! |
|
addressed all! |
|
✅ 69 tests passed successfully on gemini-3-flash-preview. 🧠 Model Steering GuidanceThis PR modifies files that affect the model's behavior (prompts, tools, or instructions).
This is an automated guidance message triggered by steering logic signatures. |
…nt consistent remote hashing
67e2a5a to
43bb8dc
Compare
Summary
This PR improves the logging and feedback provided by the
/agents refresh(and/agents reload) command. Instead of a generic success message, it now provides a detailed summary of the reload operation, including the total number of agents loaded (local vs. remote), names of new, updated, and deleted agents, and any errors encountered during loading.Details
AgentRegistry.reload()inpackages/coreto return anAgentReloadSummaryobject.AgentRegistryto identify new, updated, and deleted agents by comparing current state with previous state.clear()calls and implemented a single-pass loop for calculating summary statistics./agents listafter a successful refresh.Example Output
Running
/agents refreshnow provides detailed feedback:If errors occur during reload:
Related Issues
Closes #16272
How to Validate
/agents refresh.~/.gemini/agents/and run/agents refreshagain.npm test -w @google/gemini-cli-core -- src/agents/registry.test.tsnpm test -w @google/gemini-cli -- src/ui/commands/agentsCommand.test.tsPre-Merge Checklist