Skip to content

improve(update): record runtime retention costs - #157386

Merged
vincentkoc merged 2 commits into
mainfrom
fix/update-runtime-retention-costs-20260924
Sep 25, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/update-runtime-retention-costs-20260924

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

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

  • Exact head: 4b51bf437ed9609ccb5061e301a463f6f30000e4. Independent review against current main 505652e88d7421fd757cee71950511f0a203ea48 found the diagnostics still needed and source-compatible. Fresh autoreview found no actionable issues through P2.
  • Exact-head CI passed, including required openclaw/ci-gate and core lint: https://github.com/openclaw/openclaw/actions/runs/36026459229.
  • src/infra/update-retained-runtime.test.ts: all 17 tests passed in job 107726868635. 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 job 107726868631. The changed retained/skipped/failed diagnostic outcome cases took 547/516/262 ms (1.325 s total).
  • Changed-case CI execution totals 3.792 s. These are measured case durations, not standalone command wall times or a before/after CI cost delta. On the exact candidate in Linux Testbox, serial pnpm test <file> --maxWorkers=1 commands 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.
  • Published-driver upgrade compatibility passed: https://github.com/openclaw/openclaw/actions/runs/36107231360 (job 107996882357, receipt artifact 10853428698). The selected published-upgrade-survivor base scenario ran once, passed in 727 s, and used published [email protected] to install exact candidate 4b51bf437ed9609ccb5061e301a463f6f30000e4 through the updater. Candidate and installed-package identity, automatic migration, Doctor, state survival, gateway health/readiness and status checks passed. The receipt records installed build 2026.9.6-4b51bf437ed9-2026-09-25T07-24-25.391Z; restart mode was manual. Harness fc3b2dca233a87134ff9b37d045128c1e002dbe8; candidate tarball SHA-256 28d228e3cc3235890425a686831b7c84a8b53e18d417afe5a3fb1406a07ea8a2. 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.
  • ClawSweeper Revision 3 before-merge items and its rank-up move are addressed by the inspected, completed exact-candidate survivor receipt above; prior timing/CI-cost items are addressed by the focused measurements. The package build took 36m35s; this is observed validation cost, not a PR-induced cost delta. Formatting and git diff --check passed; no runtime speedup or live deployment is claimed.

@vincentkoc vincentkoc self-assigned this Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 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 cli CLI command changes size: S labels Sep 24, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 24, 2026 16:06
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 3:37 AM ET / 07:37 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 4b51bf437ed9609ccb5061e301a463f6f30000e4

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no confirmed correctness defect, but the required real upgrade observation has not completed.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Filesystem retention tests and a mocked CLI receipt test cover the changed owner and recording path; the real published-driver upgrade is still running. The additive diagnostic uses the unchanged optional step-detail format, so older stored receipts remain readable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Filesystem retention tests and a mocked CLI receipt test cover the changed owner and recording path; the real published-driver upgrade is still running. The additive diagnostic uses the unchanged optional step-detail format, so older stored receipts remain readable.
Evidence reviewed 8 items Introduced measurements: The retention owner measures inventory and materialization and returns six numeric values after runtime binding succeeds.
Receipt path: The update command passes a successful retention result to its existing progress callback as diagnostic text.
Existing-state compatibility: The unchanged run-step schema accepts optional text detail; the reader decodes older steps without a retention diagnostic. The added receipt needs no schema migration.
Findings None None.
Security None None.

How this fits together

During 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
Loading

Before merge

  • Resolve merge risk (P1) - The required published v2026.9.6 driver to exact-candidate upgrade check has not completed, so upgrade behavior remains unverified.
  • Complete next step (P2) - Inspect the completed published v2026.9.6 driver to exact-head candidate survivor result before merge.
Agent review details

Security

None.

PR surface

Source +22, Tests +24. Total +46 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 27 5 +22
Tests 2 28 4 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 55 9 +46

Review metrics

Metric Value Why it matters
Retention receipt 6 numeric measurements in 1 diagnostic row The added operator data uses the existing bounded run-step format.

Merge-risk options

Maintainer options:

  1. Confirm the upgrade result (recommended)
    Inspect the selected published-driver survivor result for the exact candidate before merging the update-path change.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded improvement to diagnosing slow updates.
  • merge-risk: 🚨 compatibility: The patch adds a persisted diagnostic write during update preparation, and its published-driver upgrade check is pending.
  • 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. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Filesystem retention tests and a mocked CLI receipt test cover the changed owner and recording path; the real published-driver upgrade is still running. The additive diagnostic uses the unchanged optional step-detail format, so older stored receipts remain readable.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record the completed published-driver to exact-candidate survivor outcome in the PR body.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T16:14:40.430Z sha ab63154 :: needs changes before merge. :: none
  • reviewed 2026-09-24T16:30:27.010Z sha 4b51bf4 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 24, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 25, 2026
@vincentkoc
vincentkoc merged commit 74b9103 into main Sep 25, 2026
243 of 244 checks passed
@vincentkoc
vincentkoc deleted the fix/update-runtime-retention-costs-20260924 branch September 25, 2026 08:36
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

roboclaw-bot added a commit that referenced this pull request Sep 25, 2026
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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
* improve(update): record runtime retention costs

* fix(update): return explicit retention no-op result

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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