Repository navigation
fix(sandbox): report checkpoint capture paths and timing - #196807
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. |
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. |
|
Please review exact head The 12 focused owner cases, corrected-observer baseline red/restored-candidate green, runtime build and Codex P0–P2 review pass. There are no published review findings to address yet. Landing is held for a final-head review with zero open items. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR logs checkpoint capture choices, fallback reasons, and capture and resume timings. Example: A Btrfs snapshot omits a nested subvolume, requiring paused capture.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it adds useful, maintainer-directed checkpoint diagnostics, preserves existing capture behavior, and has no actionable correctness or security findings. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSandbox command finalization checkpoints private workspace edits into the canonical worktree; the existing capture and finalization owners now report their decisions and timings. flowchart TD
A[Sandbox command completion] --> B[Checkpoint owner]
B --> C[Paused or snapshot capture]
C --> D[Canonical synchronization]
D --> E[Runtime finalization]
E --> F[Capture diagnostic log]
Technical reviewBest possible solution: Keep the bounded diagnostics in the existing capture and finalization owners without introducing another lifecycle or tracing mechanism. Do we have a high-confidence way to reproduce the issue? Fetched-main source confirms the missing capture-path and phase diagnostics; no runtime reproduction was performed. Is this the best way to solve the issue? The patch records facts where capture and resume already occur, preserves existing decisions, and accurately documents the limits of its measurements. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a1c1fb1dc5d7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +59, Tests +83, Docs +17, Other +3. Total +162 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:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (1 earlier review cycle)
Reviewed November 10, 2026, 2:20 PM ET / 19:20 UTC (Revision 2). |
|
Merged via squash.
|
Integrate main to resolve capture-owner conflicts with #196807. Preserve checkpoint capture diagnostics and use its resume wrapper to clear reconcile pause state only after a successful resume. All 31 affected projection tests, core and affected-test typechecking, targeted lint and line-cap checks pass. Codex review has no actionable P0-P2 findings. Existing unrelated unused-export failures retain their exact-parent investigation; native measurement is still in progress.
What Problem This Solves
A checkpoint pause can still take seconds after atomic snapshot capture was introduced. Existing pause logs do not show whether a checkpoint used a snapshot, selected direct capture, or fell back because its source could not be snapshotted. They also cannot separate snapshot creation from work before capture and runtime resume.
User Impact
Each attempted checkpoint reports a bounded capture path and reason in its existing owner log. The rendered message retains these facts in plain journals, including an attempted snapshot followed by nested-subvolume fallback. Operation-local timings distinguish pre-copy settlement, the native copy helper, post-copy inspection, and resume. No paths, file contents, new scan, cache, schema or configuration are added.
This is diagnostic visibility, not a claim that copy time measures a particular syscall or dirty writeback. Existing capture selection, fallback, canonical acceptance and read-after-command behavior remain unchanged.
Why This Change Was Made
Follow-up to #196662 and #196727. Read-only inspection of the affected production workspaces found btrfs subvolume roots, so the non-subvolume eligibility guard does not explain the observed slow pauses. Two slow workspaces contain roughly 240k–288k filesystem entries and 4.1–5.9 GB, substantially more than the 62k-file/1.1 GB synthetic fixture. No immediate resume/re-pause signature established nested fallback; these observations do not prove its absence or attribute a syscall delay.
The historical 21-second pause predates snapshot capture. Its owner-level cause was synchronization under pause, while its lower-level time distribution is unavailable. The new diagnostics make future capture-path and phase attribution possible without adding production tracing.
Evidence
The checkpoint owner suite exercises adaptive direct capture, successful snapshots, unavailable clone capability, non-subvolume roots, clone failure, nested fallback, interrupted acceptance and cleanup overlap. The log observer runs synchronously at the owner boundary, allowing emission ordering and canonical consistency to be checked together. The corrected final observer fails on exact parent d7f90ec because no capture record is emitted, then passes on the restored candidate. All 12 focused cases pass; the final observer wiring is additionally verified by the restored small-workspace case. Codex autoreview is scoped-clean through P2.
pnpm build:runtimepasses.Production growth is 59 lines for an operation-local bounded reason/timing record and one rendered log; no extra scan or probe is introduced. Regression growth is 83 lines, allocated to the existing test budget; the guard passes with seven lines of slack. No UI-imported module changes.
pnpm check:changed --base d7f90ec35cffc25b8472ac1aa0d9ed871aafd907completed: every category passes except the unused-export scans (33 production / 10 full-tree). Five production entries and two full-tree entries beyond the earlier 28/8 set were introduced by #196380 (37a3b162a0c58aaceb1634aaef726d0e178a529c); the changed diagnostic owners are not among them. The prior set retains its previously established introducing commits. These are main regressions. Both failed Knip commands reproduce on exact parent d7f90ec with identical normalized 33/10 sets and no resolution errors. The parent archive verified all 66,362 tracked blobs; isolated dependency copies resolve workspace links into that parent, not the candidate. Only the two failed scans were replayed.The preserved native fixture remains available, but a bounded readiness check found concurrent host activity exceeding its quiet limits. No timing campaign was started, and no new performance claim depends on it. No production restart, configuration change, deployment, tracing or data copy was performed.