Skip to content

feat(exec): add cloud execution provider (host="cloud")#41308

Closed
KayIter wants to merge 1 commit into
openclaw:mainfrom
KayIter:feat/cloud-exec-provider
Closed

feat(exec): add cloud execution provider (host="cloud")#41308
KayIter wants to merge 1 commit into
openclaw:mainfrom
KayIter:feat/cloud-exec-provider

Conversation

@KayIter

@KayIter KayIter commented Mar 9, 2026

Copy link
Copy Markdown

Summary

Add "cloud" as a new ExecHost variant for exec and browser tools, enabling transparent command routing to cloud sandbox runtimes provided by plugins (Firecracker MicroVMs, E2B, Modal, etc.) without requiring a local Docker container.

CloudSandboxProvider interface:

  • Plugin-implemented contract: exec, execBackground, readSessionLog, killSession
  • Optional browser support: getBrowserCdpUrl() / getBrowserVncUrl() for CDP-based browser automation
  • Lifecycle: ensureReady() (lazy init), dispose() (cleanup), isReady() (health check)
  • Provider registration via existing plugin service registry (registerService("cloud-sandbox:<id>", ...))

Cloud sandbox registry:

  • resolveCloudSandboxProvider(providerId?) — looks up the plugin service registry for registered cloud-sandbox services
  • Returns the first matching provider, or filters by explicit providerId

Cloud exec handler:

  • Follows the same pattern as bash-tools.exec-host-node.ts
  • Synchronous exec: provider.exec() → formatted stdout/stderr/exitCode result
  • Background exec: provider.execBackground() → session handle with initial output
  • Reuses shared approval context (resolveExecHostApprovalContext)
  • Emits system events via emitExecSystemEvent for heartbeat coordination
  • Infrastructure errors are wrapped with provider id for debuggability

Exec routing integration:

  • host="cloud" branch inserted in bash-tools.exec.ts before the host="node" path
  • Security defaults to "allowlist" (same as host="gateway") via existing logic — no special-casing needed

Browser tool cloud target:

  • target="cloud" resolves CloudSandboxProvider.getBrowserCdpUrl() and passes CDP URL to BrowserBridge
  • Explicit-only (no auto-resolution to cloud in this PR)

Type/schema extensions (6 files):

  • ExecHost type, config type, zod schema, normalizers, and error messages all updated to include "cloud"

Also includes:

  • 28 new tests across 3 files (12 cloud exec handler, 6 cloud registry, 10 exec-runtime with cloud variants)
  • pathPrepend warning extended to cover host="cloud" (not supported on cloud hosts)

Design decisions

  • Security default: Three independent models (GLM5, Kimi K2.5, Qwen3.5) reviewed the RFC and unanimously recommended host="cloud" should NOT default to security="full". The implementation follows this — cloud inherits "allowlist" through the existing default at bash-tools.exec.ts:321.
  • Provider via DI: executeCloudHostCommand accepts a provider parameter for testability, defaulting to resolveCloudSandboxProvider().
  • No browser auto-resolution: Cloud browser requires explicit target="cloud". Auto-detection deferred to follow-up.
  • Doctor command: Cloud provider health check in openclaw doctor deferred to follow-up PR.

Changes

  • src/infra/exec-approvals.ts — add "cloud" to ExecHost union
  • src/config/types.tools.ts — add "cloud" to config host type
  • src/config/zod-schema.agent-runtime.ts — add "cloud" to zod enum
  • src/agents/bash-tools.exec-runtime.ts — update normalizeExecHost() and renderExecHostLabel()
  • src/gateway/sessions-patch.ts — update local normalizer + error message
  • src/auto-reply/reply/exec/directive.ts — update local normalizer
  • src/infra/cloud-sandbox-provider.tsnew: CloudSandboxProvider interface + param/result types
  • src/infra/cloud-sandbox-registry.tsnew: plugin registry lookup for cloud providers
  • src/agents/bash-tools.exec-host-shared.ts — expand host param to include "cloud"
  • src/agents/bash-tools.exec-host-cloud.tsnew: cloud exec handler (sync + background)
  • src/agents/bash-tools.exec.ts — add cloud routing branch + pathPrepend warning
  • src/agents/tools/browser-tool.schema.ts — add "cloud" to BROWSER_TARGETS
  • src/agents/tools/browser-tool.ts — add cloud CDP target resolution
  • src/infra/cloud-sandbox-registry.test.tsnew: 6 tests
  • src/agents/bash-tools.exec-host-cloud.test.tsnew: 12 tests
  • src/agents/bash-tools.exec-runtime.test.ts — add cloud normalizer + label tests

