Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 7:31 PM ET / 23:31 UTC. Summary PR surface: Source +22, Tests +40, Docs +1. Total +63 across 7 files. Reproducibility: yes. source-level: current main lacks a general create-args epoch in the sandbox hash while sandbox reuse depends on openclaw.configHash. I did not run a live Docker workload in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land or replace this as one coordinated sandbox rollout that couples the real Docker create-args change with the epoch bump, removes the normal-PR changelog edit, preserves current hash inputs/tests, and proves fresh plus upgrade Docker behavior. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main lacks a general create-args epoch in the sandbox hash while sandbox reuse depends on openclaw.configHash. I did not run a live Docker workload in this read-only review. Is this the best way to solve the issue? No, not as a split mechanism-only PR. The epoch pattern is useful, but the safer fix is to bump it with the real create-args change and prove the existing-container rollout. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 03d23c56d14d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +22, Tests +40, Docs +1. Total +63 across 7 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
|
|
Thanks for the review. Both findings addressed in [P1] Renamed [P3] Added Re-ran the affected tests; the Note on CI: the |
buildSandboxCreateArgs already drives container recreation via the labelled configHash, but the hash inputs only capture mount layout and browser security flags. Adding or changing other docker create flags (such as --init in #74083) does not invalidate the hash, so existing containers keep their previous flags forever. Long-running deployments — for example scope: "agent" with prune.maxAgeDays: 0 — never recreate naturally and never pick up a new flag. The most-affected pattern is exactly the one #68691 reports for the missing --init: a multi-week sandbox accumulating <defunct> children under PID 1 because tini was not enabled at create time. Add a SANDBOX_DOCKER_CREATE_ARGS_EPOCH constant and a createArgsEpoch field to both SandboxHashInput and SandboxBrowserHashInput. Bump the date-tagged epoch whenever buildSandboxCreateArgs gains, drops, or changes container creation flags. Mirrors the existing SANDBOX_BROWSER_SECURITY_HASH_EPOCH / mountFormatVersion pattern, and also stamps the epoch as an openclaw.createArgsEpoch container label for diagnostics, alongside the existing mountFormatVersion label. Pairs with #74083: that PR adds --init; this commit makes the rollout actually reach existing containers. Refs #68691, #74083.
Address clawsweeper review on PR #76590: - [P1] Rename SANDBOX_DOCKER_CREATE_ARGS_EPOCH from "2026-05-init-tini" to a neutral "2026-05-bootstrap" value. The previous string implied --init was already part of this PR; in fact --init lands separately in #74083. Pre-bumping under that string would let containers be recreated with an "init-tini" hash while the actual create args still lack --init, and a later same-string bump in #74083 would no longer force a recreate. Add a header comment that explicitly tells future contributors to bump the epoch in the same PR (or a follow-up PR) as the actual flag change, never speculatively. Test using "2026-05-init-tini"/"2026-04-pre-init" sentinels updated to neutral "epoch-v1"/"epoch-v2" so the test asserts the mechanism without claiming any specific feature lineage. - [P3] Add "Thanks @aaajiao." attribution to the Unreleased changelog entry per repo convention. This PR now adds the mechanism only. Whichever PR ships the first real buildSandboxCreateArgs flag change (e.g. the --init rollout in
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the contribution. I’m closing this stale PR because the latest review rated the current branch F: it still lacks the requested real-behavior proof or merge-ready branch shape, and there has been no human follow-up after the review. A fresh, focused PR against current |
|
Thank you @aaajiao — the rollout invariant from this PR has landed on The landed fix uses one shared create-arguments epoch in both ordinary and browser sandbox hashes. Idle old-hash containers recreate automatically; recently active containers are preserved and receive the existing explicit recreate hint. Focused tests, real Docker lifecycle proof, and exact-head CI run 29072559013 all passed. Recording the canonical landed proof here; this PR was already closed. |
Summary
Adds a
SANDBOX_DOCKER_CREATE_ARGS_EPOCHconstant and acreateArgsEpochfield to bothSandboxHashInputandSandboxBrowserHashInput, so the existing config-hash recreate path also fires whenbuildSandboxCreateArgsadds, removes, or changes container creation flags.This PR adds the mechanism only. It does not ship any flag change itself. Whichever PR adds the first real flag change (for example #74083 adding
--init) bumps the epoch from the bootstrap value in the same release as the flag.Why
buildSandboxCreateArgsalready drives container recreation via the labelledopenclaw.configHash, but the hash inputs only capture mount layout (mountFormatVersion) and browser security flags (securityEpoch). Other docker create flags are invisible to the hash. So adding any new flag in a future PR (--init, cgroup limits, sysctls, capabilities, namespace flags, etc.) does NOT invalidate the hash, and existing containers keep running with their old flags forever.The most-affected pattern is exactly the one #68691 reports: long-running sandbox containers (
scope: "agent"+prune.maxAgeDays: 0) stay alive for weeks and never recreate naturally. Without an epoch in the hash, they never pick up new flags.What this PR adds
SANDBOX_DOCKER_CREATE_ARGS_EPOCHinsrc/agents/sandbox/constants.ts, set to a neutral bootstrap value ("2026-05-bootstrap") and date-tagged so reviewers can tell at a glance which release introduced the bump."init-tini"would let containers be recreated with a hash claiming the new behaviour while the actual create args still lack it.createArgsEpoch: stringin bothSandboxHashInputandSandboxBrowserHashInput. Mirrors the existingsecurityEpoch/mountFormatVersionpattern.docker.ts:ensureSandboxContainer,browser.ts:ensureSandboxBrowser) to pass the new constant.openclaw.createArgsEpoch=...container label stamped at create time, alongside the existingopenclaw.mountFormatVersionlabel, for diagnostics.config-hash.test.ts,docker.config-hash-recreate.test.ts) updated; new test "changes when docker create args epoch changes" mirrors the existing security-epoch test using neutral"epoch-v1"/"epoch-v2"sentinels.## Unreleased > ### Fixesdescribing the mechanism, withThanks @aaajiao.per repo convention.Reusability
When future PRs add or change container flags, the contributor only needs to bump the
SANDBOX_DOCKER_CREATE_ARGS_EPOCHstring in the same change and add a one-line history entry to the comment. No new types, no new test scaffolding, no risk of forgetting to invalidate the hash.Relationship to #74083 (and #68691)
Originally I had named this epoch after the
--initrollout. Per clawsweeper P1 review, that was wrong — it would let this PR claim a feature ship that lives in a separate PR. The current value is neutral; the--initrollout in #74083 is responsible for bumping the epoch when it lands. With both merged in the same release, the long-running-container pattern reported in #68691 is fully addressed.Test plan
pnpm test src/agents/sandbox/config-hash.test.ts— existing + new tests pass locallypnpm test src/agents/sandbox/docker.config-hash-recreate.test.ts— recreate path still asserts hash mismatch triggersdocker rm -fchecks-node-agentic-clifailures inplugins-location-bridges.test.tsreproduce on upstream/main — see commit5ecd01ff9— and have no overlap with sandbox)scope: "agent"sandbox is recreated on next agent run🤖 Generated with Claude Code