Skip to content

Fix default sandbox image fallback for python3-dependent mutations#73362

Merged
vincentkoc merged 1 commit intomainfrom
clownfish/ghcrawl-156718-autonomous-smoke
Apr 28, 2026
Merged

Fix default sandbox image fallback for python3-dependent mutations#73362
vincentkoc merged 1 commit intomainfrom
clownfish/ghcrawl-156718-autonomous-smoke

Conversation

@vincentkoc
Copy link
Copy Markdown
Member

Summary

  • Fix the default sandbox image fallback so OpenClaw does not satisfy openclaw-sandbox:bookworm-slim by tagging plain debian:bookworm-slim without the tooling required by sandbox mutation helpers.
  • Add focused regression coverage for the missing-image/no-python fallback path.
  • Preserve the existing python3 dependency documented by Dockerfile.sandbox and keep the change scoped to image resolution plus tests.

Linked Issues

Fixes #51185.
Related duplicate reports: #45108, #51099, #51609, #57713.
Related diagnostic PR: #56785.

Credit

Thanks @dpalis for the canonical root-cause report in #51185. Thanks @Tin55FoilDev, @jbcohen2-coder, @macminihal-cyber, and @PraxoOnline for the duplicate reports and reproduction details. Credit @tonga54/#56785 only if the implementation reuses its guidance or test approach.

Validation

  • pnpm check:changed

ProjectClownfish replacement details:

@vincentkoc vincentkoc requested a review from a team as a code owner April 28, 2026 07:16
@vincentkoc vincentkoc added clownfish:human-review clawsweeper Tracked by ClawSweeper automation labels Apr 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Apr 28, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR removes the silent fallback in ensureDockerImage that previously pulled plain debian:bookworm-slim and tagged it as openclaw-sandbox:bookworm-slim when the default sandbox image was missing. Instead, it now throws a descriptive error directing users to scripts/sandbox-setup.sh. A focused regression test covering the missing-image path is added alongside a CHANGELOG entry.

Confidence Score: 5/5

Safe to merge — targeted, correct fix with appropriate regression coverage and no side effects on other code paths.

The change is minimal and correct: it replaces a silent misbehavior (tagging plain Debian as the sandbox image) with a clear, actionable error. The test verifies the exact regression scenario, scripts/sandbox-setup.sh exists in the repo so the error message reference is valid, and no other callers are affected.

No files require special attention.

Reviews (1): Last reviewed commit: "Fix default sandbox image fallback for p..." | Re-trigger Greptile

@vincentkoc vincentkoc force-pushed the clownfish/ghcrawl-156718-autonomous-smoke branch 3 times, most recently from 4c1f618 to e9139d8 Compare April 28, 2026 08:50
@vincentkoc vincentkoc force-pushed the clownfish/ghcrawl-156718-autonomous-smoke branch from e9139d8 to 5210da1 Compare April 28, 2026 08:52
@vincentkoc vincentkoc merged commit 47dc9f7 into main Apr 28, 2026
9 of 10 checks passed
@vincentkoc vincentkoc deleted the clownfish/ghcrawl-156718-autonomous-smoke branch April 28, 2026 08:57
@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot Bot commented Apr 28, 2026

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🟡 Medium Unhandled exception from ensureDockerImage can crash runs when default sandbox image is missing
1. 🟡 Unhandled exception from ensureDockerImage can crash runs when default sandbox image is missing
Property Value
Severity Medium
CWE CWE-248
Location src/agents/sandbox/docker.ts:289-299

Description

ensureDockerImage() now throws when DEFAULT_SANDBOX_IMAGE is missing instead of pulling/tagging a fallback.

This becomes an availability/DoS risk because the error propagates to sandbox initialization and can terminate an embedded run:

  • Input/condition: Docker sandboxing enabled + default image not present on host
  • Throw site: ensureDockerImage(DEFAULT_SANDBOX_IMAGE)
  • Propagation: createSandboxContainer()ensureSandboxContainer()createDockerSandboxBackend()resolveSandboxContext()
  • Upstream handling: at least one caller (runEmbeddedAttempt) awaits resolveSandboxContext() outside its surrounding try { ... } catch { ... }, so the exception can abort the run and potentially cause repeated restart loops depending on deployment.

Vulnerable code:

if (image === DEFAULT_SANDBOX_IMAGE) {
  throw new Error(
    `Sandbox image not found: ${image}. Build it with scripts/sandbox-setup.sh before enabling Docker sandboxing. ...`,
  );
}

Recommendation

Handle missing images gracefully at the sandbox-entry boundary so a missing Docker image does not crash the whole run.

Options:

  1. Catch and disable sandboxing in the caller that creates the sandbox context (preferred for resiliency):
let sandbox: SandboxContext | null = null;
try {
  sandbox = await resolveSandboxContext({ config, sessionKey, workspaceDir });
} catch (e) {
  const msg = e instanceof Error ? e.message : String(e);
  log.error(`Sandbox unavailable; continuing without sandbox: ${msg}`);
  sandbox = null;
}
  1. Alternatively, add an allowFailure/enabled toggle to sandbox resolution so callers can opt into “best-effort” sandboxing.

Also ensure any process supervisor does not infinitely restart on this configuration error (surface a clear, actionable message and fail fast only in CLI commands that explicitly require sandboxing).


Analyzed PR: #73362 at commit 5210da1

Last updated on: 2026-04-28T09:00:52Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper Tracked by ClawSweeper automation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ensureDockerImage() silently overwrites custom sandbox image with plain debian

1 participant