Example config

tools:
  exec:
    host: cloud

When no cloud sandbox plugin is installed, this produces a clear error:

exec host=cloud requires a cloud sandbox plugin (none registered).
Install a cloud sandbox plugin (e.g. satellite-openclaw-plugin) and ensure it registers a cloud-sandbox service.

Test plan

  • tsc --noEmit — 0 type errors
  • pnpm lint (oxlint --type-aware) — 0 warnings, 0 errors on 4728 files
  • pnpm format (oxfmt) — clean
  • pnpm test -- --run src/infra/cloud-sandbox-registry.test.ts src/agents/bash-tools.exec-host-cloud.test.ts src/agents/bash-tools.exec-runtime.test.ts — 28/28 pass
  • pnpm test — full suite passes (sole pre-existing failure in bootstrap-extra-files/handler.test.ts, unrelated)
  • Manual: configure tools.exec.host: "cloud" without a plugin → verify error message
  • Manual: install a cloud sandbox plugin → verify commands route to cloud provider

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae3e9b04f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
Comment thread src/agents/tools/browser-tool.ts Outdated
Comment thread src/agents/bash-tools.exec-host-cloud.ts
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from ae3e9b0 to cdf6265 Compare March 9, 2026 17:42
@greptile-apps

greptile-apps Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces host="cloud" as a new ExecHost variant that routes exec and browser tool calls to cloud sandbox VMs via a plugin-implemented CloudSandboxProvider interface. The design is clean — it follows the existing node-host pattern, uses the plugin service registry for DI, and updates all six type/schema/normalizer sites consistently. The 28 new tests provide solid coverage.

Key finding:

  • Agent-level approval context not stored (bash-tools.exec-host-cloud.ts:41–46): resolveExecHostApprovalContext computes merged hostSecurity/hostAsk values that incorporate agent-level policy overrides, but the return value is never stored. Only the security=deny throw path is effective; agent-level allowlist or ask constraints are silently bypassed for cloud execution. Other hosts (gateway, node) store and use these values for enforcement. This is either intentional (cloud relies on sandbox isolation) or an oversight — either way, it warrants explicit clarification and documentation.

Confidence Score: 3/5

  • Safe to merge, but cloud's security model (agent-level constraint handling) needs explicit decision and documentation.
  • The implementation is architecturally sound with comprehensive test coverage (28 new tests). However, the cloud handler discards the return value from resolveExecHostApprovalContext, meaning agent-level security constraints do not apply to cloud execution — a difference from gateway and node handlers that is neither documented nor explicitly acknowledged in the code. This is either intentional (cloud relying on sandbox isolation for enforcement) or an oversight. Resolving this ambiguity is important for correct security behavior, but the overall feature is production-ready pending clarification of the approval-context design decision.
  • src/agents/bash-tools.exec-host-cloud.ts — agent-level approval context handling

Last reviewed commit: cdf6265

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdf6265468

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec.ts Outdated
Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from cdf6265 to 61fee51 Compare March 9, 2026 17:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61fee511ad

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: L labels Mar 9, 2026
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 61fee51 to 74cf886 Compare March 9, 2026 18:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74cf88652b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
Comment thread src/agents/bash-tools.exec.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch 2 times, most recently from f026463 to 263d552 Compare March 9, 2026 18:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 263d552e60

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.process.ts Outdated
Comment on lines +552 to +556
await scopedSession.onKill();
} catch {
// best-effort; fall through to markExited below
}
markExited(scopedSession, null, "SIGKILL", "killed");

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.

P1 Badge Fail cloud kill requests when provider termination errors

