Skip to content

feat(cli): add API v2 AgentInstance workflows - #2559

Open
codyhartsook wants to merge 6 commits into
kagent-dev:mainfrom
codyhartsook:api-v2-cli-pr1-split
Open

feat(cli): add API v2 AgentInstance workflows#2559
codyhartsook wants to merge 6 commits into
kagent-dev:mainfrom
codyhartsook:api-v2-cli-pr1-split

Conversation

@codyhartsook

@codyhartsook codyhartsook commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • Adds API v2 CLI commands for AgentTemplate discovery and AgentInstance lifecycle and invocation
  • Adds typed AgentInstance and upstream A2A clients over the shared gRPC connection
  • Connects through configured gRPC or a temporary controller port-forward, with optional TLS
  • Removes the legacy client-side agent project workflow while retaining mcp

Note that of the 64 files changed, 35 were removals from the legacy CLI project workflow ; no server-side APIs or controllers are removed.

This is the first of three related CLI PRs:

  1. #2559 : API v2 CLI foundation: template/instance discovery, create/delete, invoke/streaming, JSON output, and quarantining legacy commands.
  2. #2605 : TUI: browse AgentInstances, load history, and chat through the same A2A path as invoke.
  3. #2606 : Cleanup: simplify main.go and align the command structure with agentregistry.

Suspend and resume are deliberately not exposed by this CLI work.

Related to #2366 and the K13 CLI cutover in docs/plans/api-v2-execution-plan.md.

Test plan

  • make -C go test
  • go test ./core/cli/...
  • make -C go lint
  • make -C go build
  • AgentTemplate and AgentInstance CLI smoke test against a local installation

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 25, 2026
@codyhartsook
codyhartsook marked this pull request as ready for review August 25, 2026 23:57
@codyhartsook
codyhartsook requested a review from a team as a code owner August 25, 2026 23:57

@EItanya EItanya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Initial review, I'm still looking for more simplifications, but this is a good start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This API is still technically supported. Is there a way we can retain this functionality?

@codyhartsook codyhartsook Aug 26, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

tracing this again, the wizard was only used by the removed add-mcp command and wrote to the legacy kagent.yaml project workflow. From my understanding, I think it should remain deleted, with AgentTemplate manifests as the mcp binding but open to suggestions

}

func prepareCreateCfg(cfg *CreateCfg) error {
if cfg.Harness == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The following just merged: 76cde41

We can get this out of clientside code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, done. I removed the client-side create/delete validation and left that to the shared Protovalidate interceptor. The CLI just generates a request ID when one is not supplied.

Comment thread go/core/cli/internal/config/config.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we please delete this file and viper, it's just complicated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I removed the internal config package and Viper/ishell from the CLI. Root flags now pass through a small explicit connection options struct. Viper still shows up indirectly through the lint tooling, but the CLI no longer uses it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

note that the code line count decreased but added some file change churn, fyi to reviewers

@codyhartsook
codyhartsook requested a review from EItanya August 26, 2026 16:39
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
Signed-off-by: Cody Hartsook <cody.hartsook@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants