Skip to content

fix(sandbox): report checkpoint capture paths and timing - #196807

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-checkpoint-capture-diagnostics-2372
Nov 10, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-checkpoint-capture-diagnostics-2372

Conversation

@steipete

@steipete steipete commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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:runtime passes.

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 d7f90ec35cffc25b8472ac1aa0d9ed871aafd907 completed: 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.

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Nov 10, 2026
@steipete
steipete marked this pull request as ready for review November 10, 2026 18:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T19:01:10.809039Z 2f6df5f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Please review exact head 2f6df5f67533d949c383c67f7cd5723828f42491 for the checkpoint diagnostic follow-up.

The 12 focused owner cases, corrected-observer baseline red/restored-candidate green, runtime build and Codex P0–P2 review pass. check:changed passes every category except Knip 33/10, reproduced identically on exact parent d7f90ec; #196380 introduces the newly inherited entries. The PR body records the evidence and production attribution limits. No capture/fallback behavior changes are intended.

There are no published review findings to address yet. Landing is held for a final-head review with zero open items.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR logs checkpoint capture choices, fallback reasons, and capture and resume timings.

Example: A Btrfs snapshot omits a nested subvolume, requiring paused capture.

  • Before: Pause logs do not identify the snapshot attempt or nested-subvolume fallback.
  • After: The diagnostic includes path=paused, reason=nested-incomplete, attemptedSnapshot=true, and available phase timings.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused diagnostics with no concrete introduced defect; behavioral evidence reaches the checkpoint owner but does not demonstrate the shipped logging path.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored diagnostic change is outside the ordinary contributor proof gate; supplied evidence exercises the production checkpoint owner with simulated transport and copy operations, without a shipped-entry-point log capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators investigating slow checkpoint pauses cannot distinguish capture choices or locate time spent around copying and runtime resume.
Reason: The maintainer-authored direction provides useful diagnostic visibility at modest cost without claiming to fix the underlying pause duration.

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
Reviewed head: 2f6df5f67533d949c383c67f7cd5723828f42491

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied CLI or Gateway run demonstrates the new record through the real logger and native checkpoint path.
Agent review details

How this fits together

Sandbox 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]
Loading

Technical review

Best 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

  • Atomic capture and nested-subvolume fallback keeps the original intent (10d6744: Resume supported Btrfs workspaces before scanning while retaining complete paused capture when snapshots omit nested subvolumes.)
  • Adaptive capture and artifact retirement keeps the original intent (d7f90ec: Avoid snapshot overhead for small checkpoints and overlap retired-artifact cleanup with subsequent commands.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 10d6744 adds src/gateway/worker-environments/local-workspace-projection-operation.ts:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 10d67445fbec; files: src/gateway/worker-environments/local-workspace-projection-operation.ts)
  • RoboClaw: Raw commit 28d8ee4 adds src/gateway/worker-environments/local-workspace-projection.test.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 28d8ee4f096b; files: src/gateway/worker-environments/local-workspace-projection.test.ts)

PR surface

Source +59, Tests +83, Docs +17, Other +3. Total +162 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 91 32 +59
Tests 2 91 8 +83
Docs 1 17 0 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 0 +3
Total 6 202 40 +162

Preflight source

Source 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

Metric Value Why it matters
Production versus regression-test growth Production +59 net lines; tests +83 net lines Growth supports operation-local diagnostics and distinct fallback regressions within existing owners and fixtures.

Labels

Label changes:

  • add P3: Diagnostic visibility improves investigation of slow checkpoints without changing execution or recovery behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: Diagnostic visibility improves investigation of slow checkpoints without changing execution or recovery behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Optionally capture a redacted real checkpoint log showing the selected capture reason and measured phases.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-10T19:14:23.143Z sha 2f6df5f :: needs maintainer review before merge. :: none

Reviewed November 10, 2026, 2:20 PM ET / 19:20 UTC (Revision 2).

@steipete
steipete merged commit 7e19844 into main Nov 10, 2026
222 of 225 checks passed
@steipete
steipete deleted the steipete/fix-checkpoint-capture-diagnostics-2372 branch November 10, 2026 19:21
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Nov 10, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant