Skip to content

fix(update): preserve failures and running worker code during replacement - #153764

Merged
steipete merged 1 commit into
mainfrom
codex/recovery-runner-final-896
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/recovery-runner-final-896

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150153, #152466, #153814. The original combined PR must not be merged.

What Problem This Solves

A package or Git update could lose a failed validation result or load replacement worker code while the running updater still expected the previous worker protocol.

User Impact

Updates preserve validation failures through activation, rollback and history, and retain the running updater's worker code until its work settles. Doctor configuration refusals remain fatal without replacing the actual process exit code.

Why This Change Was Made

The CLI owns activation Doctor, requester authority and configuration attribution; package and Git updates consume its results through the shared failure classifier. This removes duplicate Doctor execution and the competing runner facade. Runtime retention uses the existing dependency copier and SQLite broker lifecycle, selecting the code generation before queued work loses its source context. Explicit target-runtime work still uses the selected target.

The change preserves current main's worker preparation, streamed Git-transfer ownership, requester continuation and Doctor advisory behavior. A final configured-owner check runs after executor and Doctor settlement, before publication. Uncertain process settlement retains recovery artifacts; failure to remove disposable files remains advisory.

Evidence

The reviewed candidate is f4291a7463b6dc2d1320174b591ed6d31fd59b19 (tree 7fa24c34dca316da4b99f2db9162734a7d09f496). Its patch is identical to the scoped-clean P2-reviewed predecessor; all 65 changed paths were disjoint from intervening main changes, and the nearby dependency audit found no composition defect. Normal commit hooks and all 64 applicable formatting checks passed.

  • CI 35698159009 is green at this head. The initial async compile-cache and native account-catalog timeouts are preserved. Each failed job received one diagnostic rerun, without source, assertion or timeout changes. Both passed, but the reruns used larger runners and a newer Node patch; the original timeout causes remain unproven. A separately controlled comparison of main versus the exact CI merge passed all 18 cache cases and the original 14-file group (196 passed, one skipped) on both revisions, without consistent source attribution. That comparison also had more memory than the original failing runner.
  • A new canonical package was built from this exact head, with state schema 18 and agent schema 23. Compiled proof passed for worker generation retention across distribution replacement, pressure-driven worker reopening, accepted-write drain, and restoration. The actual sealed service-child entrypoint also passed its registration proof. These are Linux/Node results with synthetic pressure, not OOM or cross-platform claims.
  • The four-case optional-fetch control passed. Removing only the target-fetch completion check caused exactly the two intended stale-branch assertion failures; the two explicit-tag controls still passed. Source and runtime were restored, with no timeout or unhandled-error failures.
  • A genuine published 2026.9.2 driver updated to the exact candidate package and returned success. The native service served that build; session metadata and both transcript messages were preserved, and agent schema advanced from 19 to 23. The original qualification phase remains failed because its immediate PRAGMA user_version assertion observed 15 before main's existing five-minute publication delay. A separate read-only observation confirmed content schema 18 was already recorded before update completion, and later confirmed both published schema markers at 18 on the same database inode and serving process. The updater was not replayed. Ownership-checked service cleanup and lease release were separately verified.

Earlier failed CI and interrupted qualification remain bound to their original sources; they are not relabeled as current-head successes. This PR adds 528 application lines, one tooling line and 2,065 test/support lines against its captured base. The overall split campaign's production reduction is accounted for after actual merges. No production deployment or release is included.

@clawsweeper

clawsweeper Bot commented Sep 20, 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 scripts Repository scripts commands Command implementations size: XL maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 14:38
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The PR preserves update validation failures and Doctor diagnostics through recovery, retains running SQLite worker code during installation replacement, and delegates finalization to the selected target runtime.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this remains useful, distinct updater work, and no concrete introduced correctness defect was established. The current composition's declared upgrade qualification remains incomplete.

