Skip to content

fix(local-container): mount bootstrap script instead of passing inline - #204

Merged
steipete merged 1 commit into
openclaw:mainfrom
anagnorisis2peripeteia:fix/windows-bootstrap-mount
Jun 5, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
anagnorisis2peripeteia:fix/windows-bootstrap-mount

Conversation

@anagnorisis2peripeteia

@anagnorisis2peripeteia anagnorisis2peripeteia commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The local-container provider's createContainer() passes a 39K bootstrap shell script as an inline argument to docker run. On Windows, this exceeds the 32K-character CreateProcessW command-line limit, making crabbox warmup --provider local-container fail unconditionally.

Write the bootstrap script to a host temp file and bind-mount it read-only into the container instead. This replaces the 39K inline argument with a ~60-character volume mount flag.

Changes: 2 files, +16/-3 lines

  • internal/providers/localcontainer/backend.go: write bootstrap to temp file, mount as /tmp/crabbox-bootstrap.sh:ro, execute from mount
  • internal/providers/localcontainer/backend_test.go: update test assertions to check for mounted bootstrap path

After-fix proof

Windows Docker Desktop, crabbox built from this branch:

> crabbox warmup --provider local-container --desktop --idle-timeout 90m
provisioning provider=local-container lease=cbx_c6f5dde7066a slug=amber-crab runtime=docker image=ubuntu:26.04 keep=true
waiting for 127.0.0.1:52662 local container ssh ssh-auth... elapsed=0s remaining=45m0s ports=52662:tcp
waiting for 127.0.0.1:52662 local container ssh ssh-auth... elapsed=10s remaining=44m50s ports=52662:tcp
...
waiting for 127.0.0.1:52662 local container ssh ssh-auth... elapsed=1m31s remaining=43m29s ports=52662:tcp
provisioned lease=cbx_c6f5dde7066a container=5e0c52caea43 state=ready
leased cbx_c6f5dde7066a slug=amber-crab provider=local-container server=5e0c52caea43... type=ubuntu_26.04 ip=127.0.0.1 idle_timeout=1h30m0s
ready [email protected]:52662 network=public workroot=/work/crabbox
warmup complete total=1m41.681s

Before this fix, the same command fails with:

container run failed: fork/exec C:\Program Files\Docker\Docker\resources\bin\docker.exe: The filename or extension is too long.

Test plan

  • go build ./... compiles clean (Go 1.26)
  • go test ./internal/providers/localcontainer/ -run TestCreateContainer passes (5/5, 1 skipped for missing Docker socket)
  • crabbox warmup --provider local-container --desktop succeeds on Windows Docker Desktop
  • crabbox job run proof-89834 provisions a desktop container and reaches SSH-ready state
  • Linux/macOS smoke test (no behavior change expected — inline arg was already under limits)

The 39K bootstrap script was passed as an inline argument to docker run,
exceeding Windows CreateProcessW's 32K command-line limit. Write it to a
temp file and bind-mount it read-only instead.
@anagnorisis2peripeteia
anagnorisis2peripeteia marked this pull request as ready for review June 4, 2026 08:54
@clawsweeper

clawsweeper Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 4, 2026, 4:59 AM ET / 08:59 UTC.

Summary
The PR changes local-container container startup to write the bootstrap script to a temp file, bind-mount it read-only, and execute the mounted script instead of passing the script body inline.

Reproducibility: yes. from source for the command construction path: current main passes the full bootstrapScript as a docker run argument, and the PR body supplies Windows Docker Desktop before/after terminal output. I did not run Windows Docker Desktop in this review.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair is needed; the remaining path is ordinary maintainer review and merge if checks pass.

Security
Cleared: The diff writes a generated bootstrap script to a temp file and mounts it read-only; no concrete credential or supply-chain regression was found.

Review details

Best possible solution:

Land a narrow local-container startup fix that avoids the Windows command-line limit while preserving the documented local Docker-compatible runtime behavior.

Do we have a high-confidence way to reproduce the issue?

Yes from source for the command construction path: current main passes the full bootstrapScript as a docker run argument, and the PR body supplies Windows Docker Desktop before/after terminal output. I did not run Windows Docker Desktop in this review.

Is this the best way to solve the issue?

Yes; moving the script body out of the process command line is the narrow maintainable fix for the Windows CreateProcessW limit.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against c6fef7c90b41.

Label changes

Label changes:

  • add P2: This fixes a real provider startup failure for Windows local-container users with limited blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Windows Docker Desktop terminal output showing warmup reaching SSH-ready state, plus the before-fix Windows command-line-length error.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix Windows Docker Desktop terminal output showing warmup reaching SSH-ready state, plus the before-fix Windows command-line-length error.

Label justifications:

  • P2: This fixes a real provider startup failure for Windows local-container users with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix Windows Docker Desktop terminal output showing warmup reaching SSH-ready state, plus the before-fix Windows command-line-length error.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Windows Docker Desktop terminal output showing warmup reaching SSH-ready state, plus the before-fix Windows command-line-length error.
Evidence reviewed

What I checked:

Likely related people:

  • Peter Steinberger: Available history shows the local-container provider was introduced by this author and most subsequent changes in the same provider backend/test/docs area also came from this author. (role: feature owner and recent area contributor; confidence: high; commits: 6caae5246f02, 5bcee65667b8; files: internal/providers/localcontainer/backend.go, internal/providers/localcontainer/backend_test.go, docs/providers/local-container.md)
  • Vincent Koc: History shows a recent local-container Docker socket hardening change in the same provider area. (role: recent adjacent contributor; confidence: medium; commits: 30ab47686986; files: internal/providers/localcontainer/backend.go, internal/providers/localcontainer/backend_test.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 4, 2026
@steipete
steipete merged commit 21918fe into openclaw:main Jun 5, 2026
@anagnorisis2peripeteia
anagnorisis2peripeteia deleted the fix/windows-bootstrap-mount branch September 9, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants