Repository navigation
improve(update): record runtime retention costs - #157386
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: blocked before merge. Reviewed September 25, 2026, 3:37 AM ET / 07:37 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds inventory and file-materialization timing, size estimates, and link and copy counts to successful updater runtime-retention receipts, with focused tests. Merge readiness⛔ Blocked before merge - 2 items remain Current main still records only aggregate runtime-retention time, so the distinct diagnostics remain useful. Source review found no blocking patch defect. The repository-required published-driver upgrade check is still running. Priority: P2 Review scores
Verification
How this fits togetherDuring an update, OpenClaw retains the running updater’s code and dependencies before replacing the installation. The updater records its progress in durable run history that operators can inspect. flowchart LR
A[Update request] --> B{Running code at risk?}
B -->|Yes| C[Inventory dependencies]
C --> D[Link or copy files]
D --> E[Retention measurements]
E --> F[Update run history]
B -->|No| F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +22, Tests +24. Total +46 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the measurements in the retention owner and the bounded update-run receipt, then confirm the published-driver upgrade succeeds while older history remains readable. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds diagnostic measurements. Current-main source confirms it records only the aggregate retention duration. Is this the best way to solve the issue? Yes: the retention owner has the measurements, and the existing update-run receipt is the narrowest place to expose them. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 921b1df671d5. 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
History |
|
Merged via squash.
|
Backport #157329: c926e83 Backport #157752: 5f8e15a Backport #157386: 74b9103 Take only the required OverlayFS materialization subset of #157770: 963089a Preserve the frozen lifecycle and ownership contracts. Keep the recorded watchdog outcome without deleting unjoined runtimes, recognize legacy pnpm projections through a bounded store scan, and inspect service scratch roots. Retain the original proofs plus targeted review regressions. Native platform and installed-upgrade qualification remain separate required release proof. Upstream Windows and filesystem evidence credits WG-Mojo and DonnieFi. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
* improve(update): record runtime retention costs * fix(update): return explicit retention no-op result Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Update history reports one runtime-retention duration, leaving operators unable to tell whether dependency inventory or file materialization dominated a slow update.
User Impact
Completed retention now records inventory and materialization milliseconds, entry count, estimated allocated bytes, and file link/copy counts in the existing diagnostic receipt. This adds measurements only; it does not make updates faster or change timeout, authority, storage, or recovery behavior. The measurements apply to updates started after this version is installed.
Why This Change Was Made
The retention owner already has the inventory and materializer counts. Return those facts after successful runtime binding and record them through the existing update diagnostics path. Skipped or failed retention does not emit fabricated measurements. Estimated bytes include directories and aliases; link/copy counts count file entries, not unique inodes. Materialization time includes I/O budget and watchdog settlement, not only file copying.
Production: +27/-5 (net +22), justified by the missing operator-visible measurements. Tests: +28/-4. No new configuration or schema fields.
Evidence
4b51bf437ed9609ccb5061e301a463f6f30000e4. Independent review against current main505652e88d7421fd757cee71950511f0a203ea48found the diagnostics still needed and source-compatible. Fresh autoreview found no actionable issues through P2.openclaw/ci-gateand core lint: https://github.com/openclaw/openclaw/actions/runs/36026459229.src/infra/update-retained-runtime.test.ts: all 17 tests passed in job107726868635. The five changed real-filesystem npm, pnpm, pnpm-workspace, Git and linked-Git cases took 549/498/445/455/520 ms (2.467 s total). Repeated retention remains a no-op.src/cli/update-cli.test.ts: all 533 tests passed in job107726868631. The changed retained/skipped/failed diagnostic outcome cases took 547/516/262 ms (1.325 s total).pnpm test <file> --maxWorkers=1commands passed: retention 17/17 in 25.904 s wall (23.92 s Vitest), CLI 533/533 in 251.250 s wall (244.28 s Vitest). Command walls include compiler/runner setup and exclude dependency installation; incremental before/after overhead was not isolated. Proof run: https://github.com/openclaw/openclaw/actions/runs/36107342871. The one-shot command exited 0 and its Testbox stopped completed; the backing Actions Testbox step can appear cancelled when Blacksmith ends that session.107996882357, receipt artifact10853428698). The selectedpublished-upgrade-survivorbase scenario ran once, passed in 727 s, and used published[email protected]to install exact candidate4b51bf437ed9609ccb5061e301a463f6f30000e4through the updater. Candidate and installed-package identity, automatic migration, Doctor, state survival, gateway health/readiness and status checks passed. The receipt records installed build2026.9.6-4b51bf437ed9-2026-09-25T07-24-25.391Z; restart mode was manual. Harnessfc3b2dca233a87134ff9b37d045128c1e002dbe8; candidate tarball SHA-25628d228e3cc3235890425a686831b7c84a8b53e18d417afe5a3fb1406a07ea8a2. Package integrity, npm 12 installer and final acceptance verification also passed. The old published driver cannot emit the new metrics; those begin on a later update executed by the installed candidate.git diff --checkpassed; no runtime speedup or live deployment is claimed.