Skip to content

fix(update): continue after baseline fingerprint timeouts - #144758

Merged
steipete merged 2 commits into
mainfrom
steipete/upd-fingerprint-best-effort
Sep 11, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/upd-fingerprint-best-effort

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Additional instructions

Same-repository maintainer branch; maintainers retain repository write access. The campaign lead owns landing.

What Problem This Solves

Fixes an issue where openclaw update fails before activation on a busy host or slow disk because fingerprinting the existing npm package exceeds 30 seconds. The absent fingerprint could then be misreported as a changed retained package and failed rollback. L38 reproduced this in the published 2026.9.3 → 2026.9.4 matrix on Linux ARM64.

Refs #143767. This implements the maintainer's explicit best-effort fingerprint decision; no external contributor patch was imported.

Why This Change Was Made

Only the full baseline scan timeout becomes recoverable. Before mutation, the swap captures the retained directory identity and package version, and backs up launchers on an independent budget. Without a complete fingerprint, rollback verifies those facts before and after restoring the same directory. Completed fingerprints and detected integrity changes remain strict.

The reader retains its 30-second cap and 64 KiB chunks. It stops at the observed file size, rejects premature EOF, and retains the before/after metadata checks. This removes one redundant read per file without changing the fingerprint format. Package byte count does not predict filesystem latency, so the time cap does not scale with package size.

Shared completion now writes result steps before closing a rolled-back run. This preserves the fingerprint advisories in durable history while retaining the original failure reason and downtime.

Warning classification extension to #143767

Boundary Classification Outcome
Baseline full-tree scan exceeds its deadline Recoverable warning Continue with the retained package identity; persist the incomplete-baseline advisory.
Rollback without a complete baseline fingerprint Recoverable warning Verify directory identity, version, and launchers; report fingerprint verification unavailable.
Changed retained identity/version, launcher mismatch, or other detected integrity failure Blocking Preserve recovery evidence and the existing refusal.

Warnings use the existing recoverable-maintenance kind. No new configuration, dependency, protocol version, SQLite schema, retention rule, or fingerprint format.

User Impact

A slow baseline scan no longer prevents an otherwise viable npm update. Verified rollback remains successful when only the full fingerprint is unavailable, and the warning remains visible after the update process exits.

Release-note context: npm updates continue with recorded advisories after baseline fingerprint timeouts; retained-copy rollback verifies identity and launchers, and package scans avoid redundant EOF reads.

Evidence

All three final regressions were exercised against the original production owners, with the fixes restored byte-for-byte afterward:

Before: activation and rollback timeout cases failed:
  Package rollback verification timed out
  retained package tree changed
  expected 'failed' to be 'committed'
Before: terminal regression failed because both warning rows were absent.
After: all three exact regressions passed.

Focused suites cover 175 distinct cases across package swap/integrity/ownership, rollback, terminal publication, recovery, and the run ledger. Commands included:

node scripts/run-vitest.mjs src/infra/package-update-swap.bounds.test.ts src/infra/package-update-swap.integrity.test.ts src/infra/package-update-swap.ownership.test.ts src/infra/package-update-swap.test.ts
node scripts/run-vitest.mjs src/cli/update-cli/update-command-rollback.test.ts src/cli/update-cli/update-command-run.test.ts src/cli/update-cli/update-command-terminal-outcome.test.ts src/cli/update-cli/update-command-recovery.test.ts
node scripts/check-changed.mjs
git diff --check
pnpm build

Checks, the full build, canonical package integrity validation, and Codex autoreview at P0/P1 passed. Tests retain changed-file, identity, launcher, authority, size, inventory, and late-I/O controls. The final warning regression also asserts the original reason, rolled-back status, and downtime.

A real installed 2026.9.4 package contained 35,648 files and 460,589,795 content bytes. Sequential profiling measured 16.907 → 12.620 seconds, with identical fingerprints: 75,730 → 40,082 file reads. This is a single sampled comparison. Larger buffers were slower. A separate controlled stalled-read probe reproduced the original timeout at 30.008 seconds.

Final installed CLI matrix, using the L19/L38 fixture on Linux ARM64 / Node 24.19.0:

Cell Result
Published 2026.9.4 → final candidate Exit 0; 106.795s; Gateway HTTP 200/live.
Candidate update with one 31s baseline read delay Exit 0; 106.588s; status succeeded; exact baseline advisory persisted.
Same delay plus post-install Doctor exit 42 Expected doctor-failed; 101.116s total; rollback exit 0 in 1.357s; exact directory identity/version/build restored; Gateway HTTP 200/live. Status rolled-back retains both fingerprint advisories.

The rollback result reports packageRollbackVerified: true and serviceRestartSafe: true; neither runtime-verification-failed nor rollback-state-unverified is introduced by the missing fingerprint. Minimum observed free space was 21.727 GiB on the host and 20.262 GiB in the container. The owned container was removed and its absence verified.

Candidate SHA-256: 4b097003087472baff2d3fc64294c80db3def8b8bc355fc93887130bcc212a59. It was built before the final commit, so its build metadata names 8426b8e51c4; the source receipt matches all eight changed files at final head 8afc3a16996d09c2a3c5947d3139a1db784d1249.

Known proof constraints: main still declares 2026.9.3. The synthetic fixture used the existing explicit downgrade acknowledgment to test the newer source without changing version metadata. The initial version-guard refusal is preserved. A zero-deadline fixture health probe was corrected to make a bounded HTTP request. Published 9.4's driver cannot gain this repair retroactively: the first hop runs normally, then the installed candidate owns the forced-timeout tests. Native systemd, x64, and Windows live behavior are not claimed.

Exact-head CI run 34581175774 completed successfully on 8afc3a16996d09c2a3c5947d3139a1db784d1249. The repository watcher reports GREEN, with zero pending checks and 261 superseded check results reconciled. This fresh run used the reopened PR merge ref including #144761. Earlier runs encountered the now-repaired memory-core test issue and infrastructure failures; no additional code changes or retries were needed for this green run.

Maintainer review decision: retain the documented best-effort timeout policy, as explicitly approved for this repair. ClawSweeper's latest review (2026-09-11 08:57 UTC, exact head above) found no actionable patch defects. Its remaining merge-risk note is accepted: content changes that preserve retained directory identity and package version can escape full fingerprint comparison after a baseline timeout. Ownership, version, launcher, compatibility, and runtime-readiness checks remain mandatory, and both reduced-verification advisories remain visible. No fixup is needed for this accepted tradeoff.

Keep the full package scan bounded, but record a recoverable warning when
it times out. Verify retained and restored package identity/version and
launchers when the baseline fingerprint is unavailable.

Stop hashing at the observed file size while preserving before/after
metadata checks, removing one redundant EOF read per file.

Release-note context: npm updates continue after baseline fingerprint
scan timeouts and report the reduced rollback verification as a warning.
Refs #143767.
Let shared completion persist result steps before recording the terminal
rolled-back outcome. Keep the original failure reason and downtime.

Release-note context: rollback fingerprint advisories remain visible in
update status and reports after the update process exits.
Refs #143767.
@clawsweeper

clawsweeper Bot commented Sep 11, 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 cli CLI command changes size: M maintainer Maintainer-authored PR labels Sep 11, 2026
@steipete
steipete marked this pull request as ready for review September 11, 2026 07:03
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 5:27 AM ET / 09:27 UTC (Revision 3).

ClawSweeper review

What this changes

The updater continues after baseline fingerprint timeouts, verifies retained package identity and launchers during rollback, and preserves rollback warnings in update history.

Merge readiness

✅ Ready for maintainer review

This remains a useful repair, with no actionable patch findings. The recorded maintainer acceptance resolves the previous review’s reduced-verification concern; no additional fixup is required.

Priority: P2
Reviewed head: 8afc3a16996d09c2a3c5947d3139a1db784d1249

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported repair with meaningful installed-runtime proof and no remaining actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied installed-CLI matrix exercises the changed scan, swap, rollback, and terminal-history owners on Linux ARM64, showing successful timeout continuation and Doctor-failure recovery with both warnings persisted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied installed-CLI matrix exercises the changed scan, swap, rollback, and terminal-history owners on Linux ARM64, showing successful timeout continuation and Doctor-failure recovery with both warnings persisted.
Evidence reviewed 9 items Timeout recovery is narrowly classified: Only PackageIntegrityTimeoutError receives the identity/version fallback. Other scan errors remain blocking, symlink roots cannot use the fallback, and launchers receive an independent bounded reader before activation.
Rollback safeguards remain in the existing owners: Recovery compares the full fingerprint when available, otherwise the captured directory identity and version, and checks launcher fingerprints. Restoration uses the existing exact-directory rename path and current-executor assertions; CLI rollback retains schema, config, service-ownership, and readiness checks.
Warnings precede terminal completion: Shared completion records result steps before finishing the run. This matches the ledger contract, which accepts ordinary step updates only while a run is running; the new regression checks both warnings, the original failure reason, rolled-back status, and downtime.
Findings None None.
Security None None.

How this fits together

The package updater validates a staged installation before replacing the installed package and its launchers. If activation fails, the rollback owner restores the retained package, while CLI completion records the outcome and warnings.

flowchart TD
  A[Staged package] --> B[Baseline package scan]
  B --> C{Scan completed?}
  C -->|Yes| D[Full fingerprint]
  C -->|Timeout| E[Directory identity and version]
  D --> F[Package and launcher swap]
  E --> F
  F --> G[Activation or verified rollback]
  G --> H[Outcome and warning history]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +61, Tests +163, Docs +7. Total +231 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 105 44 +61
Tests 2 182 19 +163
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 294 63 +231

Review metrics

Metric Value Why it matters
Production versus regression coverage Net production +61 lines; tests +163 lines Production growth implements the bounded identity fallback and warning propagation, with regressions covering continuation, restoration, refusal, and terminal history.

Technical review

Best possible solution:

Retain the approved best-effort timeout policy, with explicit reduced-verification warnings and the existing strict ownership, compatibility, launcher, and readiness checks.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main source aborts when the baseline scan exceeds its deadline, and the supplied installed-CLI evidence exercises that trigger. This reviewer did not execute a reproduction.

Is this the best way to solve the issue?

Yes: the patch handles the timeout at the existing package-swap owner and fixes warning ordering at shared completion, matching the explicitly accepted policy without a competing implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b43dfe93743d.

Labels

Label justifications:

  • P2: This is a bounded updater reliability repair for slow baseline scans, with a demonstrated recovery path and accepted verification tradeoff.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied installed-CLI matrix exercises the changed scan, swap, rollback, and terminal-history owners on Linux ARM64, showing successful timeout continuation and Doctor-failure recovery with both warnings persisted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied installed-CLI matrix exercises the changed scan, swap, rollback, and terminal-history owners on Linux ARM64, showing successful timeout continuation and Doctor-failure recovery with both warnings persisted.

Evidence