If scopedSession.onKill() throws (for example, network/API failure while terminating a cloud session), the error is swallowed and the code still calls markExited(..., "killed"). That reports the session as killed and removes it from active tracking even though the remote process may still be running, so users cannot retry process kill and may leak cloud compute jobs.

Useful? React with 👍 / 👎.

Comment on lines +70 to +75
if (params.backgroundMs !== undefined || params.yieldMs !== undefined) {
const cloudSession = await provider.execBackground({
command: params.command,
cwd: params.workdir,
env: params.env,
});

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.

P2 Badge Apply exec timeout to cloud background sessions

The background branch starts provider.execBackground(...) without any timeout or watchdog, even though timeoutMs is computed earlier from timeoutSec/defaultTimeoutSec. This means exec calls with host="cloud" and background/yieldMs ignore explicit time limits and can run indefinitely, unlike the non-cloud path where explicit timeouts still bound backgrounded runs.

Useful? React with 👍 / 👎.

Comment on lines +207 to +210
// Track how many bytes we've already appended so we only forward the
// incremental portion — readSessionLog() returns *accumulated* output.
let appendedLength = 0;
// eslint-disable-next-line no-constant-condition

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.

P2 Badge Initialize cloud log offset from initial output

The proxy session is pre-seeded with cloudSession.initialOutput, but polling starts with appendedLength = 0. Since readSessionLog() returns accumulated output, the first poll re-appends the initial bytes that are already in aggregated, duplicating output and inflating truncation counters for every background session that returns startup output.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 358baf9aa8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts
Comment thread src/infra/cloud-sandbox-registry.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 358baf9 to 39dc44b Compare March 10, 2026 11:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39dc44bf58

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts
Comment thread src/agents/tools/browser-tool.schema.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 39dc44b to 2aacbdf Compare March 10, 2026 15:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2aacbdfe06

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 2aacbdf to 6fd7df7 Compare March 10, 2026 15:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fd7df724d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
Comment thread src/agents/bash-tools.exec-host-cloud.ts Outdated
@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 6fd7df7 to 91d904f Compare March 10, 2026 17:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91d904f6ec

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

await provider.ensureReady();

const warningText = params.warnings.length ? `${params.warnings.join("\n")}\n\n` : "";
const timeoutMs = (params.timeoutSec ?? params.defaultTimeoutSec) * 1000;

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.

P2 Badge Preserve background no-timeout semantics for cloud host

When host="cloud" and the command is yielded/backgrounded without an explicit timeout, this code still derives timeoutMs from defaultTimeoutSec and the polling watchdog later enforces it, so long-running jobs are force-killed after the default window (30m) instead of running until completion. The non-cloud path intentionally bypasses default timeouts for background/yielded runs (effectiveTimeout = null), so this introduces host-specific behavior that can terminate valid cloud background tasks unexpectedly.

Useful? React with 👍 / 👎.

proxySession,
log.exitCode ?? null,
null,
log.exitCode === 0 ? "completed" : "failed",

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.

P2 Badge Handle completed cloud logs without exit code

CloudExecSessionLog.exitCode is optional in the provider contract, but completion is classified with log.exitCode === 0 ? "completed" : "failed". If a provider reports done: true without exitCode (which the type allows), the session is always marked failed even for successful commands, causing incorrect process status/results for compliant providers.

Useful? React with 👍 / 👎.

@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from 91d904f to a78cddb Compare March 10, 2026 18:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a78cddb17b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

command: params.command,
scopeKey: params.scopeKey,
sessionKey: params.sessionKey,
notifyOnExit: false,

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.

P2 Badge Honor notify-on-exit for cloud background sessions

This branch hard-codes notifyOnExit: false for cloud proxy sessions, so backgrounded host="cloud" commands never emit completion notifications even when exec defaults enable notify-on-exit. In practice, users who rely on automatic completion follow-ups (instead of manual process poll) lose that behavior only on cloud runs, which makes cloud execution inconsistent with the rest of the exec tool contract.

Useful? React with 👍 / 👎.

Comment on lines +90 to +91
maxOutputChars: 200_000,
pendingMaxOutputChars: 30_000,

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.

P2 Badge Use configured output caps for cloud proxy sessions

The cloud proxy session uses fixed maxOutputChars/pendingMaxOutputChars values (200_000/30_000) instead of the runtime-configured limits used by other exec hosts. If operators lower PI_BASH_MAX_OUTPUT_CHARS or OPENCLAW_BASH_PENDING_MAX_OUTPUT_CHARS to control memory/truncation behavior, cloud sessions ignore those settings and can retain far more output than intended.

Useful? React with 👍 / 👎.

@KayIter
KayIter force-pushed the feat/cloud-exec-provider branch from a78cddb to da25f98 Compare March 11, 2026 16:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da25f982cf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return executeCloudHostCommand({
command: params.command,
workdir,
env,

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.

P1 Badge Do not forward inherited host env into cloud exec

This cloud branch passes env built from sanitizeHostBaseEnv(process.env) to executeCloudHostCommand, and that handler forwards it directly to provider.exec/execBackground, so host="cloud" commands inherit gateway process secrets (API keys/tokens) by default; a simple remote env command can expose them in tool output. The node-host path avoids this by only forwarding request-scoped overrides (requestedEnv), so cloud should not receive the full inherited base environment.

Useful? React with 👍 / 👎.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context. and removed stale Marked as stale due to inactivity labels Apr 26, 2026
@clawsweeper

clawsweeper Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Closing this as implemented after Codex automated review.

Current main implements the central cloud/remote exec problem through the shipped pluggable sandbox backend API, plus SSH and OpenShell backends, rather than adding a parallel host="cloud" exec host. The PR's proposed CloudSandboxProvider service-registry path is now obsolete, and the supplied review context shows unresolved approval, environment, browser, and background-session risks in the PR diff.

Best possible solution:

Close this PR and keep the shipped sandbox-backend architecture as the product path: cloud/remote exec providers should implement openclaw/plugin-sdk/sandbox and publish as plugins, while any future cloud browser support should be designed as a narrow browser-backend capability instead of a parallel host="cloud" exec host.

What I checked:

  • current-main-sandbox-sdk-contract: The public SDK exposes the typed sandbox backend extension point, including registerSandboxBackend, backend lookup helpers, SSH/remote helpers, and sandbox backend types for external plugins. (src/plugin-sdk/sandbox.ts:24, 5828dcdb05aa)
  • current-main-backend-exec-contract: SandboxBackendHandle is the typed core contract for plugin-provided execution: it includes buildExecSpec, finalizeExec, runShellCommand, optional filesystem bridging, and capability metadata. (src/agents/sandbox/backend-handle.types.ts:40, 5828dcdb05aa)
  • current-main-exec-uses-sandbox-backends: The exec runtime already consumes sandbox backend buildExecSpec output when sandboxing is active, so remote/cloud backends route through the existing process/session/timeout/output path instead of a separate cloud exec host. (src/agents/bash-tools.exec-runtime.ts:689, 5828dcdb05aa)
  • current-main-openshell-plugin-proof: The bundled OpenShell plugin registers an openshell sandbox backend through the public sandbox SDK, providing a concrete managed remote sandbox implementation for exec and file tools. (extensions/openshell/index.ts:19, 5828dcdb05aa)
  • current-main-openshell-exec-routing: OpenShell creates a managed sandbox, prepares remote SSH-backed exec specs, supplies a remote filesystem bridge, and runs shell commands through the sandbox backend handle. (extensions/openshell/src/backend.ts:122, 5828dcdb05aa)
  • docs-confirm-product-path: The user-facing docs describe agents.defaults.sandbox.backend with Docker, SSH, and OpenShell options; OpenShell is documented as a managed sandbox backend for remote exec/file tools without local Docker. Public docs: docs/gateway/sandboxing.md. (docs/gateway/sandboxing.md:67, 5828dcdb05aa)

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Codex Review notes: model gpt-5.5, reasoning high; reviewed against 5828dcdb05aa; fix evidence: release 2026.3.22, commit 5828dcdb05aa.

@clawsweeper clawsweeper Bot closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime size: XL triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant