Repository navigation
fix: shorten sandbox freezes during workspace base refresh - #199717
Conversation
Resume existing guest runtimes during canonical merge, checkout, and patch preparation; resume settled refreshes before temporary payload cleanup. Retain target preflight conflict detection and interrupted guest-write recovery. Add registered-action write-preservation regressions and extend the native owner benchmark with phase and database-shape evidence.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets sandbox commands continue during base-refresh preparation and successful transfer cleanup. Example: A running sandbox command shares a workspace while prepare_pr integrates newer source files.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is a useful, maintainer-authored draft that narrowly reduces unnecessary sandbox pauses; source review found no actionable introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGitHub source integration prepares canonical Git results, then the workspace projection owner transfers them into the guest filesystem using existing pause, conflict, acceptance, and recovery operations. flowchart TD
A[GitHub source action] --> B[Workspace projection owner]
B --> C[Canonical preparation with guest running]
C --> D[Pause and confirm guest target]
D --> E[Apply and accept transfer]
E --> F[Resume guest and clean temporary data]
Technical reviewBest possible solution: Retain the two existing-owner resume boundaries while preserving target confirmation, two-sided acceptance, and interrupted-mutation recovery. Do we have a high-confidence way to reproduce the issue? Current-main source retains the guest pause across canonical merge preparation and refresh cleanup; the body reports red/green registered-action regressions, but this read-only review executed no target code. Is this the best way to solve the issue? The patch uses the existing quiescence and acceptance owners without adding runtime state or parallel policy, and its added tests cover distinct pause-placement, concurrent-write, and recovery failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cec47fd13f23. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +56, Docs +4, Other +52. Total +116 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 15, 2026, 1:50 PM ET / 18:50 UTC. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merged via squash.
|
Resume existing guest runtimes during canonical merge, checkout, and patch preparation; resume settled refreshes before temporary payload cleanup. Retain target preflight conflict detection and interrupted guest-write recovery. Add registered-action write-preservation regressions and extend the native owner benchmark with phase and database-shape evidence.
Allow initial guest PR preparation from the recorded project's published history while preserving unpublished work and original PR identity. (cherry picked from commit 2757947) Stable adaptation: preserve the existing linked-identity fixture; expand its options type and allocate exactly 89 regression LF instead of 84. Production and documentation patches are unchanged from the source. Companions: #188785 is present-equivalent. Later #188784, #190223, #190576, #190542, #195413, #197229, #197243, #199717, #195787, #197510, #193664, #199851, #199864, #197656, #198851, #193873, #197594, #189006, #188904, #194025, #196200, #192283, #189010, #188816 and e0466ff are not prerequisites to this scoped repair; retain their separate intake dispositions. No later PR-number mentions. Proof: baseline 4 failed/20 passed through registered agent action; fixed 41/41 across preparation, refresh and base-action suites. Type-aware lint4, formatting5, docs MDX1419 and diff check pass. No live GitHub or full release qualification claim. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes long freezes of running sandbox tools while base refresh and PR-source integration prepare canonical Git trees and remove temporary files.
User Impact
Existing guest commands can continue through repository merge preparation, temporary checkout creation, and successful post-transfer cleanup. Guest application still pauses its writers and confirms the prepared target before changing files. Conflicting guest writes remain saved and cause a visible conflict or retry error. Interrupted guest mutations retain their recovery pause.
Why This Change Was Made
Ordinary reconciliation already releases the guest during materialization and patch preparation. Base refresh retained an earlier pause across canonical work and kept the final pause through materialized-tree cleanup. Resume at those two existing owner boundaries; retain the existing projection revision, authority checks, journal settlement, and confirming target preflight. Guest writes do not advance a database revision, so the preflight comparison remains the content fence.
Runtime production delta: +4 net lines, including the existing operation-phase marker after resume. No schema, configuration, new cache, or stored-format change. The checkpoint-reference acceptance contract from #199683 remains intact; this is separate from the hashing fix in #199687 and payload work in #199524.
Evidence
Supplied read-only Team r335 / 292a425 aggregates show recurring 66–142 s pauses, including 38–53 s operation, 15–21 s cleanup, and 5–6 s capture. A prior local base-refresh reproduction measured 44.95 s of real repository work. At 16:57Z and 17:22:48Z, two sends queued 161.6 s and 142.7 s respectively (the latter included 134.6 s reply initialization), then drained 10–15 s after a long pause ended. Another 20.8 s queued send drained 13 s after a 66 s pause. This is a reported correlation, not a production causal replay; no Team state was accessed or modified by this change.
Native btrfs/Podman results at
c2f2d749, against exact baseline293518e8: synthetic 62,000 files / 1,100,004,000 bytes and a 37,780,287,488-byte (35.2 GiB) agent database with 10,000 synthetic sessions. Two baseline A/A controls preceded five counterbalanced pairs. Every arm verified canonical Git tree identity and every payload file in both trees.Baseline A/A maximum pauses were 34.62/35.00 s and owner times 52.62/53.11 s. Across the five pairs, maximum pauses ranged 35.37–36.43 s before and 7.74–9.47 s after. These are observed samples, not production tail estimates. Materialization, patch preparation, and successful cleanup recorded zero paused time in every candidate arm. Median paused cleanup was 7.74 s before; it runs resumed after the fix. The coarse operation phase still includes the initial pristine snapshot reads. Initial consistent capture and final guest confirmation/application retain their freezes.
The native guest uses real Podman pause/unpause and a 25 ms heartbeat; GitHub responses are synthetic. This cold PR-import workload exercises the base-refresh owner on Team-shaped synthetic state, without Team access or live model calls. Process CPU excludes spawned Git/Podman subprocesses. Separate Node 24.22.1 profiling (two A/A controls and two counterbalanced pairs) measured sampled main-isolate allocation at 1279.16 → 1292.15 MiB (+1.02%). All six profile runs verified outputs. The initial large pinned-Bun baseline allocation control crashed with SIGSEGV; the successful unprofiled Bun timing campaign is unaffected, and no large-fixture Bun allocation result is claimed. Node profiling uses the repository-supported runtime selector, with identical runtime and source harness in both arms. The predeclared timing acceptance passed, including no unexplained >20% regression in a user-facing metric.
The existing registered-action cold-source tests fail on the original head because temporary checkouts run paused, and pass with the fix. A guest write during patch preparation is detected before mutation and remains intact, including on the full 62,000-file/35.2 GiB synthetic fixture. Existing recovery coverage now also writes while canonical-only acceptance is interrupted and verifies preservation through recovery. The full focused run and focused recovery replay cover 132 passing cases with two environment-dependent skips; the old pause expectation was updated only with that additional preservation proof.
Codex P0–P2 autoreview found no actionable defects. Final staged
pnpm check:changedpassed. Exact-head CI, includingopenclaw/ci-gate, and artifact build passed. No CI rerun or inherited-red exception was needed. ClawSweeper and hosted Codex reviewed the same head with no actionable findings; ClawSweeper has zero open checkbox items. No changed module is imported byui/src.