Repository navigation
feat(sandbox): add Daytona cloud sandbox backend plugin - #121554
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 26, 2026, 9:58 PM ET / August 27, 2026, 01:58 UTC. ClawSweeper reviewWhat this changesAdds an opt-in Daytona cloud sandbox plugin, with remote command/file transport, configuration, documentation, catalog wiring, and tests. Merge readinessKeep open: the Daytona backend still fails to forward EOF for PTY sessions, and its configuration documentation is inconsistent across the sandbox guides. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw selects a sandbox backend for agent shell and file tools. This plugin routes those operations through a local launcher to Daytona cloud sandboxes while the Gateway remains on the host. flowchart LR
A[Agent process tool] --> B[Open stdin pipe]
B --> C[Daytona sandbox backend]
C --> D[Daytona launcher]
D --> E[PTY or session transport]
E --> F[Daytona cloud sandbox]
F --> G[Output and exit status]
Decision needed
Why: The code uses the existing plugin seam, but VISION.md sets a high bar for optional commercial-service integrations and prefers independently maintained plugins absent explicit sponsorship. Before merge
Findings
Agent review detailsSecurityNeeds attention: The added remote-execution dependency graph is security-sensitive and remains blocked for exact-head authorization. PR surfaceSource +1899, Tests +1567, Docs +275, Config +54, Other +688. Total +4483 across 29 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one ordered stdin-forwarding queue that sends PTY EOT only after prior input, update the canonical agent configuration guide, then obtain an owner decision and exact-head dependency authorization. Do we have a high-confidence way to reproduce the issue? Yes: the current source establishes that process eof closes the local pipe but the Daytona PTY bridge never forwards terminal EOF; a PTY command such as cat will wait until timeout. Is this the best way to solve the issue? No: the current implementation omits the owner-boundary EOF forwarding path, and the documentation leaves the canonical configuration reference inconsistent. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6ae89b5a8ed6. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
6207470 to
f4daf61
Compare
|
Addressed the actionable findings at the new head:
On the distribution question: the in-repo external-official shape (matching @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes are blockedOpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph. Detected dependency graph changes:
Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:
Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed. To remove lockfile changes, restore them from the target branch: git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git pushIf this PR intentionally needs a dependency graph change, ask a repository admin or member of The action will approve the current head SHA ( |
|
Addressed both remote-command lifecycle findings at the new head:
Both paths carry regression tests (pre-aborted, in-flight abort, toolbox transport failure, seed-tar transport failure), and the live E2E scenarios were re-run green after the change. On the dependency-graph guard: this PR inherently introduces the plugin's dependency graph (plugin-local @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
96340f0 to
dcd32fe
Compare
|
Pushed two follow-ups:
On the remaining red checks — verified main-owned, not from this PR (reproduced on a clean detached
Note: the previous @clawsweeper re-review |
|
Addressed both actionable ClawSweeper findings at final head
Proof: Daytona 66 passed/1 skipped; official catalog 82 passed; ClawHub publication 61 passed; release planning 37 passed; extension test types, oxlint, oxfmt, and diff checks pass. Final structured reviews are clean for both commits. @joshavant please repost @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Final head is now Proof: regression failed red before the fix; Daytona 67 passed/1 skipped; extension source/test typechecks, lint/boundary guards, formatting, diff checks, and final structured review are green. Direct @joshavant please repost @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Dependency Guard confirmed the prior approval was invalidated by the final EOF commit and is now the only admission blocker for CI. @vincentkoc or @joshavant, please post |
|
ClawSweeper's two
Proof: Daytona 67 passed/1 skipped; extension source/test typechecks, lint/boundary guards, docs config examples (1,207 validated), MDX, 6,669 internal links, formatting, diff checks, and structured review are green. @vincentkoc or @joshavant, please post @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The exact-head ClawSweeper run for @vincentkoc (or @steipete), please explicitly confirm that Daytona should ship as an in-repo external official plugin for v1. Separately, @vincentkoc / @joshavant / @steipete, please post |
|
Folks we use crabbox for our cloud services and Daytona is already fully supported there. This adds 5k LOC of duplicationl. Will revert. |
) * feat: @openclaw/daytona-sandbox inital version Signed-off-by: Mislav Ivanda <[email protected]> * feat: plugin config params extended Signed-off-by: Mislav Ivanda <[email protected]> * feat: implement ClawSweeper review notes Signed-off-by: Mislav Ivanda <[email protected]> * fix(daytona): honor abort signals and clean up remote staging on failure Signed-off-by: Mislav Ivanda <[email protected]> * fix(daytona): register launcher as knip entry and refresh manifest schema Signed-off-by: Mislav Ivanda <[email protected]> * fix(daytona): cancellable session transport and auto-stopped sandbox restart Signed-off-by: Mislav Ivanda <[email protected]> * fix(daytona): deny egress by default and arm launcher cleanup before startup Signed-off-by: Mislav Ivanda <[email protected]> * fix(daytona): stop cancelled startup before submission * test(daytona): satisfy deferred race lint * test(release): update plugin publisher inventory * fix(daytona): close provisioning and PTY cleanup gaps * test(daytona): type PTY launcher mock * fix(acpx): avoid promise-returning line handler * fix(daytona): await PTY signal cleanup * fix(daytona): declare ClawHub install route * fix(daytona): forward PTY stdin EOF * fix(daytona): serialize PTY input * docs(daytona): document sandbox backend config --------- Signed-off-by: Mislav Ivanda <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]>
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554
* fix(sandbox): revert Daytona cloud sandbox plugin Revert 3a5cb38 in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts #121554 * test(macos): verify SIGPIPE suppression without reader races Concurrent preforked children can retain a pipe reader after the local handle closes. Assert the owned kernel flag before and after the real helper instead, and defer both handle closes. Keep the worker broken-pipe behavior test unchanged. * test(ui): capture safe config readback failure diagnostics * fix(ui): preserve tooltip trigger accessible names * test(browser): trace bootstrap navigation recovery Add bounded, payload-free fixture observations for the Linux bootstrap CI timeout. Preserve the original action order, access controls, assertions and timeouts; no browser runtime behavior changes. * fix(ui): refresh tooltip names on ARIA changes Observe aria-hidden mutations under the active tooltip trigger so revealed labels replace injected hint names. Cover descendant and nested-subtree hide/reveal/hide transitions with real role/name interactions. * fix(deps): retain reverted Tlon handler resolution Restore the exact handler package and snapshot needed by the intentional Tlon rollback after main pruned its last other caller. Frozen install and production audit resolve the complete graph without changing versions or guards.
* fix(sandbox): revert Daytona cloud sandbox plugin Revert 14fd4bd in full, including its plugin, documentation, catalog, dependency, and incidental test changes. Keep the existing Daytona support through Crabbox. The separate sandbox backend duplicates provider ownership and lacks the workspace-transfer semantics needed for large managed repositories. Reverts openclaw#121554 * test(macos): verify SIGPIPE suppression without reader races Concurrent preforked children can retain a pipe reader after the local handle closes. Assert the owned kernel flag before and after the real helper instead, and defer both handle closes. Keep the worker broken-pipe behavior test unchanged. * test(ui): capture safe config readback failure diagnostics * fix(ui): preserve tooltip trigger accessible names * test(browser): trace bootstrap navigation recovery Add bounded, payload-free fixture observations for the Linux bootstrap CI timeout. Preserve the original action order, access controls, assertions and timeouts; no browser runtime behavior changes. * fix(ui): refresh tooltip names on ARIA changes Observe aria-hidden mutations under the active tooltip trigger so revealed labels replace injected hint names. Cover descendant and nested-subtree hide/reveal/hide transitions with real role/name interactions. * fix(deps): retain reverted Tlon handler resolution Restore the exact handler package and snapshot needed by the intentional Tlon rollback after main pruned its last other caller. Frozen install and production audit resolve the complete graph without changing versions or guards.
What Problem This Solves
OpenClaw sandboxing currently requires local container infrastructure (Docker/Podman), an SSH-reachable machine, or an OpenShell account. Operators who want isolated agent tool execution without managing any of that have no cloud-API-only option.
This PR adds
daytonaas a sandbox backend: agent tool execution (exec,read,write,edit,apply_patch, media reads) runs inside Daytona cloud sandboxes over the Daytona toolbox API (HTTPS). No SSH keys, no inbound connectivity, no local container runtime. The Gateway, agent loop, model calls, and channels stay on the host.Context: maintainer invitation on Slack (OpenClaw channel): "Yea open to a PR where Daytona could be used as a sandbox backend, the plugin surface should be pluggable" — it was; no SDK changes were needed.
Why This Change Was Made
@openclaw/daytona-sandbox,bundledDist: false) mirroring@openclaw/openshell-sandboxand@openclaw/mxc-sandbox, registered viaregisterSandboxBackendfromopenclaw/plugin-sdk/sandbox.createRemoteShellSandboxFsBridge(same bridge as the SSH backend) drives all file tools. The plugin only supplies the transport: Daytona's exec API merges stdout/stderr and is not binary-safe, so commands are wrapped to redirect streams to files and emit them base64-encoded — binary-exact, exit-code-preserving, one API call.buildValidatedExecRemoteCommand/ workdir-validation scripts shared with the SSH backend for identical env/cd/validation semantics.buildExecSpecreturns[node, daytona-exec-launcher.mjs, --payload-file, …]. Non-PTY execs use Daytona sessions (async run, exit-code polling — never trusting log-stream end, stdin forwarding, streamed logs with catch-up dedupe); TTY execs use Daytona's PTY surface (resize, byte-faithful stdin, exit codes). Remote command kill on SIGTERM/SIGINT.agent/session/shared), adopted across Gateway restarts through the sandbox registry (registeredRuntimeIds); sandboxes are labeledopenclaw.sandbox=1plus a hashed scope label.openclaw sandbox recreatedeletes the sandbox and re-seeds on next use.apiKeyaccepts plaintext or SecretRef (env/file/exec) withDAYTONA_API_KEYfallback; the key reaches the launcher via an owner-only (0600) payload file deleted at read — never argv or inherited env. Exec child env issanitizeEnvVars-filtered.plugins.entries.daytona.config):apiKey,apiUrl,target,snapshot|image+resources(mutually exclusive; resources only for image-based creates),user,volumes,autoStopInterval/autoPauseInterval(Daytona allows at most one non-zero),autoArchiveInterval,autoDeleteInterval,networkBlockAll/networkAllowList/domainAllowList,remoteWorkspaceDir,remoteAgentWorkspaceDir,timeoutSeconds. Deliberately skipped:ephemeral(autoDeleteInterval: 0covers it and it fights adoption),envVars(env flows per-exec like SSH),labels/public/ttlMinutes(not needed for an exec sandbox).onConfigPaths: ["plugins.entries.daytona"](mxc pattern) — the plugin loads only when configured instead of on every Gateway boot.User Impact
agents.defaults.sandbox.backend: "daytona"(docs:docs/gateway/daytona.md+ a section indocs/gateway/sandboxing.md). No behavior change for anyone who does not enable it; defaults untouched.sandbox.prune.*) deletes Daytona runtimes like Docker ones.sandbox.docker.*does not apply (bindsrejected loudly); no mirror mode (remote-canonical only); non-PTY exec stdin is line-oriented text.package.json), added to the official install catalog, published to npm + ClawHub by release automation. Install:openclaw plugins install @openclaw/daytona-sandbox.Evidence
Unit + contract (all green):
pnpm test extensions/daytona— 48 tests: config validation matrix (mutual exclusions, interval conflict, volume overlap), adoption (missing/dead/stopped candidates), tar seeding + symlink-escape refusal, exec payload/argv/env sanitization, binary-safe stdout/stderr transport (fake sandbox executing wrapped commands through real local/bin/sh), fs bridge write/read/rename/remove + read caps + mount-escape rejection through core's real pinned-python bridge, manager describe/remove. One GNU-stat test is Linux-gated (BSD stat on macOS dev machines).src/plugins/bundled-plugin-metadata.test.ts(37),package-manifest.contract+extension-runtime-dependencies.contract(505), featured/install catalog (20) — green.configSchemais asserted byte-equal to the runtime zod schema.Live E2E against real Daytona (repeatable):
OPENCLAW_E2E_DAYTONA=1 node --env-file=.env scripts/run-vitest.mjs extensions/daytona/src/backend.e2e.test.ts # + image-based create path: OPENCLAW_E2E_DAYTONA=1 OPENCLAW_E2E_DAYTONA_IMAGE=1 node --env-file=.env scripts/run-vitest.mjs extensions/daytona/src/backend.e2e.test.tsProves end to end (~12s / ~4s): sandbox create + tar seed, exec through the real spawned launcher (cwd, env propagation, exit code 7 + stderr), PTY exec (exit code 4), backend workdir validation, binary fs-bridge round trip + remote stat, adoption by a second factory call, manager describe (running/label match) and remove; image path additionally proves
python:3.13-slim+ explicitresources. Teardown verified: zero leftoveropenclaw.sandbox-labeled sandboxes after runs. Partialresourceslive-probed: omitted fields fall back to Daytona defaults (1 vCPU / 1 GB / 3 GiB).Repo gates: full
check:changed(exit 0; typecheck-all, lint 0 errors across core/extensions/scripts, dead-export scan, SDK contract manifests, npm-lock guard, import cycles),pnpm buildgreen with the plugin correctly excluded from core dist, CLI smoke (openclaw plugins info daytona→ loaded via config-path activation; config schema validates through the manifest). Structured pre-land review run repeatedly during development; final pass clean with no actionable findings.Validation notes:
user,volumes,networkAllowList/domainAllowList,autoPauseInterval,autoArchiveIntervalare verified against the@daytona/[email protected]create contract and unit-tested as exact pass-through; they are not live-exercised in e2e because each needs org fixtures (pre-created volume, VM-based runner class for pause, image with the custom user). Server-side rejections surface loudly through the backend error path.Follow-ups / open questions for maintainers
ensureSandboxBrowser, prune hardcodes the docker manager), so backends cannot supply their own browser. Daytona-side feasibility (CDP over preview URLs; WS proxying already powers Daytona's PTY) looks plausible and we can spike it with evidence if there's interest in defining the seam.docs/gateway/sandboxing.mdbackend comparison tables: we added a Daytona section + values-row entry but no column in the two wide tables (mxc precedent — curated, not exhaustive). Say the word and we'll add columns.main(docs/plugins/reference/{cua-computer,google,sms}.mdvs their manifests) was deliberately excluded from this PR to keep it Daytona-only.Maintainer action needed: create the
extensions: daytonaGitHub label (.github/labeler.ymlentry is included here).After-fix live evidence (real Daytona, current head)
Both live E2E scenarios, run against a real Daytona org:
Raw transcript of the remote behavior (API key redacted; sandbox deleted at the end):
Note on the "stored data model" flag: the launcher payload file is transient per-exec state — created 0600, deleted by the launcher at read and by
finalizeExecas a fallback. Nothing is persisted; no migration surface exists.