Skip to content

feat: add sandbox workflows and group agent commands - #2966

Merged
EItanya merged 6 commits into
mainfrom
feat/sandbox-cli-agent-guidance
Sep 27, 2026
Merged

EItanya merged 6 commits into
mainfrom
feat/sandbox-cli-agent-guidance

Conversation

@EItanya

@EItanya EItanya commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Agents can now use standalone Sandboxes for their own scripts, tests, and file processing through kagent sandbox. Template discovery, lifecycle, execution, and file transfer live under that command so the full workflow is discoverable through one help entry.

Agent commands follow the same grouping:

  • kagent agent list and kagent agent get NAME discover agent definitions.
  • kagent agent invoke --session ID --task ... invokes an existing conversation through A2A.
  • kagent agent session create, list, get, and delete manage conversations.
  • kagent agent template list and get discover reusable AgentTemplates.

These replace the previous top-level get, create, delete, and invoke paths. List commands own pagination flags, and get commands require an explicit name or ID. apply -f FILE remains shared by Agents and AgentTemplates. The skill, TUI hints, documentation, and CLI E2E tests use the new paths. Existing transports are preserved: agent/template discovery uses Kubernetes, session lifecycle uses the kagent API, and invocation uses the gateway.

The sandbox CLI uses the existing authenticated connection and calls the lifecycle, process, and filesystem gRPC APIs directly. File transfers stream up to the API's 64 MiB limit. Creation requires a retained request ID, process starts are never automatically retried, and interrupted waits preserve the process ID and output offsets. Execution returns the remote exit code, supports JSON events, and downloads replace the local destination only after a complete transfer.

The kagent skill walks agents through choosing an environment, staging inputs, verifying results, collecting artifacts, and cleanup. It prefers the configured CLI when available and includes exact MCP examples. The MCP server advertises workflow instructions, expands tool descriptions, and adds sandbox-task and sandbox-recovery prompts. Clients must request these prompts; tool descriptions carry the essential guidance for clients that only consume tools.

Validation:

  • go test -race ./api/client ./core/cli/... ./core/internal/mcp passed, including binary transfers larger than 1 MiB, interrupted transfers/waits, and a smoke test against the upstream guest library. CLI tests cover the command paths, required targets, pagination flags, and inherited output settings.
  • Lint passed with zero issues for ./api/client ./core/cli/... ./core/internal/mcp ./core/test/e2e. CLI build, skill validation, and git diff --check passed.
  • Sandbox lifecycle, execution, suspend/resume, and durable binary transfer passed in CI, along with the agent catalog, session lifecycle, and invocation E2E cases.
  • HTTP streaming E2E tests now follow the existing explicit send-rejection contract: retry the same message only before any event and only when the gateway proves it was not accepted. Regression tests exercise JSON-RPC error decoding, request identity, ambiguous errors, partial streams, consumer cancellation, and deadlines. These pass with the race detector; E2E-package lint reports zero issues. The full live E2E suite and all PR checks passed on 8482b1c2 (CI run).

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya
EItanya requested a review from a team as a code owner September 27, 2026 11:56
@github-actions github-actions Bot added the enhancement New feature or request label Sep 27, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 27, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 27, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 27, 2026
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya EItanya changed the title feat: add sandbox CLI and agent guidance feat: add sandbox workflows and group agent commands Sep 27, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 27, 2026
@blacksmith-sh

This comment has been minimized.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 27, 2026
@EItanya
EItanya merged commit 5202687 into main Sep 27, 2026
33 checks passed
@EItanya
EItanya deleted the feat/sandbox-cli-agent-guidance branch September 27, 2026 12:59
alexdarbyshire pushed a commit to alexdarbyshire/kagent that referenced this pull request Oct 5, 2026
Agents can now use standalone Sandboxes for their own scripts, tests,
and file processing through `kagent sandbox`. Template discovery,
lifecycle, execution, and file transfer live under that command so the
full workflow is discoverable through one help entry.

Agent commands follow the same grouping:

- `kagent agent list` and `kagent agent get NAME` discover agent
definitions.
- `kagent agent invoke --session ID --task ...` invokes an existing
conversation through A2A.
- `kagent agent session create`, `list`, `get`, and `delete` manage
conversations.
- `kagent agent template list` and `get` discover reusable
AgentTemplates.

These replace the previous top-level `get`, `create`, `delete`, and
`invoke` paths. List commands own pagination flags, and get commands
require an explicit name or ID. `apply -f FILE` remains shared by Agents
and AgentTemplates. The skill, TUI hints, documentation, and CLI E2E
tests use the new paths. Existing transports are preserved:
agent/template discovery uses Kubernetes, session lifecycle uses the
kagent API, and invocation uses the gateway.

The sandbox CLI uses the existing authenticated connection and calls the
lifecycle, process, and filesystem gRPC APIs directly. File transfers
stream up to the API's 64 MiB limit. Creation requires a retained
request ID, process starts are never automatically retried, and
interrupted waits preserve the process ID and output offsets. Execution
returns the remote exit code, supports JSON events, and downloads
replace the local destination only after a complete transfer.

The kagent skill walks agents through choosing an environment, staging
inputs, verifying results, collecting artifacts, and cleanup. It prefers
the configured CLI when available and includes exact MCP examples. The
MCP server advertises workflow instructions, expands tool descriptions,
and adds `sandbox-task` and `sandbox-recovery` prompts. Clients must
request these prompts; tool descriptions carry the essential guidance
for clients that only consume tools.

Validation:

- `go test -race ./api/client ./core/cli/... ./core/internal/mcp`
passed, including binary transfers larger than 1 MiB, interrupted
transfers/waits, and a smoke test against the upstream guest library.
CLI tests cover the command paths, required targets, pagination flags,
and inherited output settings.
- Lint passed with zero issues for `./api/client ./core/cli/...
./core/internal/mcp ./core/test/e2e`. CLI build, skill validation, and
`git diff --check` passed.
- Sandbox lifecycle, execution, suspend/resume, and durable binary
transfer passed in CI, along with the agent catalog, session lifecycle,
and invocation E2E cases.
- HTTP streaming E2E tests now follow the existing explicit
send-rejection contract: retry the same message only before any event
and only when the gateway proves it was not accepted. Regression tests
exercise JSON-RPC error decoding, request identity, ambiguous errors,
partial streams, consumer cancellation, and deadlines. These pass with
the race detector; E2E-package lint reports zero issues. The full live
E2E suite and all PR checks passed on `8482b1c2` ([CI
run](https://github.com/kagent-dev/kagent/actions/runs/36319766198)).

---------

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
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.

1 participant