Repository navigation
fix(sandbox): preserve active runtimes during age pruning - #131941
vyctorbrzezowski wants to merge 5 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 7, 2026, 5:37 AM ET / 09:37 UTC (Revision 10). ClawSweeper reviewWhat this changesThe branch coordinates sandbox commands, filesystem operations, and browser requests with automatic cleanup so runtimes remain available until active work settles. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain This PR remains useful: current main does not provide its active-work lifetime protection, and the previously reported crash-recovery blocker remains unchanged. Its maintainer authorship and protected label also exclude automatic closure. Likely related people: steipete and Vincent Koc are routing candidates based on recent sandbox history; historical responsibility is unverified. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw sandboxes execute agent commands and filesystem operations, with a separate browser bridge handling browser requests. Provisioning and automatic pruning manage those runtimes using the shared SQLite registry. flowchart TD
A[Agent commands and file operations] --> B[Runtime activity admission]
C[Browser requests] --> B
B --> D[Sandbox runtime]
E[Age and idle pruning] --> F{Scope free and no active work?}
G[SQLite runtime registry] --> F
F -->|Yes| H[Remove runtime and registry entry]
F -->|No| D
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +722, Tests +1136, Docs +2. Total +1860 across 36 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep lifetime protection in the existing sandbox lifecycle, recover definitely dead gate owners safely, and integrate it with current main's worker-backed registry without changing manual recreation or confinement. Do we have a high-confidence way to reproduce the issue? Yes: source and the shared lock regression establish that a dead-owner gate sidecar produces file_lock_stale on subsequent admission. This review did not execute a crash/restart reproduction. Is this the best way to solve the issue? Yes, coordinating cleanup with admitted work is the appropriate owner-level repair, but fail-closed gates need definite-dead-owner recovery before the patch is ready. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5077ad4f99aa. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
ab32c54 to
0eb47da
Compare
0eb47da to
0caefec
Compare
9582481 to
e685e01
Compare
Keep lifetime protection across sandbox backends while deferring the remote cleanup locator redesign. Preserve current-main mount admission and filesystem mappings, skip contended prune scopes, and join execution finalization and browser response settlement. Co-authored-by: vyctorbrzezowski <[email protected]>
Finishing pass complete — lifetime protection onlyFinal head: 9f1ae8f; tree: 5cf76f819b0e5c579cb383574b7f442d644f7af2. Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/35119044774 (completed successfully, no failed/pending jobs at closeout). The PR remains open; no landing or auto-merge was performed. The approved scope split is implemented: preserve active-work lifetime protection across relevant backends and existing main/manual-recreation behavior, while removing this PR’s additional remote-locator/upgrade redesign. Handle-local finalization, nonblocking scope admission and final-settlement ownership remain. The browser response-backpressure gap found during review is fixed. Evidence
Remote destination binding, mutable endpoint identity, reservation metadata and supported legacy retirement remain an explicit follow-up, not a newly chosen deletion policy. Owned Testbox workloads are terminal. The final finishing report records exact trees, separate test receipts, provenance, review/CI history and cleanup caveats. Worked on by @vyctorbrzezowski; finishing commits contain the requested co-author trailer. No PR merge, deployment or main push. |
Move the unchanged completion diagnostic projection into a coherent private sibling so active-work signal propagation does not grow the grandfathered over-cap runtime module. Preserve all event fields and callers without changing line-cap budgets or suppressions. Co-authored-by: vyctorbrzezowski <[email protected]>
Move unchanged outcome and failure types into exec-types and update every internal consumer. Remove the diagnostics type-only back-reference to the process runtime so both runtime and full import graphs remain acyclic. Co-authored-by: vyctorbrzezowski <[email protected]>
What Problem This Solves
Age-based sandbox pruning can terminate real work while it is still running. This change keeps active runtimes owned through execution, stream and finalization settlement, rather than treating age or process exit alone as permission to remove them.
Closes #131935.
User Impact
Active sandbox work is protected across the relevant backends, including filesystem operations and browser response settlement. Automatic pruning skips busy scopes without blocking unrelated provisioning; existing current-config confinement and manual recreation behavior remain intact.
Why This Change Was Made
This PR is deliberately narrowed to active-work lifetime protection. Its additional remote-locator and upgrade redesign has been removed without undoing accepted main behavior. Physical destination binding, mutable remote endpoint identity, reservation cleanup metadata and supported legacy retirement are deferred follow-up work—not a new deletion policy silently introduced here.
Handle-local finalization and scope admission retain ownership through final settlement. Independent review also found and prompted a fix for browser HTTP response backpressure. The CI follow-up extracts unchanged diagnostics and places outcome types in a shared leaf module to satisfy line-count and both dependency-cycle checks without weakening gates.
Evidence
Final head:
9f1ae8f954a56f874a7130e37727a9b020fecf6eFinal tree:
5cf76f819b0e5c579cb383574b7f442d644f7af2Detailed proof and scope notes. Unchanged Talk/memory timing failures were investigated; the final exact-head CI run passed without relaxing their assertions.
Worked on by: @vyctorbrzezowski. Finishing commits contain the requested co-author trailer. The PR remains open, with its existing review state preserved; no merge, auto-merge, deployment or main push was performed.
View the OpenClaw team session