Skip to content

fix: improve agent startup and error messages in CLI#2303

Open
jezekra1 wants to merge 1 commit intomainfrom
agent-startup-and-error-messages
Open

fix: improve agent startup and error messages in CLI#2303
jezekra1 wants to merge 1 commit intomainfrom
agent-startup-and-error-messages

Conversation

@jezekra1
Copy link
Collaborator

@jezekra1 jezekra1 commented Mar 6, 2026

Summary

  • Better error for non-existent agents: agentstack logs chata now shows No agents matched 'chata' instead of ValueError: 0 matching agents
  • Better error for ambiguous matches: Shows Multiple agents matched '<name>' with a list of candidates
  • Fix premature announce: "Streaming logs for..." message now appears only after the agent is found, and shows the actual agent name instead of the search string
  • Better startup message: Changed "Provider is not running, run a query to start it up..." to "Agent is starting up..."

Test plan

  • mise run check passes
  • No Docs Needed

🤖 Generated with Claude Code

Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 6, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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

  • Improved Error Messages: Enhanced error messages for agent selection in the CLI, providing clearer feedback when no agents match or when multiple agents are found for a given search term.
  • Corrected Log Streaming Announcement: Fixed the timing of the 'Streaming logs for...' message to appear only after a specific agent has been successfully identified, using the agent's actual name.
  • Clarified Agent Startup Message: Updated the startup message displayed when an agent is initializing for better clarity and user understanding.

🧠 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
  • apps/agentstack-cli/src/agentstack_cli/commands/agent.py
    • Refactored select_provider to differentiate between zero and multiple matching agents, providing specific error messages for each case.
    • Adjusted the stream_logs function to delay the 'Streaming logs for...' announcement until after a unique agent is selected, using the agent's actual name.
  • apps/agentstack-server/src/agentstack_server/infrastructure/kubernetes/provider_deployment_manager.py
    • Updated the log message for a starting agent from 'Provider is not running, run a query to start it up...' to 'Agent is starting up...'.
Activity
  • The pull request includes a test plan with mise run check passing.
  • No documentation updates were deemed necessary for these changes.
  • The changes were generated with Claude Code.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant