Skip to content

feat(api): add SandboxTemplate and Sandbox contracts - #2959

Merged
EItanya merged 5 commits into
mainfrom
feat/sandbox-apis
Sep 26, 2026
Merged

EItanya merged 5 commits into
mainfrom
feat/sandbox-apis

Conversation

@EItanya

@EItanya EItanya commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds API contracts for standalone sandboxes that users and agents can use as scratch environments.

  • Add the SandboxTemplate CRD and catalog service, including validation, generated CRDs, and Kubernetes clients. Templates remain independent of Harness.
  • Add SandboxService lifecycle contracts and shared RuntimeState / RuntimeOperation enums.
  • Reuse the upstream env process and filesystem contracts, with kagent-sandbox-id metadata identifying the target sandbox.

This is the first of two stacked PRs. Service registration, runtime behavior, and Session adoption of the shared enums follow in #2960, which is stacked on this branch.

Validation: go test ./api/... ./core/... passed, including PostgreSQL and CRD validation tests. make proto-check and make proto-breaking passed with no generated drift.

Add the v1alpha3 resource, validation, generated CRDs and Kubernetes clients, and protobuf catalog contracts. Keep service registration and runtime preparation in the implementation stack.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Define standalone sandbox lifecycle requests, shared runtime enums, and the sandbox routing metadata key. Pin the env process and filesystem descriptors and generate clients without registering runtime services. Session adoption of the shared enums follows in the implementation stack.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@github-actions github-actions Bot added the enhancement New feature or request label Sep 26, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 26, 2026
@EItanya
EItanya marked this pull request as ready for review September 26, 2026 21:12
@EItanya
EItanya requested review from a team, Charlesthebird and peterj as code owners September 26, 2026 21:12
@EItanya
EItanya added this pull request to stack #2961 September 26, 2026 21:15
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya
EItanya merged commit 413ea93 into main Sep 26, 2026
29 checks passed
@EItanya
EItanya deleted the feat/sandbox-apis branch September 26, 2026 22:28
EItanya added a commit that referenced this pull request Sep 26, 2026
This PR implements standalone sandboxes so users and agents can create a
scratch environment from a `SandboxTemplate`, run commands, move files,
and suspend, resume, or delete it. It uses the API contracts merged in
#2959.

- Prepare pinned Substrate runtimes through KRT and run the env guest
with a durable workspace.
- Share runtime revision and instance persistence through Session and
Sandbox extensions, and move Sessions onto the shared lifecycle enums.
- Execute lifecycle mutations inline with client retries. Expiration
remains automatic, and sandbox suspension can interrupt running
processes or transfers.
- Expose lifecycle and upstream env process/file services through the
apiserver, plus tools on the existing MCP endpoint. Helm installs a
`kagent-api` RemoteMCPServer so agents can opt into these tools through
their existing bindings.
- Include ownership checks, explicit Agent routing in the UI, and
architecture and retry documentation.

The schema changes are folded into the initial migration for pre-alpha
and require a fresh database.

Validation: core tests, PostgreSQL store and migration tests (including
inline SQL preparation), in-process guest/gRPC/MCP tests, protobuf
generation, and lint passed. The latest Helm changes passed all 366
chart tests and Helm lint; the E2E package compiles and passes focused
Go lint. Live-cluster E2E coverage is included, but the latest changes
have not been run against a live cluster.

---------

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
alexdarbyshire pushed a commit to alexdarbyshire/kagent that referenced this pull request Oct 5, 2026
This PR adds API contracts for standalone sandboxes that users and
agents can use as scratch environments.

- Add the `SandboxTemplate` CRD and catalog service, including
validation, generated CRDs, and Kubernetes clients. Templates remain
independent of `Harness`.
- Add `SandboxService` lifecycle contracts and shared `RuntimeState` /
`RuntimeOperation` enums.
- Reuse the upstream env process and filesystem contracts, with
`kagent-sandbox-id` metadata identifying the target sandbox.

This is the first of two stacked PRs. Service registration, runtime
behavior, and Session adoption of the shared enums follow in kagent-dev#2960,
which is stacked on this branch.

Validation: `go test ./api/... ./core/...` passed, including PostgreSQL
and CRD validation tests. `make proto-check` and `make proto-breaking`
passed with no generated drift.

---------

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
alexdarbyshire pushed a commit to alexdarbyshire/kagent that referenced this pull request Oct 5, 2026
This PR implements standalone sandboxes so users and agents can create a
scratch environment from a `SandboxTemplate`, run commands, move files,
and suspend, resume, or delete it. It uses the API contracts merged in
kagent-dev#2959.

- Prepare pinned Substrate runtimes through KRT and run the env guest
with a durable workspace.
- Share runtime revision and instance persistence through Session and
Sandbox extensions, and move Sessions onto the shared lifecycle enums.
- Execute lifecycle mutations inline with client retries. Expiration
remains automatic, and sandbox suspension can interrupt running
processes or transfers.
- Expose lifecycle and upstream env process/file services through the
apiserver, plus tools on the existing MCP endpoint. Helm installs a
`kagent-api` RemoteMCPServer so agents can opt into these tools through
their existing bindings.
- Include ownership checks, explicit Agent routing in the UI, and
architecture and retry documentation.

The schema changes are folded into the initial migration for pre-alpha
and require a fresh database.

Validation: core tests, PostgreSQL store and migration tests (including
inline SQL preparation), in-process guest/gRPC/MCP tests, protobuf
generation, and lint passed. The latest Helm changes passed all 366
chart tests and Helm lint; the E2E package compiles and passes focused
Go lint. Live-cluster E2E coverage is included, but the latest changes
have not been run against a live cluster.

---------

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