What I checked:

  • Timeout recovery is narrowly classified: Only PackageIntegrityTimeoutError receives the identity/version fallback. Other scan errors remain blocking, symlink roots cannot use the fallback, and launchers receive an independent bounded reader before activation. (src/infra/package-update-swap.ts:286, 8afc3a16996d)
  • Rollback safeguards remain in the existing owners: Recovery compares the full fingerprint when available, otherwise the captured directory identity and version, and checks launcher fingerprints. Restoration uses the existing exact-directory rename path and current-executor assertions; CLI rollback retains schema, config, service-ownership, and readiness checks. (src/infra/package-update-npm-root.ts:61, 8afc3a16996d)
  • Warnings precede terminal completion: Shared completion records result steps before finishing the run. This matches the ledger contract, which accepts ordinary step updates only while a run is running; the new regression checks both warnings, the original failure reason, rolled-back status, and downtime. (src/cli/update-cli/update-command-run.ts:391, 8afc3a16996d)
  • Still necessary on fetched main: Fetched main still awaits the full baseline fingerprint without catching its timeout. The related merged warning work at fix(update): finish the update with recorded warnings on recoverable hiccups #143767 supplies advisory infrastructure but does not implement this timeout repair. (src/infra/package-update-swap.ts:269, b43dfe93743d)
  • Latest release retains the timeout failure: The v2026.9.4 integrity reader throws the generic rollback-verification timeout error. No shipped inclusion of this branch’s repair is established. (src/infra/package-update-integrity.ts:124, 3a9d69db306c)
  • Installed CLI behavior proof: The supplied PR body at sourceRevision 5ac0e47d8eed7dd5a4575a089a0265bd92809071c5a35d011b101b50bb98ca51 records Linux ARM64 / Node 24.19.0 installed-CLI runs: ordinary upgrade succeeded; an injected 31-second baseline read delay succeeded with its advisory persisted; the same delay plus Doctor exit 42 restored the original directory identity/version/build, retained both warnings, and recovered Gateway HTTP 200. The body records candidate SHA-256 4b097003087472baff2d3fc64294c80db3def8b8bc355fc93887130bcc212a59 and a source receipt matching all changed files at the reviewed head. These are supplied observations, not executions performed by this reviewer. (8afc3a16996d)

Likely related people:

  • steipete: 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)

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-11T07:42:45.501Z sha 8afc3a1 :: blocked before merge. :: none
  • reviewed 2026-09-11T08:57:05.071Z sha 8afc3a1 :: blocked before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Cycling the PR to obtain a fresh merge ref: reruns test the original merge commit, which predates #144761 (the memory-core lane repair). Reopening immediately.

@steipete steipete closed this Sep 11, 2026
@steipete steipete reopened this Sep 11, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 11, 2026
@steipete
steipete merged commit f50d4ce into main Sep 11, 2026
694 of 701 checks passed
@steipete
steipete deleted the steipete/upd-fingerprint-best-effort branch September 11, 2026 10:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete pushed a commit that referenced this pull request Sep 11, 2026
…he excerpt tail (#144729)

Preserve the triggering error in failed-update diagnostic records and triage prompts by using the shared sanitizer's existing 384-byte head-and-tail stderr excerpt. The previous 160-byte tail-only excerpt could erase the initiating error behind rollback details. The saved-artifact regression covers both the leading diagnostic and final recovery verdict.

Redaction still precedes truncation, and the diagnostic JSON and triage prompt retain their existing 4 KiB and 8 KiB bounds. Update execution, rollback decisions, and ledger summaries are unchanged.

Related: #144712. This repairs its diagnostic-loss symptom; #144758 addresses the triggering update failure.

Validation: exact-head CI run 34579194228 succeeded, including build, lint, types, and test shards. ClawSweeper found no blocking defect; independent maintainer review was clean at P0/P1. Contributor-recorded isolated update output retains the leading timeout and final recovery verdict. Contributor code was not executed locally during landing.

Thanks @Richard355168.

Co-authored-by: Richard355168 <[email protected]>
njuboy11 added a commit to njuboy11/openclaw that referenced this pull request Sep 11, 2026
…stalls

The package integrity scan used a fixed 30 s ceiling for its budget, so the callers step timeout could never raise it. Installations whose tree needs longer than that to hash (37k entries / 426 MiB here, within the documented tree bounds) never completed a baseline fingerprint, so rollback verification always degraded to the identity + version fallback, and before openclaw#144758 the update failed outright.

The reader now keeps a 30 s default and accepts a caller budget up to a 5 minute ceiling.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
)

The global-install-failed reason-code entry still claimed no published release contained both openclaw#145282 and openclaw#144758. Both landed in v2026.9.5 (f19a973, cdb8e14), so users stuck on the 2026.9.3/2026.9.4 updater need the manual hop only once.

Co-authored-by: Peter Steinberger <[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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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