Priority: P2
Reviewed head: f4291a7463b6dc2d1320174b591ed6d31fd59b19

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and regression coverage provide useful confidence, but the declared current-composition upgrade proof remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 10 items Pinned change ownership: Reviewed the introduced delta from 5c42f63 to f4291a7. Raw commit inspection confirmed the original head's recorded parent and the test merge's ordered base/head parents. Base-only UI, session-share, and Gateway changes were excluded from PR attribution.
Current main still loses recorded verification details: Current main's verification wrapper replaces a thrown callback outcome with a generic verification failure; it lacks the branch's recorded-step preservation. Current main also lacks the two new runtime-retention modules, so the central work remains distinct.
Latest release comparison: The supplied latest release, v2026.9.5, likewise converts thrown verification callbacks into a generic failure rather than preserving their recorded Doctor result. The release blob was inspected through GitHub after local object retrieval failed.
Findings None None.
Security None None.

How this fits together

The updater prepares and validates a replacement installation before activating it, running Doctor, and recording recovery outcomes. Its SQLite workers must remain compatible with the running updater while installation files change.

flowchart TD
  A[Update request] --> B[Prepare and validate candidate]
  B --> C[Retain running worker code]
  C --> D[Activate replacement]
  D --> E[Target runtime and Doctor]
  E --> F[Record success or recovery]
  F --> G[Drain retained workers]
  G --> H[Release temporary runtime]
Loading

Before merge

  • Resolve merge risk (P1) - The changed worker-generation and target-finalization paths remain unqualified in the current compiled composition. An existing installation could encounter incompatible worker commands or incomplete recovery; published-driver upgrade evidence must establish worker settlement, native service recovery, and session preservation.
  • Complete next step (P2) - Complete and record the declared current-composition compiled-worker, published 2026.9.2 upgrade, and completion-guard qualification before lifting the landing hold.
Agent review details

Security

None.

PR surface

Source +528, Tests +2065, Other +1. Total +2594 across 65 files.

View PR surface stats
Area Files Added Removed Net
Source 30 991 463 +528
Tests 34 2913 848 +2065
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 65 3905 1311 +2594

Review metrics

Metric Value Why it matters
Production versus test growth Application +528 net lines; tooling +1; tests/support +2,065 Production growth is explicitly justified by failure preservation and retained worker lifecycle; test growth includes expanded existing regression matrices.

Merge-risk options

Maintainer options:

  1. Complete the declared upgrade qualification (recommended)
    Retain the landing hold until source-bound compiled-worker and published-updater results demonstrate service recovery and preserved sessions.

Technical review

Best possible solution:

Keep activation, Doctor, and recovery with their existing owners, and qualify the retained-worker transition against the published updater before landing.

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

Yes, from source: current main replaces a recorded Doctor outcome with a generic failure when verification throws, and lacks the proposed worker-generation retention. No failing runtime execution was performed in this review.

Is this the best way to solve the issue?

Yes at the source-design level: extending the existing failure classifier, CLI finalizer, dependency copier, and SQLite broker avoids competing owners. Compiled and published-updater qualification is still needed to establish upgrade safety.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a concrete updater reliability repair, without evidence establishing an emergency caused by the proposed patch.
  • merge-risk: 🚨 compatibility: Installation replacement now retains worker generations and changes finalization ordering, while current-composition published-updater compatibility remains unqualified.
  • 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: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Pinned change ownership: Reviewed the introduced delta from 5c42f63 to f4291a7. Raw commit inspection confirmed the original head's recorded parent and the test merge's ordered base/head parents. Base-only UI, session-share, and Gateway changes were excluded from PR attribution. (f4291a7463b6)
  • Current main still loses recorded verification details: Current main's verification wrapper replaces a thrown callback outcome with a generic verification failure; it lacks the branch's recorded-step preservation. Current main also lacks the two new runtime-retention modules, so the central work remains distinct. (src/infra/package-update-verification-step.ts:52, b3f097deb9e3)
  • Latest release comparison: The supplied latest release, v2026.9.5, likewise converts thrown verification callbacks into a generic failure rather than preserving their recorded Doctor result. The release blob was inspected through GitHub after local object retrieval failed. (src/infra/package-update-verification-step.ts:26, ec9c1a13db89)
  • Failure preservation: The branch preserves the recorded process result, adds the thrown failure fact, removes advisory classification, and propagates uncertain process cleanup instead of treating it as settled verification. (src/infra/package-update-verification-step.ts:163, f4291a7463b6)
  • Retained runtime lifecycle: The updater copies its runtime through the existing dependency-tree owner. Worker generation is captured before detached admission, broker slots remain generation-specific, and retained files are released only after registered worker cleanup succeeds. Failed settlement retains the directory. (src/infra/runtime-worker-generation.ts:61, f4291a7463b6)
  • Supplemental regression coverage: Inspected coverage includes zero-exit timeout/output-limit failures, Doctor receipt preservation, config-attribution failure, requester revocation, package rollback, five retained dependency layouts, and generation-specific worker drain. These tests were not executed during this read-only review. (src/infra/update-retained-runtime.test.ts:167, f4291a7463b6)

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)

