fix(scripts): retry Docker E2E after rejected resource caps#98579
fix(scripts): retry Docker E2E after rejected resource caps#98579ooiuuii wants to merge 3 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 11:23 PM ET / 03:23 UTC. Summary PR surface: Tests +559, Other +413. Total +972 across 3 files. Reproducibility: yes. The linked issue and PR body provide a high-confidence constrained-daemon path where plain Docker succeeds but resource-limited Docker fails, and current source shows main still injects those caps without retry. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge the focused helper retry fix after maintainer review, preserving normal Docker failures and keeping container and package helper behavior aligned. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue and PR body provide a high-confidence constrained-daemon path where plain Docker succeeds but resource-limited Docker fails, and current source shows main still injects those caps without retry. Is this the best way to solve the issue? Yes. Retrying once only after Docker status 125 plus resource-limit stderr, while removing only OpenClaw-injected caps and preserving ordinary failures, is the narrowest maintainable fix for the reported helper behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9eec24df6710. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +559, Other +413. Total +972 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Current PR body now includes the requested real constrained-Docker proof from host |
|
AI-assisted (approved by Peter) Thank you for the patch and for your continued work across the repository. We are closing this approach because silently retrying without resource caps weakens an explicit safety constraint and violates the repository's explicit-fallback doctrine. Operators who intentionally accept that tradeoff already have the supported opt-out: We landed #109587 to make the incompatible-runtime failure actionable: it preserves the original Docker error and status, keeps the capped run fail-closed, and points directly to that explicit opt-out. |
Fixes #98601
What Problem This Solves
Docker E2E and package-backed Docker lanes can fail before the test container starts when the local Docker daemon accepts the command but rejects OpenClaw's default
--memory,--cpus, or--pids-limitcgroup controls during container create/start.This can happen on nested, rootless, or otherwise constrained Docker hosts. Before this change, operators had to know to set
OPENCLAW_DOCKER_E2E_DISABLE_RESOURCE_LIMITS=1manually; failed named-container and--cidfileattempts could also leave artifacts that blocked the retry.Why This Change Was Made
The Docker run helpers now retry once without OpenClaw-injected default resource caps only when Docker itself reports a daemon/runtime resource-limit create failure. The retry path:
--name/--cidfilecontainer artifacts before retrying;--nameor--cidfileinside the container command cannot trigger cleanup of an unrelated container.The package fallback helper receives the same behavior because it can run without the shared container helper in package-backed lanes. Explicit user-provided Docker run arguments remain on retry; only OpenClaw's injected default caps are removed.
User Impact
Developers and CI operators can run Docker E2E lanes on more host configurations without manually disabling resource limits. Normal hosts keep the existing capped Docker runs, and non-resource failures such as missing images or container-command exits still fail immediately without retrying as a different command.
Evidence
Duplicate search before opening:
gh pr list -R openclaw/openclaw --state all --search "Docker cgroup resource limits pids limit fallback" --limit 20returned only older unrelated sandbox/low-memory PRs (feat(sandbox): pluggable ISandboxProvider — 3-tier isolation with browser automation (Docker/gVisor/Firecracker) #41437, fix: improve npm install resilience on low-memory systems #39463).gh issue list -R openclaw/openclaw --state all --search "Docker cgroup resource limits pids limit fallback" --limit 20returned no issues.Local checks:
bash -n scripts/lib/docker-e2e-container.shbash -n scripts/lib/docker-e2e-package.shnode scripts/check-docker-e2e-boundaries.mjsnode_modules/.bin/oxlint.cmd scripts/lib/docker-e2e-container.sh scripts/lib/docker-e2e-package.sh test/scripts/docker-build-helper.test.tsnode_modules/.bin/oxfmt.cmd --check test/scripts/docker-build-helper.test.tsgit diff --checkpython .agents/skills/autoreview/scripts/autoreview --mode localFocused local Vitest on Windows with Git Bash and
/tmptemp paths:Real constrained-daemon proof on 122.51.21.218:
VM-0-5-ubuntuLinux 5.15.0-170-generic x86_64server=29.6.1 cgroup=2 driver=overlayfs cgroupDriver=systemdFROM scratchBusyBox image without pulling from a registry, and ran the helper against that real daemon.NanoCPUscgroup error.Helper proof against the same rootless daemon after this patch:
Cleanup after the remote proof: