Repository navigation
fix(update): seal recovery captures on large state directories - #188919
Conversation
Batch metadata inventory by escaped UTF-8 byte size under the existing child output cap, with one deadline and caller cancellation across batches. Keep large discovery and backup results in private settled worker artifacts and make unavailable original-state capture explicit in update warnings. Co-authored-by: ourcoms2018 <[email protected]> Co-authored-by: steipete <[email protected]>
|
🦞👀 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. |
Make the older-candidate fixture decline result-file transport before rewriting its real stdout response, preserving the legacy capacity check. Co-authored-by: ourcoms2018 <[email protected]> Co-authored-by: steipete <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesThis PR batches metadata inventories, transports large worker results through private files, and makes unavailable recovery captures explicit. Example: An update captures 12,000 existing files with long paths.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a confirmed recovery-capture failure still present on current main; source review found no discrete correctness or security defect. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe installed updater inventories source files and databases, delegates inspection and backup to owned workers, and uses their results to seal recovery captures before continuing the update. flowchart TD
A[Update CLI] --> B[Recovery capture owner]
B --> C[Byte budgeted metadata batches]
C --> D[Bounded metadata child]
B --> E[Inspection and backup workers]
E --> F[Private result file or legacy stdout]
F --> B
B --> G[Sealed capture or recorded warning]
Technical reviewBest possible solution: Retain the shared batching and result transport, with packaged upgrade evidence confirming existing settings, data, and recovery captures remain usable. Do we have a high-confidence way to reproduce the issue? The current parent and real child establish a deterministic oversized-array failure, supported by the reporter's official-release observations and the PR's reported base-versus-fix controls; this review executed no reproduction. Is this the best way to solve the issue? Byte-budgeted batches fix the existing inventory owner, while one opt-in result transport closes the same limit in sibling workers without changing stored formats or removing released-worker interoperability. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18516599b1d4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +103, Tests +184, Docs +1, Other +2. Total +290 across 12 files. Added test files: 2. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 Reviewed October 30, 2026, 9:48 PM ET / October 31, 2026, 01:48 UTC. |
|
Merged via squash.
|
…law#188919) Batch metadata inventories by escaped UTF-8 JSON byte budget while retaining the fixed 1 MiB per-child stdout cap, one aggregate deadline, and caller cancellation. Share bounded private result-file transport across sibling capture launchers and warn clearly when optional original-state capture cannot seal, while allowing updates to succeed. Verified 12,000-entry ASCII, multibyte, and escaped inventories; cancellation and aggregate deadlines; sibling transports and JSON warning visibility. Contained 12,000-file production capture sealed and all 12,002 restored payload hashes matched. Exact-head CI run 41155734580 passed; fresh independent Codex P0–P2 review and ClawSweeper reported zero findings. Fixes openclaw#188897 Co-authored-by: ourcoms2018 <[email protected]> Co-authored-by: steipete <[email protected]>
Release adaptation: port #188919 with its #190991 monotonic-clock companion; omit release-owned changelog. Bounded result-file transport preserves legacy stdout producers; metadata batches retain one aggregate deadline, cancellation, and uncertain cleanup custody. Self-review: one transport owner, no schema changes; retained growth is the required producer/consumer cutover and distinct boundary regressions. Proof: baseline real-child 12000-entry regression fails output-limit; all 8 inventory, transport, cancellation, deadline and wall-clock regressions pass. Formatting and diff checks pass. Focused CLI preview is still pending; parent release qualification remains required. Later same-path #190991 included; no other later sizes-owner change. (cherry picked from commit 4f1515d) (cherry picked from commit ab35e1f) Co-authored-by: ourcoms2018 <[email protected]> Co-authored-by: SunnyShu <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Fixes #188897
What Problem This Solves
Large state directories can leave every pre-update recovery capture incomplete because the inventory exceeds a child process's stdout limit.
User Impact
Recovery captures can now seal with large inventories. Failed optional captures explicitly warn
NO ORIGINAL-STATE SNAPSHOTwhile the update continues; the warning remains in returned JSON and update history.The fix must be installed in the updater performing the capture. A newer candidate cannot repair an older updater process already running. Older candidate workers retain their existing stdout contract and limit.
Why This Change Was Made
Metadata inventories now run in serial batches budgeted by escaped UTF-8 JSON bytes, with room for result fields, one aggregate deadline, and the same caller cancellation signal. Order, duplicates, missing files, and SQLite sidecar sizes are preserved; failure returns no partial inventory or subsequent child after cancellation. The per-child 1 MiB stdout cap stays unchanged.
The sibling audit also found unbounded database-discovery, backup-receipt, schema/generation, and candidate snapshot results. Both launchers now share an opt-in private result-file transport, read after successful process settlement and bounded like the existing recovery manifest. Legacy stdout interoperability and uncertain-cleanup retention remain intact. Payload capture already runs in process; progress backpressure handling needed no change.
Other open proposals for this issue: #188907 and #188912. This PR implements the requested fixed-cap batching design and covers the sibling result transports and warning behavior.
Evidence
ae01f1c113826d3ff41463e74da6c115e5b581ffrejects 12,000 copies of an existing 160-character path withoutput-limit; the fixed owner returns all 12,000. Original-owner controls also reject the ASCII, UTF-8, and quote/backslash cases.1fafd9c4b9379d3c2b9ba4bac41d6e5b269f461739a8b14098c81f8de4615995. No protected-state access, service execution, or TCP activity. This proves capture sealing and payload reconstruction; it does not claim an installed-package upgrade or automatic rollback over active state.ae01f1cwith the same missing error callback; its same-order five-test prefix has 4 passing / 1 failing. No retry/ignore/exception masks it. Both capture-warning regressions pass. The candidate resource/legacy-stdout owner suite passes 25/25 under private umask077; this host’s default0002also exposes an unrelated explicit-temp fixture permission failure on untouched base. No product guard or assertion was relaxed.ae01f1cand candidate tree3155ef3d5b5440be3d8ead464cec865ecc1a8b74: scoped-clean, zero findings. Refreshed after the legacy stdout fixture cutover; one complete pass with all 12 changed files and supplied owner/caller context; the isolated reviewer did not execute tests. Helper source SHA-256:ea4d3415094d50a670f28a1ee092e928a9dbcf7327103014c3a9f909d9a6ef17.ae632d33a5f6366d661b4e781cb10560370e583f, attempt 1: 45 passed / 26 skipped, including all three PostgreSQL conformance shards. Final PR checks: 63 passed / 57 skipped, none failed or pending. Workflow wall time: 1,504 seconds (25m 4s). The initial legacy-stdout fixture failure was corrected and verified; no workflow was rerun to chase green.Design credit: @ourcoms2018 proposed and tested the fixed-cap batching design. Co-authored with @ourcoms2018 and @steipete; both human credits are preserved in the commit trailers.
Work sessions
Implementation and verification