Skip to content

feat(sandbox): adopt env guest service redesign - #3148

Merged
EItanya merged 1 commit into
kagent-dev:mainfrom
thomasbarrett:feat/env-guest-redesign
Oct 21, 2026
Merged

EItanya merged 1 commit into
kagent-dev:mainfrom
thomasbarrett:feat/env-guest-redesign

Conversation

@thomasbarrett

@thomasbarrett thomasbarrett commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Moves agent-substrate/env to 0d359ea and updates the sandbox gRPC API, Go client, CLI, MCP tools, and generated schema to match the redesigned guest services.

MCP process responses now omit exit_code while running and include it after exit, including 0 for success. ReadFile requests with a nonzero mode require update permission because the guest can create a missing file. Stdin forwarding remains disabled.

Breaking changes:

  • Delete existing sandboxes before upgrading; the old guest wire protocol is incompatible.
  • Process responses use state (PROCESS_STATE_RUNNING or PROCESS_STATE_EXITED) instead of status.
  • kill_sandbox_process and kagent sandbox kill acknowledge SIGKILL delivery. Use get_sandbox_process or kagent sandbox wait for the exit code.
  • SignalProcess replaces KillProcess; StreamProcessOutput replaces StreamProcessOutputs. CLI JSON output records use source: "stdout" or "stderr".

Validation: focused Go tests with the real guest and PostgreSQL, race tests for the CLI/MCP/sandbox service/guest, Go lint, protobuf lint/generation/compatibility, and E2E compilation. Added coverage for MCP exit reporting, CLI kill/wait, stream exit messages, file authorization, and rejected stdin forwarding. Full cluster E2E remains for CI.

@thomasbarrett
thomasbarrett requested review from a team and Charlesthebird as code owners October 10, 2026 19:03
@thomasbarrett thomasbarrett changed the title feat(sandbox)!: move to env's redesigned guest services feat(sandbox): move to env's redesigned guest services Oct 10, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Oct 10, 2026
@thomasbarrett
thomasbarrett marked this pull request as draft October 10, 2026 19:09
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 10, 2026
@EItanya

EItanya commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Hey, are you going to finish this PR, I'm interested in moving the service forward

Comment thread go/core/internal/mcp/sandboxes.go Outdated
ProcessID string `json:"process_id"`
Status string `json:"status"`
State string `json:"state"`
ExitCode int32 `json:"exit_code"`

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.

exit_code 0 here reads as success while still running

@thomasbarrett

thomasbarrett commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Hey, are you going to finish this PR, I'm interested in moving the service forward

Blah, sorry @EItanya, haven't had a chance to test this super thoroughly. Will have some time this weekend, but I wouldn't be offended if you pushed ur own upgrade first

Upgrade agent-substrate/env to 0d359ea and adapt the guest transport,
Go client, CLI, MCP tools, vendored schema, and generated TypeScript.

Report process state using RUNNING/EXITED and omit MCP exit_code until
exit. Require update permission when ReadFile mode can create a file.
Keep stdin forwarding disabled and preserve signal delivery semantics.

Rebase Thomas Barrett's original work onto current main, retaining the
newer MCP file handling, API packages, and lifecycle coverage. Add
regressions for exit reporting, SIGKILL, stdin denial, and file access.

BREAKING CHANGE: existing sandboxes must be deleted before upgrading.
The guest wire contract changes; process status becomes state, and kill
acknowledges SIGKILL delivery rather than waiting for an exit code.

Co-authored-by: Thomas Barrett <thomas@fluidstack.io>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya
EItanya force-pushed the feat/env-guest-redesign branch from 34ea9b7 to 92d4072 Compare October 20, 2026 21:45
@EItanya EItanya changed the title feat(sandbox): move to env's redesigned guest services feat(sandbox)!: adopt env guest service redesign Oct 20, 2026
@github-actions github-actions Bot removed the enhancement New feature or request label Oct 20, 2026
@EItanya EItanya changed the title feat(sandbox)!: adopt env guest service redesign feat(sandbox): adopt env guest service redesign Oct 20, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Oct 20, 2026
@EItanya
EItanya marked this pull request as ready for review October 21, 2026 23:02
@EItanya
EItanya added this pull request to the merge queue Oct 21, 2026
Merged via the queue into kagent-dev:main with commit b672187 Oct 21, 2026
33 of 34 checks passed
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.

3 participants