Rank-up moves

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

  • Publish the declared compiled-worker, published-updater, and completion-guard results with source/package identities and service/session observations; preserve original failures and redact private details.
  • Update the PR body with the qualification results to trigger re-review; if it does not refresh, ask a maintainer to comment @clawsweeper re-review.

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 (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-21T06:07:25.526Z sha e8df730 :: blocked before merge. :: none
  • reviewed 2026-09-21T06:23:59.084Z sha d561f32 :: blocked before merge. :: none
  • reviewed 2026-09-21T08:01:02.380Z sha 971871e :: blocked before merge. :: none
  • reviewed 2026-09-21T08:42:25.505Z sha 5db79d7 :: blocked before merge. :: none
  • reviewed 2026-09-21T10:59:37.420Z sha 144d389 :: blocked before merge. :: none
  • reviewed 2026-09-22T03:46:44.268Z sha 6b7bb15 :: blocked before merge. :: none
  • reviewed 2026-09-22T05:02:19.312Z sha 0509bad :: blocked before merge. :: none
  • reviewed 2026-09-22T07:17:35.597Z sha f4291a7 :: blocked before merge. :: none

@steipete steipete changed the title fix: preserve failed validation across update activation and recovery fix(update): preserve failures and running worker code during replacement Sep 20, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 21, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 21, 2026
@steipete
steipete force-pushed the codex/recovery-runner-final-896 branch from 144d389 to 6b7bb15 Compare September 22, 2026 03:30
@openclaw-barnacle openclaw-barnacle Bot removed the commands Command implementations label Sep 22, 2026
@steipete
steipete marked this pull request as draft September 22, 2026 03:35
@steipete
steipete force-pushed the codex/recovery-runner-final-896 branch from 6b7bb15 to 0509bad Compare September 22, 2026 04:51
@steipete
steipete marked this pull request as ready for review September 22, 2026 04:54
Keep failed validation meaningful through activation, rollback, and history. Retain the updater's worker runtime until admitted work and cleanup settle, while preserving current requester checks and structured npm diagnostics.
@steipete
steipete force-pushed the codex/recovery-runner-final-896 branch from 0509bad to f4291a7 Compare September 22, 2026 07:08
@steipete
steipete merged commit dd7d596 into main Sep 22, 2026
536 of 541 checks passed
@steipete
steipete deleted the codex/recovery-runner-final-896 branch September 22, 2026 10:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 22, 2026
Integrate canonical main ca97ceb with SSH pairing fixture fix f87f23c and the reviewed updater owner changes from #153764. Preserve the published PR ancestry and byte-identical daemon output patch.
vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '80b9608a25e191a17e1466d750c2f76a38a38507':
  fix(tooling): declare tsx CLI shim exports
  test(gateway): reuse session PR access state fixtures (#155626)
  test(heartbeat): await wake registration before advancing coalescing time
  refactor(status): share plugin health section assembly (#155390)
  fix: CLI and MCP tool completions skip plugin hooks (#155206)
  fix(update): preserve failures and retain running worker code (#153764)
  fix(sqlite): drain idle coordinators at lifecycle teardown
  fix(test): prepare SQLite compile-cache probes before launch
  fix(test): preserve owned compiler caches in Vitest workers
  fix(ios): assistant files are not downloadable in chat (#155195)
  fix(heartbeat): avoid timeouts for busy scheduled polls (#148333)
  test(gateway): hold SSH approval until pending assertions finish
  test(update): cover launcher permission rollback on Linux (#155615)
  fix(edit): avoid duplicate replacements from legacy arguments (#155513)
  feat(browser): support Lightpanda connection-scoped CDP replies (#154342)
  improve(ci): speed up compatible Control UI tests with Bun (#154585)
  test(gateway): prepare remaining approval fixtures before requests (#155589)
  fix(doctor): exclude retained agents from automatic session import
steipete added a commit that referenced this pull request Sep 22, 2026
* refactor(cli): centralize daemon action output

Keep generic result emission JSON-only and route message-bearing successes
through the action context. Bind install warnings once in the shared install
context while preserving warning order and lifecycle exception boundaries.

Characterize human and JSON output through the existing response owners,
including foreground restart health ordering and install warning behavior.

* test(daemon): isolate install warning inventory

* chore: merge main into daemon output cleanup

* chore: merge main into daemon output cleanup

Preserve daemon action JSON and human output ownership, including current
backup and rebind receipts, readiness exit codes, and runtime pin contracts.

Related: #150047.

* test(cli): update daemon restart output fixture

* chore(cli): integrate current main for daemon output validation

* chore: merge main config reload and wrapper repairs

Integrate canonical main e99e75e, including config include publication fix 97e9ce9 and wrapper import-closure fix b518db4. Preserve the published PR ancestry and byte-identical daemon output patch.

* chore: merge main pairing fixture repair

Integrate canonical main ca97ceb with SSH pairing fixture fix f87f23c and the reviewed updater owner changes from #153764. Preserve the published PR ancestry and byte-identical daemon output patch.

Co-authored-by: Peter Steinberger <[email protected]>
steipete added a commit that referenced this pull request Sep 22, 2026
…ng the package (#155977)

## Summary

`openclaw update` retains the running updater's package tree so its workers survive the installer's replacement (#153764). That retention byte-copied the entire package root (`package.json`, `dist/`, `node_modules/`, 37,309 files / 625 MB for 2026.9.6) with three full `lstat` passes plus a per-file copy and verify. On the release Docker host this ran at ~12 files/s, so every in-place global update stalled in the `validating` phase for well over the E2E harness's 300 s command budget. `Plugin Prerelease` lane `plugin-update` (Full Release Validation 35775979903 → run 35779065106) then reported `update-denied did not return JSON: Unexpected end of JSON input` because `timeout` killed the command before any output.

This keeps the retention semantics and makes it cheap:

- Files are hard-linked into the private runtime directory (`fs.link`), so the inventoried inodes outlive npm's rename/unlink without copying bytes. Bytes are copied only when the filesystem refuses the link (`EXDEV`, `EPERM`, `ENOTSUP`, ...) or when relocation must rewrite the member in place (`.modules.yaml`, `.bin` launchers), so the live package is never edited through a shared inode.
- One walk performs the inventory check, publication, relocation and escape check per entry (was: pre-check pass, directory pass, file pass with two checks, symlink pass, post-check pass, relocation pass, full verify walk).
- After each link the private name is checked to reference the inventoried `dev:ino`; entries sharing an already linked inode (pnpm store hard links) keep every fingerprint field except the change time that the link itself bumps.
- The IO budget watchdog around retention is unchanged.
- `node_modules` stays in the retained tree: retained workers (`dist/**` entrypoints) resolve their dependencies from it.
- The shared copy path used for candidate rehearsal snapshots is unchanged in behavior; its plan rebasing, host-link/alias publication and verification moved to `update-candidate-plugin-tree-links.ts` so both materializers share them.
- Harness: the consent scenario's "did not return JSON" assertion now includes the command's exit code so a `timeout` kill (124) is visible in CI.

## Evidence

- Root cause repro on the exact CI candidate bytes (artifacts `docker-e2e-package-35777886894-1` + `docker-e2e-prepublish-plugin-registry-35777886894-1`): `update --tag core-denied-future.tgz --yes --json` finished `npm i` in 2 min, then sat in `validating` copying `openclaw-update-runtime-*` at 5,264 → 5,513 files in 20 s (~12 files/s); 6,402 files / 102 MB after 9 min; SQLite `update_runs` row `failed/interrupted` when the harness killed it.
- With this change: the same repro (same host, load average ~34) returns the denial payload on stdout with exit 0 (`status: ok`, `postUpdate.plugins.status: warning`, `PLUGIN_CAPABILITY_CONSENT_REQUIRED`, `after.version: 2026.9.99-first-hop.0`) and the whole `update --tag` command completes in 3.5 min end to end (npm install 28 s, canary validation, activation, Doctor). Retention alone, measured directly on the installed 38,678-file package with `withRetainedUpdateRuntime`: 33.9 s to retain (about 1,140 files/s, roughly 95x faster than the copy) and 4.6 s to release.
- Unit tests: `src/infra/update-retained-runtime-tree.test.ts` (link path shares inodes and survives source replacement, `EXDEV` fallback copies bytes with the inventoried mode, changed entries are refused before any link, relocated launcher is copied so the live file is untouched); existing `update-retained-runtime.test.ts` layouts (npm/pnpm/pnpm-workspace/git/git-linked) and `update-candidate-plugin-tree.test.ts` pass.
- `OPENCLAW_TESTBOX=1 pnpm check:changed` and the `plugin-update` Docker lane on the packed candidate: results in the PR comments.
steipete added a commit that referenced this pull request Sep 23, 2026
…ng the package (#155977)

## Summary

`openclaw update` retains the running updater's package tree so its workers survive the installer's replacement (#153764). That retention byte-copied the entire package root (`package.json`, `dist/`, `node_modules/`, 37,309 files / 625 MB for 2026.9.6) with three full `lstat` passes plus a per-file copy and verify. On the release Docker host this ran at ~12 files/s, so every in-place global update stalled in the `validating` phase for well over the E2E harness's 300 s command budget. `Plugin Prerelease` lane `plugin-update` (Full Release Validation 35775979903 → run 35779065106) then reported `update-denied did not return JSON: Unexpected end of JSON input` because `timeout` killed the command before any output.

This keeps the retention semantics and makes it cheap:

- Files are hard-linked into the private runtime directory (`fs.link`), so the inventoried inodes outlive npm's rename/unlink without copying bytes. Bytes are copied only when the filesystem refuses the link (`EXDEV`, `EPERM`, `ENOTSUP`, ...) or when relocation must rewrite the member in place (`.modules.yaml`, `.bin` launchers), so the live package is never edited through a shared inode.
- One walk performs the inventory check, publication, relocation and escape check per entry (was: pre-check pass, directory pass, file pass with two checks, symlink pass, post-check pass, relocation pass, full verify walk).
- After each link the private name is checked to reference the inventoried `dev:ino`; entries sharing an already linked inode (pnpm store hard links) keep every fingerprint field except the change time that the link itself bumps.
- The IO budget watchdog around retention is unchanged.
- `node_modules` stays in the retained tree: retained workers (`dist/**` entrypoints) resolve their dependencies from it.
- The shared copy path used for candidate rehearsal snapshots is unchanged in behavior; its plan rebasing, host-link/alias publication and verification moved to `update-candidate-plugin-tree-links.ts` so both materializers share them.
- Harness: the consent scenario's "did not return JSON" assertion now includes the command's exit code so a `timeout` kill (124) is visible in CI.

## Evidence

- Root cause repro on the exact CI candidate bytes (artifacts `docker-e2e-package-35777886894-1` + `docker-e2e-prepublish-plugin-registry-35777886894-1`): `update --tag core-denied-future.tgz --yes --json` finished `npm i` in 2 min, then sat in `validating` copying `openclaw-update-runtime-*` at 5,264 → 5,513 files in 20 s (~12 files/s); 6,402 files / 102 MB after 9 min; SQLite `update_runs` row `failed/interrupted` when the harness killed it.
- With this change: the same repro (same host, load average ~34) returns the denial payload on stdout with exit 0 (`status: ok`, `postUpdate.plugins.status: warning`, `PLUGIN_CAPABILITY_CONSENT_REQUIRED`, `after.version: 2026.9.99-first-hop.0`) and the whole `update --tag` command completes in 3.5 min end to end (npm install 28 s, canary validation, activation, Doctor). Retention alone, measured directly on the installed 38,678-file package with `withRetainedUpdateRuntime`: 33.9 s to retain (about 1,140 files/s, roughly 95x faster than the copy) and 4.6 s to release.
- Unit tests: `src/infra/update-retained-runtime-tree.test.ts` (link path shares inodes and survives source replacement, `EXDEV` fallback copies bytes with the inventoried mode, changed entries are refused before any link, relocated launcher is copied so the live file is untouched); existing `update-retained-runtime.test.ts` layouts (npm/pnpm/pnpm-workspace/git/git-linked) and `update-candidate-plugin-tree.test.ts` pass.
- `OPENCLAW_TESTBOX=1 pnpm check:changed` and the `plugin-update` Docker lane on the packed candidate: results in the PR comments.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…aw#153764)

Keep failed validation meaningful through activation, rollback, and history. Retain the updater's worker runtime until admitted work and cleanup settle, while preserving current requester checks and structured npm diagnostics.

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
* refactor(cli): centralize daemon action output

Keep generic result emission JSON-only and route message-bearing successes
through the action context. Bind install warnings once in the shared install
context while preserving warning order and lifecycle exception boundaries.

Characterize human and JSON output through the existing response owners,
including foreground restart health ordering and install warning behavior.

* test(daemon): isolate install warning inventory

* chore: merge main into daemon output cleanup

* chore: merge main into daemon output cleanup

Preserve daemon action JSON and human output ownership, including current
backup and rebind receipts, readiness exit codes, and runtime pin contracts.

Related: openclaw#150047.

* test(cli): update daemon restart output fixture

* chore(cli): integrate current main for daemon output validation

* chore: merge main config reload and wrapper repairs

Integrate canonical main 2a74f33, including config include publication fix fda6f32 and wrapper import-closure fix 91a6617. Preserve the published PR ancestry and byte-identical daemon output patch.

* chore: merge main pairing fixture repair

Integrate canonical main 860100a with SSH pairing fixture fix fadc546 and the reviewed updater owner changes from openclaw#153764. Preserve the published PR ancestry and byte-identical daemon output patch.

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…ng the package (openclaw#155977)

## Summary

`openclaw update` retains the running updater's package tree so its workers survive the installer's replacement (openclaw#153764). That retention byte-copied the entire package root (`package.json`, `dist/`, `node_modules/`, 37,309 files / 625 MB for 2026.9.6) with three full `lstat` passes plus a per-file copy and verify. On the release Docker host this ran at ~12 files/s, so every in-place global update stalled in the `validating` phase for well over the E2E harness's 300 s command budget. `Plugin Prerelease` lane `plugin-update` (Full Release Validation 35775979903 → run 35779065106) then reported `update-denied did not return JSON: Unexpected end of JSON input` because `timeout` killed the command before any output.

This keeps the retention semantics and makes it cheap:

- Files are hard-linked into the private runtime directory (`fs.link`), so the inventoried inodes outlive npm's rename/unlink without copying bytes. Bytes are copied only when the filesystem refuses the link (`EXDEV`, `EPERM`, `ENOTSUP`, ...) or when relocation must rewrite the member in place (`.modules.yaml`, `.bin` launchers), so the live package is never edited through a shared inode.
- One walk performs the inventory check, publication, relocation and escape check per entry (was: pre-check pass, directory pass, file pass with two checks, symlink pass, post-check pass, relocation pass, full verify walk).
- After each link the private name is checked to reference the inventoried `dev:ino`; entries sharing an already linked inode (pnpm store hard links) keep every fingerprint field except the change time that the link itself bumps.
- The IO budget watchdog around retention is unchanged.
- `node_modules` stays in the retained tree: retained workers (`dist/**` entrypoints) resolve their dependencies from it.
- The shared copy path used for candidate rehearsal snapshots is unchanged in behavior; its plan rebasing, host-link/alias publication and verification moved to `update-candidate-plugin-tree-links.ts` so both materializers share them.
- Harness: the consent scenario's "did not return JSON" assertion now includes the command's exit code so a `timeout` kill (124) is visible in CI.

## Evidence

- Root cause repro on the exact CI candidate bytes (artifacts `docker-e2e-package-35777886894-1` + `docker-e2e-prepublish-plugin-registry-35777886894-1`): `update --tag core-denied-future.tgz --yes --json` finished `npm i` in 2 min, then sat in `validating` copying `openclaw-update-runtime-*` at 5,264 → 5,513 files in 20 s (~12 files/s); 6,402 files / 102 MB after 9 min; SQLite `update_runs` row `failed/interrupted` when the harness killed it.
- With this change: the same repro (same host, load average ~34) returns the denial payload on stdout with exit 0 (`status: ok`, `postUpdate.plugins.status: warning`, `PLUGIN_CAPABILITY_CONSENT_REQUIRED`, `after.version: 2026.9.99-first-hop.0`) and the whole `update --tag` command completes in 3.5 min end to end (npm install 28 s, canary validation, activation, Doctor). Retention alone, measured directly on the installed 38,678-file package with `withRetainedUpdateRuntime`: 33.9 s to retain (about 1,140 files/s, roughly 95x faster than the copy) and 4.6 s to release.
- Unit tests: `src/infra/update-retained-runtime-tree.test.ts` (link path shares inodes and survives source replacement, `EXDEV` fallback copies bytes with the inventoried mode, changed entries are refused before any link, relocated launcher is copied so the live file is untouched); existing `update-retained-runtime.test.ts` layouts (npm/pnpm/pnpm-workspace/git/git-linked) and `update-candidate-plugin-tree.test.ts` pass.
- `OPENCLAW_TESTBOX=1 pnpm check:changed` and the `plugin-update` Docker lane on the packed candidate: results in the PR comments.
steipete added a commit that referenced this pull request Oct 27, 2026
Resolve the physical .artifacts directory once before native Git database capture. This preserves the existing backup durability, identity, custody and rollback checks while supporting redirected artifact storage.

The paired real-backup regression fails on the original caller and passes with the fix. Fresh-process replay verifies cross-volume storage, the physical returned path, SQLite integrity and the retained synthetic row. Existing redirected Git staging tests pass.

Related: #160671, #153764
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
)

Resolve the physical .artifacts directory once before native Git database capture. This preserves the existing backup durability, identity, custody and rollback checks while supporting redirected artifact storage.

The paired real-backup regression fails on the original caller and passes with the fix. Fresh-process replay verifies cross-volume storage, the physical returned path, SQLite integrity and the retained synthetic row. Existing redirected Git staging tests pass.

Related: openclaw#160671, openclaw#153764
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR 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. scripts Repository scripts size: XL 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