Skip to content

fix(sandbox): stop provisioning failures from exhausting fallbacks - #115481

Merged
steipete merged 3 commits into
mainfrom
codex/fix-sandbox-provisioning-fallback
Jul 29, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-sandbox-provisioning-fallback

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #106516

What Problem This Solves

Fixes an issue where a missing or unusable sandbox runtime could be treated as a model failure, causing OpenClaw to retry the same local provisioning failure across every configured model fallback.

Why This Change Was Made

Once sandbox mode selects a session, the complete setup path now has one typed provisioning boundary covering backend creation, runtime registration, browser startup, capability checks, and filesystem-bridge construction. The model fallback owner recognizes that type before candidate classification or fallback-step accounting and rethrows the original actionable failure.

This avoids error-text matching, provider-specific policy, caller-side image preflights, and partial catches that leave another provisioning stage retryable. The existing public sandbox context signature and Plugin SDK contract remain byte-compatible.

User Impact

Sandbox configuration and infrastructure failures now fail once with the real remediation message instead of burning fallback budget, adding latency, and ending in a misleading all-models-failed summary.

Evidence

  • Real Docker 29.4 proof with a unique nonexistent image exercised the production sandbox context and model fallback state machine: {"backendId":"docker","code":"sandbox_provisioning","calls":1,"fallbackSteps":0,"missingImageDetected":true}.
  • node scripts/run-vitest.mjs src/agents/sandbox/provisioning-error.test.ts src/agents/sandbox.resolveSandboxContext.test.ts src/agents/sandbox/docker.test.ts src/agents/model-fallback.test.ts — 159 tests passed on the final head.
  • OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/check-changed.mjs — passed on Blacksmith Testbox tbx_01kynrd4q3fgjr2djmbvmy9req; typecheck, lint, formatting, dead-code, SDK, boundary, and repository guards all clean.
  • node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check — exact public SDK baseline preserved.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean; no accepted/actionable findings, confidence 0.93.

AI-assisted implementation; I reviewed the full provisioning and fallback path and validation output.

@steipete
steipete requested a review from a team as a code owner July 29, 2026 01:49
@openclaw-barnacle openclaw-barnacle Bot added docker Docker and sandbox tooling agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit dcffb9c into main Jul 29, 2026
126 of 130 checks passed
@steipete
steipete deleted the codex/fix-sandbox-provisioning-fallback branch July 29, 2026 02:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main: (57 commits)
  docs: document gateway and memory chat wizards (#115487)
  fix(agents): restore subagent completion delivery on CLI runtimes (#115422)
  fix(sandbox): stop provisioning failures from exhausting fallbacks (#115481)
  refactor: remove duplicate runtime and plugin paths (#115483)
  fix(ui): canonicalize agent model identity (#115480)
  fix(ui): preview model picker interactions live (#115477)
  fix(ui): match disabled microphone picker background (#115472)
  refactor(code-mode): split focused runtime stress suites (#115462)
  fix(gateway): preserve restart intent across coalesced config writes (#110397)
  fix: scope subagent handoff to direct tools (#115466)
  docs: explain native subagent handoff
  fix: clarify native subagent completion handoff
  fix(config): respect agent directory filesystem case (#105402)
  refactor(code-mode): unify safe OpenAI tool filtering (#115460)
  refactor(code-mode): prepare MCP namespaces once per run (#115459)
  fix(ollama): preserve selected model capabilities during onboarding (#115467)
  refactor(chat): remove duplicate session projection paths (#115461)
  refactor(code-mode): make tool catalogs run-owned (#115458)
  fix(cli): preserve mid-turn text in durable replies (#115455)
  fix(memory): fall back to keyword search when embeddings cannot start (#115397)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…penclaw#115481)

* fix(sandbox): stop fallback on provisioning failures

* fix(sandbox): preserve context SDK signature

* refactor(sandbox): keep provisioning class private
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docker Docker and sandbox tooling maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: sandbox image missing classified as model.fallback_step; burns full model fallback chain

1 participant