fix: improve agent startup and error messages in CLI#2303
fix: improve agent startup and error messages in CLI#2303
Conversation
Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
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 AgentStack CLI by refining agent selection and log streaming functionalities. It introduces more precise error reporting for agent lookup failures and ambiguities, ensuring users receive actionable feedback. Additionally, it improves the flow of information during log streaming and agent startup, making the system's state more transparent and user-friendly. 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
Activity
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 improves error handling and startup messages in the CLI. The changes include more specific error messages for non-existent or ambiguous agents, a fix for a premature log announcement, and a clearer agent startup message. My review includes a suggestion to further improve the error message for ambiguous agents by displaying more user-friendly information, such as agent names, instead of just their IDs.
| if len(provider_candidates) == 0: | ||
| raise ValueError(f"No agents matched '{search_path}'") | ||
| if len(provider_candidates) > 1: | ||
| candidates_detail = "\n".join(f" - {c}" for c in provider_candidates) |
There was a problem hiding this comment.
The error message for multiple matching agents lists provider IDs, which are not very user-friendly. It would be more helpful to display the agent name and a short form of the ID to help the user distinguish between the ambiguous options.
| candidates_detail = "\n".join(f" - {c}" for c in provider_candidates) | |
| candidates_detail = "\n".join(f" - {p.agent_card.name} ({p.id[:8]})" for p in provider_candidates.values()) |
Summary
agentstack logs chatanow showsNo agents matched 'chata'instead ofValueError: 0 matching agentsMultiple agents matched '<name>'with a list of candidatesTest plan
mise run checkpasses🤖 Generated with Claude Code