Skip to content

feat(sandbox): move to env's redesigned guest services - #3148

Draft
thomasbarrett wants to merge 4 commits into
kagent-dev:mainfrom
thomasbarrett:feat/env-guest-redesign
Draft

thomasbarrett wants to merge 4 commits 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, which includes agent-substrate/env#65, and adapts kagent to its renamed guest API. No new features: stdin input stays unforwarded and is refused, like any RPC without an access policy.

Breaking:

  • Sandboxes running a guest image from before this change don't work with the new controller. Delete them before upgrading.
  • get_sandbox_process returns state (PROCESS_STATE_RUNNING or PROCESS_STATE_EXITED) instead of status.
  • kill_sandbox_process and kagent sandbox kill send SIGKILL and report the state right after delivery, not the exit code. Use get_sandbox_process or kagent sandbox wait for the exit.
  • The CLI reports state instead of status, and JSON output records use source: "stdout" or "stderr".
  • The gRPC API and the Go client follow env's renames: SignalProcess replaces KillProcess, and StreamProcessOutput replaces StreamProcessOutputs.

🤖 Generated with Claude Code

Bump agent-substrate/env to 0d359ea, which redesigns the guest
ProcessService and FileSystemService (agent-substrate/env#65), and adapt
the passthrough gRPC API, Go client, CLI, MCP tools, tests and docs.

- StreamProcessOutput ends with an exit message once the process has
  exited and all output is delivered. The CLI's wait reads it instead of
  polling GetProcess, and read_sandbox_outputs reports exited and
  exit_code.
- SignalProcess replaces KillProcess. kill_sandbox_process sends SIGKILL;
  the CLI's kill takes --signal.
- WriteProcessInput is forwarded with update access, so processes started
  with stdin can be fed.
- Process state is RUNNING or EXITED with a shell-convention exit code,
  replacing the COMPLETED, FAILED and TERMINATED statuses.

BREAKING CHANGE: the ateenv messages are wire-incompatible with the old
guest, so sandboxes running a guest image from before this change stop
working with a controller after it. get_sandbox_process returns state
instead of status, and the CLI's JSON finished records carry state.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@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
kill_sandbox_process returned the state right after the signal, usually
RUNNING with exit code 0, which reads as a clean exit. It now waits briefly
for the exit message, as it returned the exit code before the env upgrade.
kagent sandbox kill --signal accepts numbers and SIGNAL_ names. The docs
note that an env upgrade that changes the guest messages requires deleting
existing sandboxes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 10, 2026
The old guest's kill waited for the process to die and returned its exit
code, and killing a process that had already exited returned that exit.
The new SignalProcess returns at once and refuses exited processes. The
CLI's kill now waits for a SIGKILL exit like the MCP tool, and both report
how an already-exited process exited instead of failing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 10, 2026
Drop what the upgrade does not need: stdin forwarding, kill --signal,
waiting for a kill's exit, and exited/exit_code on read_sandbox_outputs.
Kill now sends SIGKILL and reports the state right after delivery; the exit
code comes from get_sandbox_process or sandbox wait. sandbox wait keeps its
GetProcess loop and ignores the stream's exit message.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 10, 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.

1 participant