openclaw - ✅(Solved) Fix [Bug]: Sandbox enabled by default on update breaks all exec for existing single-user setups [2 pull requests, 2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#58885Fetched 2026-04-08 02:31:31
View on GitHub
Comments
2
Participants
1
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×6commented ×1subscribed ×1

After updating from a pre-sandbox version to 2026.4.1, a Docker sandbox container is automatically created and enabled for existing agents with no prior sandbox configuration. This silently breaks all exec tool calls — commands are blocked with "allowlist miss" and approval popups appear that cannot be dismissed or disabled.

The result is a complete loss of exec functionality for existing setups. There is no warning during startup, no migration guide, and no clear way to opt out. A working setup is broken with no path to recovery visible to the user.

Error Message

  • OR: startup must warn clearly that a sandbox container was created and how to disable it

Root Cause

After updating from a pre-sandbox version to 2026.4.1, a Docker sandbox container is automatically created and enabled for existing agents with no prior sandbox configuration. This silently breaks all exec tool calls — commands are blocked with "allowlist miss" and approval popups appear that cannot be dismissed or disabled.

The result is a complete loss of exec functionality for existing setups. There is no warning during startup, no migration guide, and no clear way to opt out. A working setup is broken with no path to recovery visible to the user.

PR fix notes

PR #67468: fix(exec): do not resolve auto exec host to sandbox when mode is off (fixes #58885)

Description (problem / solution / changelog)

Background

After updating OpenClaw to a version with sandbox support (2026.4.1+), existing single-user setups without any prior sandbox configuration experienced completely broken exec functionality:

  • All shell commands were silently routed through an auto-created Docker sandbox container
  • Approval popups appeared on every exec call that could not be dismissed
  • tools.exec.ask = "off" was ignored while sandbox was active
  • Cron-triggered exec jobs failed with "allowlist miss"
  • The only workaround was manually destroying Docker containers (undocumented)

Over 1 hour lost diagnosing per affected user. No migration warning was shown during update.

Root Cause

In src/agents/bash-tools.exec.ts, the resolveExecTarget() call computed sandboxAvailable as:

sandboxAvailable: Boolean(defaults?.sandbox)

This is truthy for ANY sandbox config object, including {mode: "off"} or even {}.

Since tools.exec.host defaults to "auto", and resolveExecTarget() resolves:

effectiveHost = resolvedTarget === "auto"
  ? (sandboxAvailable ? "sandbox" : "gateway")
  : resolvedTarget;

Any presence of agents.defaults.sandbox in config — even with mode: "off" — caused all exec calls to route through Docker sandbox.

Fix

1. src/agents/bash-tools.exec.ts (1 line changed)

- sandboxAvailable: Boolean(defaults?.sandbox),
+ sandboxAvailable: Boolean(
+   defaults?.sandbox?.mode && defaults.sandbox.mode !== "off",
+ ),

Now sandboxAvailable checks whether sandbox mode is actually enabled, not just whether the config object exists.

2. src/agents/bash-tools.exec-runtime.test.ts (regression test added)

Verifies that when sandbox = {mode: "off"}, auto resolves to "gateway" (not "sandbox").

Verification

ConfigsandboxAvailablehost: auto resolves to
No sandbox configfalsegateway
{mode: "off"}falsegateway ✅ (fixed)
{mode: "non-main"}truesandbox
{mode: "all"}truesandbox
{docker: {image: "x"}} (no mode)falsegateway ✅ (safe default)

Edge Cases

  • Empty {}: mode is undefined → false → gateway (safe)
  • Partial config without mode: same as above → gateway
  • Explicit host: "sandbox": still works (separate code path that throws if sandbox runtime unavailable)
  • Elevated mode (/elevated full): always uses gateway/node, unaffected

Fixes #58885

Changed files

  • src/agents/bash-tools.exec-runtime.test.ts (modified, +37/-0)
  • src/agents/bash-tools.exec.ts (modified, +2/-1)

PR #67501: fix(whatsapp): downgrade false-positive creds restore warning to debug

Description (problem / solution / changelog)

Summary

Fixes #60625

On every gateway startup and WhatsApp reconnect, the log emits a misleading [WARN] restored corrupted WhatsApp creds.json from backup message, even though creds.json and creds.json.bak are byte-identical with no actual corruption.

Root Cause

readCredsJsonRaw() returns null when creds.json is missing or empty (≤1 byte). During WhatsApp reconnect, the creds file is temporarily flushed, which triggers a backup restore. The restore path always logs at warn level regardless of whether the file was actually corrupt (real problem) or just temporarily unavailable (normal reconnect behavior).

Changes

extensions/whatsapp/src/auth-store.tsmaybeRestoreCredsFromBackup()

  • Distinguishes between "file exists but contains invalid JSON" (corrupt → warn) vs "file missing/empty" (normal reconnect → debug)
  • Restore from backup still happens in both cases (correct behavior preserved)
  • Added credsCorrupt flag to track the reason for restoration

Before vs After

ScenarioBeforeAfter
creds.json missing (reconnect)[WARN] restored corrupted...[DEBUG] was missing, restored...
creds.json corrupt JSON[WARN] restored corrupted...[WARN] restored corrupted...
creds.json validNo logNo log ✅

Verification

  1. Normal reconnect (creds.json temporarily missing): warning disappears from user-visible logs
  2. Actual corruption (invalid JSON): warning still fires at warn level
  3. Valid creds.json: no log output (unchanged)

Changed files

  • extensions/whatsapp/src/auth-store.ts (modified, +19/-4)
  • src/agents/bash-tools.exec-runtime.test.ts (modified, +23/-0)
  • src/agents/bash-tools.exec.ts (modified, +2/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression / breaking change without migration path

Summary

After updating from a pre-sandbox version to 2026.4.1, a Docker sandbox container is automatically created and enabled for existing agents with no prior sandbox configuration. This silently breaks all exec tool calls — commands are blocked with "allowlist miss" and approval popups appear that cannot be dismissed or disabled.

The result is a complete loss of exec functionality for existing setups. There is no warning during startup, no migration guide, and no clear way to opt out. A working setup is broken with no path to recovery visible to the user.

Impact

  • All cron-triggered exec commands fail silently
  • Approval popups appear on every exec call and cannot be dismissed permanently
  • tools.exec.ask = "off" is ignored while sandbox is active
  • tools.exec.host = "gateway" is ignored while sandbox container exists
  • exec-approvals.json defaults (ask: "off", security: "none") are ignored
  • Per-agent tools.exec.ask = "off" is ignored
  • The only fix is to manually destroy the Docker container (docker rm -f openclaw-sbx-agent-main-*) — this is not documented anywhere

Time lost

Over 1 hour diagnosing this for a single-user local gateway setup that was fully functional before the update. None of the documented config options (ask, security, host) had any effect while the sandbox container existed.

Steps to reproduce

  1. Have a working single-user local gateway setup with agents using exec (Python scripts, cron jobs)
  2. Update to 2026.4.1 (pulls sandbox-related commits)
  3. Gateway starts normally — no warnings about sandbox activation
  4. Agent attempts any exec command
  5. Approval popup appears. Clicking "Always allow" has no persistent effect.
  6. Setting tools.exec.ask = "off" globally and per-agent has no effect
  7. All cron exec jobs fail with "allowlist miss"

Fix required

  • Sandbox must not be enabled by default for agents with no sandbox config
  • OR: startup must warn clearly that a sandbox container was created and how to disable it
  • OR: tools.exec.host = "gateway" must bypass the sandbox container entirely
  • openclaw doctor --fix should detect and offer to remove orphaned sandbox containers
  • Migration guide needed for users updating from pre-sandbox versions

Environment

  • Version: 2026.4.1
  • Platform: macOS, LaunchAgent gateway
  • No Docker sandbox config in any agent before update
  • Single-user operator setup

extent analysis

TL;DR

Manually destroying the Docker container (docker rm -f openclaw-sbx-agent-main-*) is the most likely fix to restore exec functionality for existing agents.

Guidance

  • To immediately restore exec functionality, manually remove the automatically created Docker sandbox container using docker rm -f openclaw-sbx-agent-main-*.
  • Verify that the sandbox container is removed by checking Docker container lists before and after removal.
  • To prevent similar issues in the future, consider setting tools.exec.ask = "off" and tools.exec.host = "gateway" explicitly in agent configurations, although these settings are currently ignored while the sandbox container exists.
  • Be cautious when updating to new versions, as silent changes like this can break existing functionality without clear warnings or migration paths.

Example

No code snippet is provided as the issue is related to configuration and container management rather than code.

Notes

The provided solution is a temporary workaround. A more permanent fix would involve changes to the software to either not enable the sandbox by default for agents without prior sandbox configuration or to provide clear warnings and migration guides for such changes.

Recommendation

Apply the workaround by manually destroying the Docker container, as there is no clear indication that an updated version with a fix is available. This approach directly addresses the issue described, restoring exec functionality until a more comprehensive solution is implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING