fix(cli): show agent list before setting a session model#2910
Merged
tusharmath merged 6 commits intomainfrom Apr 9, 2026
Merged
fix(cli): show agent list before setting a session model#2910tusharmath merged 6 commits intomainfrom
tusharmath merged 6 commits intomainfrom
Conversation
…in agent conversion
: command autocomplete not working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce
AgentInfo— a lightweight agent metadata type — so the command list, agent switching, and agent listing no longer require a fully configured provider/model session to work.Context
Previously, fetching agents for the command autocomplete list (
/agent,/switch, etc.) calledget_agents(), which internally resolved the default provider and model from the active session. This meant the command list would fail or be empty whenever no session was configured — a common state when a user first opens a fresh workspace or hasn't yet set a default model. The branch namebug-command-listreflects this: colon-command autocomplete was broken because listing agents required a session that didn't always exist.Changes
AgentInfostruct toforge_domainwith onlyid,title, anddescription— the fields needed for listing, no provider/model requiredget_agent_infos()toAgentRepository,AgentRegistry, and theAPItrait alongside the existingget_agents()ForgeAgentRepository::get_agents()so it happens only when a fullAgentis truly needed (e.g., running the agent)command list,agent switch,show agents,register_agent_commands) to use the newget_agent_infos()services_urlparameter fromForgeAPI::initandForgeInfra::new— the URL is now read directly from config at construction time, eliminating the early URL-validation step inmain.rsGrpcInfra::channel()to returnanyhow::Result<Channel>instead of panicking, propagating URL-parse errors properlyForgeGrpcClientto store the server URL as aString(parsed lazily when a channel is first needed) and returnResultfromchannel()Key Implementation Details
AgentInfois derived fromAgentDefinitionbefore any provider/model injection, soget_agent_infos()never touches the session config.get_agents()still resolves the session in the repository layer (ForgeAgentRepository), keeping that concern out of the service layer (AgentRegistryService).Use Cases
/agent:,/switch) works immediately on startup even when no default session/provider is configuredagentssubcommand (/agentslisting) no longer errors out on unconfigured workspacesTesting
Links