feat(cli): context-aware agent spawn with agent catalog and auth preflight#2409
Draft
nikhilachale wants to merge 13 commits into
Draft
feat(cli): context-aware agent spawn with agent catalog and auth preflight#2409nikhilachale wants to merge 13 commits into
nikhilachale wants to merge 13 commits into
Conversation
…kspace components
…sBoard components
…nonical-handoff # Conflicts: # frontend/src/renderer/components/ProjectSettingsForm.test.tsx # frontend/src/renderer/components/ProjectSettingsForm.tsx # frontend/src/renderer/components/SessionsBoard.tsx # frontend/src/renderer/types/workspace.ts
- Implemented `ao agent ls` command to list supported agents and their installation/auth readiness. - Added `--refresh` flag to refresh local install/auth probes before listing agents. - Introduced JSON output option with `--json` for raw agent catalog response. - Updated tests to cover new agent command functionality, including cached catalog usage and refresh behavior. - Enhanced error handling and output formatting for better user experience.
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
This branch adds a CLI-facing agent catalog command and makes
ao spawnmore context-aware for direct shell usage. The main goal is to let users start worker sessions without always passing every low-level flag, while still keeping the CLI thin and daemon-backed.What Changed
Added
ao agent lsNew command:
Behavior:
ao agent lscallsGET /api/v1/agents.ao agent ls --refreshcallsPOST /api/v1/agents/refresh.ao agent ls --jsonprints the raw agent inventory response.authorizedauth unknownneeds authneeds installNo new backend API was added — this reuses the existing agent catalog endpoints.
Made
ao spawncontext-awareao spawnno longer requires--project,--agent, and--namein every direct CLI invocation.Supported paths now include:
Project resolution order:
--projectAO_PROJECT_IDAgent resolution order:
--agent/--harnessworker.agentDisplay name behavior:
--namestill works and is still capped at 20 characters.--nameis omitted, the CLI derives a short display name from--prompt.displayNameand lets the API/UI fall back to session id.Added spawn auth preflight
Before calling
POST /api/v1/sessions,ao spawnnow checks the agent catalog:Spawn remains the final authority for runtime/binary/model failures.
Updated docs
Updated CLI documentation to cover:
ao agent ls,ao agent ls --refresh,ao agent ls --jsonao spawnproject resolution behaviorao spawndefaultworker.agentbehaviorThe root README now links to the CLI guide instead of duplicating detailed command instructions.
Files Changed
Main implementation:
backend/internal/cli/agent.gobackend/internal/cli/root.gobackend/internal/cli/spawn.goTests:
backend/internal/cli/agent_test.gobackend/internal/cli/spawn_test.gobackend/internal/cli/dto_drift_e2e_test.goDocs:
README.mddocs/cli/README.mdTesting
Passed:
Manually verified with the local built binary:
Notes