Skip to content

fix(update): keep update watcher wakes synchronous - #204063

Merged
obviyus merged 1 commit into
mainfrom
fix/update-watcher-wake-void
Nov 23, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/update-watcher-wake-void

Conversation

@obviyus

@obviyus obviyus commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Related: #203994

What Problem This Solves

#203994 made wakeUpdateRunWatcher return a promise so the post-activation Doctor inspections could run under the update-run watcher. Six existing callers wake the watcher without awaiting it, so main now fails check-lint-core-5 with 11 no-floating-promises / no-misused-promises errors (update.ts, update-run.ts, server-startup-update-check.ts, the watcher itself and its tests).

User Impact

None at runtime. Lint on main is green again, and the background inspection behavior from #203994 is unchanged.

Why This Change Was Made

The wake is synchronous again, as it was before #203994, so every existing caller is correct unchanged. The watcher now owns the advisory job end to end: it runs it under its Gateway-lifetime work scope, logs a failure itself, then refreshes the run. The wake returns whether a watcher took the work; the trial logs one warning when none is running, instead of relying on a rejected promise. No new state, scheduler or retry.

Evidence

@clawsweeper

clawsweeper Bot commented Nov 23, 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 the gateway Gateway runtime label Nov 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 23, 2026
@obviyus
obviyus merged commit f595f02 into main Nov 23, 2026
124 checks passed
@obviyus
obviyus deleted the fix/update-watcher-wake-void branch November 23, 2026 13:04
@obviyus

obviyus commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as f595f02.

  • Problem: fix: show advisory findings after successful updates #203994 made the update-run watcher's wake return a promise, so six existing callers failed lint on main (check-lint-core-5, 11 floating-promise errors).
  • Fix: the wake is synchronous again; the watcher runs and logs advisory work itself, and the trial logs a warning if no watcher took it.
  • Proof: repo oxlint on the nine files is clean, 27 watcher/ledger/trial tests pass, CI green.

obviyus added a commit that referenced this pull request Nov 23, 2026
Related: #204035

## What Problem This Solves

After an update rolls back, Settings → Updates can blame a Node security warning, mark completed preparation as failed, show healthy service checks as unverified, and tell the user to diagnose before using its enabled Retry button. Raw startup logs also appear as a failed update action. Successful core updates can look clean while a plugin step is visibly failed.

## User Impact

The report keeps the recorded startup failure and the previous version's running identity. It gives one recovery path: retry the update; if it fails again, choose **Report update failure**. Completed preparation stays completed, live preparation progress remains visible, and startup logs remain available in expandable diagnostics and saved JSON.

No schema, protocol, update status, plugin lifecycle, retry mechanism, flag, or timer changes. The plugin-maintenance command genuinely refuses the candidate's schema migration while the previous Gateway serves. This PR shows that actual refusal instead of its preceding runtime warning; the separate lifecycle defect remains tracked in #204035.

## Why This Change Was Made

- Preparation writes both start and completion through the existing callback and step upsert. A later rollback no longer changes successfully completed work to failure.
- Plugin failure detail starts with the CLI's explicit reason, not arbitrary stderr's first line.
- The ready Gateway records existing rollback and serving facts. Startup output is a diagnostic receipt, not a blamed failed action; finished-run diagnostics start collapsed.
- The shared report omits `Cause: unknown`, while the UI omits checks that were never observed. Real negative/unavailable observations remain visible. A restored, ready Gateway gets Retry guidance instead of contradictory triage-first advice.
- Machine Doctor lint receipts stay unchanged in saved JSON, but do not appear as installation actions or selected output. The landed success-only inspection handoff stays after the terminal write, and main's rule that every warning counts toward attention is unchanged.
- Successful core updates count failed supplemental steps toward “warnings need attention,” without changing their success status. A matching warning receipt is counted once, not again as a failed step.

<details>
<summary>Status and preparation readers</summary>

The release rollback remains `failed`. Changing it to the already-existing `rolled-back` value would alter readers that are not part of this repair:

| Reader | Existing behavior |
| --- | --- |
| Shared report | Both have headlines; general failure advice specifically checks `failed`. |
| UI headline/progress | Both are terminal; the historical failure projection checks `failed`. |
| Recorded-attempt panel / Retry | Both are reportable; live permissions and busy state gate Retry. No failed-version blacklist is added. |
| `openclaw update status` | Both render, but current health/recovery and historical projection specifically check `failed`. |
| `update.run` admission | Pending trial/restore and a live preparation lock gate admission, not a failed version. |
| Notices / notifications | Both have summaries; failure-phase/recovery enrichment specifically checks `failed`. |
| Telemetry / result claims | Both are reportable non-success outcomes. Preserve `failed`; fill the existing rollback and running-version facts. Claim/send policy is unchanged. |
| Run watcher | Every status other than running is terminal and uses existing broadcast/final-notice custody. |
| Doctor | Abandonment/prerequisite notes specifically check `failed`; recorded warnings remain separate. |

Preparation readers already support both `in_progress` and `completed`: UI progress renders the active step and completed receipts; status JSON retains both; CLI progress keeps canonical staging; interrupted-preparation recovery from #203925 uses lock ownership and fails only unfinished steps. Start writes are retained, including during long Windows staging.

</details>

## Evidence

- Seven selected regressions fail on reported main `6f2bd815fecb` for the intended bad facts.
- Final implementation: `b36163728ccebd2383578d2c7e71016e8502983c`, including the synchronous advisory-handoff fix from #204063. Rendering the real healthy row `d9fd94cb` gives exactly **1 warning needs attention**. The duplicate `plugins` + `warning:plugins` regression is red at 2 before its fix and passes at 1 after it.
- Core/UI types, type-aware changed-source lint and formatting pass. Earlier integrated source passed 121 core/UI cases; 202 CLI/status/notification/report consumer cases passed for the attention change. All 62 final report assertions emitted pass; 43 watcher and 14 UI cases passed. A cold ack-notice test exceeded 120 s once; it passed in serial isolation, but the 360 s command bound stopped that run before its final two advisory cases. No timeout or assertion was weakened, and no wholly green final aggregate command is claimed. Earlier broad changed-check/consumer limits remain recorded.
- Local ClawSweeper reviewed final head `b36163728cce` at normal priority: **complete, patch correct, zero findings**.
- Hosted CI is **green on exact head `b36163728cce`**. The local cold-import/command-bound observations above remain recorded rather than hidden.
- **Earlier-head independent native Linux T → T+1: PASS** on `a924446274ff`, run `d9fd94cb-b844-4b75-9279-3a3fd42ce0f1` (`control-ui`, `succeeded`). Real schema 41 → 42, Service/Version pass, no unobserved warning badges or machine JSON; stored lint receipt unchanged. [Earlier-head UI/CLI images, before the attention-suffix correction](#204054 (comment)).
- **Earlier-head rollback and same-install healthy Retry: PASS** on `a924446274ff`, runs `511ad687-9d79-471b-950a-159a89099f2e` / `105ecb31-bae3-4c18-87b9-9e806be9822a`. Normal 10-minute trial budget, restored schema 41, database/WAL matching preimages, positive serving facts, completed preparation and enabled Retry. [Inspected rollback, Retry and CLI images](#204054 (comment)).
- **Exact-final-head native Linux healthy UI/CLI proof: PASS** on `b36163728cce`, run `34b0027c-adff-4eca-ae65-bd4d9815075e` (`control-ui`, `succeeded`). Both actual Settings and captured CLI output show **“1 warning needs attention”** for the naturally failed plugin step, with positive serving facts and no unobserved badges or raw JSON. Real schema 41 → 42 and the STRICT fixture table were verified. [Inspected final-head screenshots and proof details](#204054 (comment)).
- Initial CI found two browser tests expecting terminal diagnostics to stay open. The repaired test opens the visible summary before reading details; all **8 mock-Gateway browser E2E cases pass** locally (41.69 s). The repair is included in the integrated pushed head.

Production growth is 68 net lines, tests 184, docs 12. The extra production code records required facts and completion at their existing owners; no new subsystem or durable field is introduced.

### Before: the recorded Linux rollback

The startup headline is correct, but the details blame a runtime warning, show four unobserved checks as warnings, and tell the user to diagnose before retrying.

![Before: timeout outcome above the raw startup tail](https://github.com/user-attachments/assets/156029ba-daa4-4613-9811-45f078d37d21)

![Before: warning-led blame, unknown cause, and conflicting retry guidance](https://github.com/user-attachments/assets/8a2a8bb1-837c-4017-9025-1871b9e7c470)

### After: final-head healthy report

![Final Settings Updates: successful core update with one real issue needing attention](https://github.com/user-attachments/assets/3214dae8-e17d-464d-b5af-3cc14a583874)

![Final update status: faithful rendering of actual captured CLI stdout](https://github.com/user-attachments/assets/1af2798a-3e11-4198-a140-b1ccadaaa7e4)

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
Related: openclaw#203994

## What Problem This Solves

openclaw#203994 made `wakeUpdateRunWatcher` return a promise so the post-activation Doctor inspections could run under the update-run watcher. Six existing callers wake the watcher without awaiting it, so `main` now fails `check-lint-core-5` with 11 `no-floating-promises` / `no-misused-promises` errors (`update.ts`, `update-run.ts`, `server-startup-update-check.ts`, the watcher itself and its tests).

## User Impact

None at runtime. Lint on `main` is green again, and the background inspection behavior from openclaw#203994 is unchanged.

## Why This Change Was Made

The wake is synchronous again, as it was before openclaw#203994, so every existing caller is correct unchanged. The watcher now owns the advisory job end to end: it runs it under its Gateway-lifetime work scope, logs a failure itself, then refreshes the run. The wake returns whether a watcher took the work; the trial logs one warning when none is running, instead of relying on a rejected promise. No new state, scheduler or retry.

## Evidence

- `node scripts/run-oxlint.mjs` on all nine affected files: 0 errors, 0 warnings.
- Watcher, schema-publication, post-activation ledger and trial suites: 27 tests pass. The closed-tick ledger regression from openclaw#203994 still passes through the real watcher.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
Related: openclaw#204035

## What Problem This Solves

After an update rolls back, Settings → Updates can blame a Node security warning, mark completed preparation as failed, show healthy service checks as unverified, and tell the user to diagnose before using its enabled Retry button. Raw startup logs also appear as a failed update action. Successful core updates can look clean while a plugin step is visibly failed.

## User Impact

The report keeps the recorded startup failure and the previous version's running identity. It gives one recovery path: retry the update; if it fails again, choose **Report update failure**. Completed preparation stays completed, live preparation progress remains visible, and startup logs remain available in expandable diagnostics and saved JSON.

No schema, protocol, update status, plugin lifecycle, retry mechanism, flag, or timer changes. The plugin-maintenance command genuinely refuses the candidate's schema migration while the previous Gateway serves. This PR shows that actual refusal instead of its preceding runtime warning; the separate lifecycle defect remains tracked in openclaw#204035.

## Why This Change Was Made

- Preparation writes both start and completion through the existing callback and step upsert. A later rollback no longer changes successfully completed work to failure.
- Plugin failure detail starts with the CLI's explicit reason, not arbitrary stderr's first line.
- The ready Gateway records existing rollback and serving facts. Startup output is a diagnostic receipt, not a blamed failed action; finished-run diagnostics start collapsed.
- The shared report omits `Cause: unknown`, while the UI omits checks that were never observed. Real negative/unavailable observations remain visible. A restored, ready Gateway gets Retry guidance instead of contradictory triage-first advice.
- Machine Doctor lint receipts stay unchanged in saved JSON, but do not appear as installation actions or selected output. The landed success-only inspection handoff stays after the terminal write, and main's rule that every warning counts toward attention is unchanged.
- Successful core updates count failed supplemental steps toward “warnings need attention,” without changing their success status. A matching warning receipt is counted once, not again as a failed step.

<details>
<summary>Status and preparation readers</summary>

The release rollback remains `failed`. Changing it to the already-existing `rolled-back` value would alter readers that are not part of this repair:

| Reader | Existing behavior |
| --- | --- |
| Shared report | Both have headlines; general failure advice specifically checks `failed`. |
| UI headline/progress | Both are terminal; the historical failure projection checks `failed`. |
| Recorded-attempt panel / Retry | Both are reportable; live permissions and busy state gate Retry. No failed-version blacklist is added. |
| `openclaw update status` | Both render, but current health/recovery and historical projection specifically check `failed`. |
| `update.run` admission | Pending trial/restore and a live preparation lock gate admission, not a failed version. |
| Notices / notifications | Both have summaries; failure-phase/recovery enrichment specifically checks `failed`. |
| Telemetry / result claims | Both are reportable non-success outcomes. Preserve `failed`; fill the existing rollback and running-version facts. Claim/send policy is unchanged. |
| Run watcher | Every status other than running is terminal and uses existing broadcast/final-notice custody. |
| Doctor | Abandonment/prerequisite notes specifically check `failed`; recorded warnings remain separate. |

Preparation readers already support both `in_progress` and `completed`: UI progress renders the active step and completed receipts; status JSON retains both; CLI progress keeps canonical staging; interrupted-preparation recovery from openclaw#203925 uses lock ownership and fails only unfinished steps. Start writes are retained, including during long Windows staging.

</details>

## Evidence

- Seven selected regressions fail on reported main `5820d5e88824` for the intended bad facts.
- Final implementation: `b36163728ccebd2383578d2c7e71016e8502983c`, including the synchronous advisory-handoff fix from openclaw#204063. Rendering the real healthy row `d9fd94cb` gives exactly **1 warning needs attention**. The duplicate `plugins` + `warning:plugins` regression is red at 2 before its fix and passes at 1 after it.
- Core/UI types, type-aware changed-source lint and formatting pass. Earlier integrated source passed 121 core/UI cases; 202 CLI/status/notification/report consumer cases passed for the attention change. All 62 final report assertions emitted pass; 43 watcher and 14 UI cases passed. A cold ack-notice test exceeded 120 s once; it passed in serial isolation, but the 360 s command bound stopped that run before its final two advisory cases. No timeout or assertion was weakened, and no wholly green final aggregate command is claimed. Earlier broad changed-check/consumer limits remain recorded.
- Local ClawSweeper reviewed final head `b36163728cce` at normal priority: **complete, patch correct, zero findings**.
- Hosted CI is **green on exact head `b36163728cce`**. The local cold-import/command-bound observations above remain recorded rather than hidden.
- **Earlier-head independent native Linux T → T+1: PASS** on `a924446274ff`, run `d9fd94cb-b844-4b75-9279-3a3fd42ce0f1` (`control-ui`, `succeeded`). Real schema 41 → 42, Service/Version pass, no unobserved warning badges or machine JSON; stored lint receipt unchanged. [Earlier-head UI/CLI images, before the attention-suffix correction](openclaw#204054 (comment)).
- **Earlier-head rollback and same-install healthy Retry: PASS** on `a924446274ff`, runs `511ad687-9d79-471b-950a-159a89099f2e` / `105ecb31-bae3-4c18-87b9-9e806be9822a`. Normal 10-minute trial budget, restored schema 41, database/WAL matching preimages, positive serving facts, completed preparation and enabled Retry. [Inspected rollback, Retry and CLI images](openclaw#204054 (comment)).
- **Exact-final-head native Linux healthy UI/CLI proof: PASS** on `b36163728cce`, run `34b0027c-adff-4eca-ae65-bd4d9815075e` (`control-ui`, `succeeded`). Both actual Settings and captured CLI output show **“1 warning needs attention”** for the naturally failed plugin step, with positive serving facts and no unobserved badges or raw JSON. Real schema 41 → 42 and the STRICT fixture table were verified. [Inspected final-head screenshots and proof details](openclaw#204054 (comment)).
- Initial CI found two browser tests expecting terminal diagnostics to stay open. The repaired test opens the visible summary before reading details; all **8 mock-Gateway browser E2E cases pass** locally (41.69 s). The repair is included in the integrated pushed head.

Production growth is 68 net lines, tests 184, docs 12. The extra production code records required facts and completion at their existing owners; no new subsystem or durable field is introduced.

### Before: the recorded Linux rollback

The startup headline is correct, but the details blame a runtime warning, show four unobserved checks as warnings, and tell the user to diagnose before retrying.

![Before: timeout outcome above the raw startup tail](https://github.com/user-attachments/assets/156029ba-daa4-4613-9811-45f078d37d21)

![Before: warning-led blame, unknown cause, and conflicting retry guidance](https://github.com/user-attachments/assets/8a2a8bb1-837c-4017-9025-1871b9e7c470)

### After: final-head healthy report

![Final Settings Updates: successful core update with one real issue needing attention](https://github.com/user-attachments/assets/3214dae8-e17d-464d-b5af-3cc14a583874)

![Final update status: faithful rendering of actual captured CLI stdout](https://github.com/user-attachments/assets/1af2798a-3e11-4198-a140-b1ccadaaa7e4)

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Nov 24, 2026
## What Problem This Solves

An update could start successfully or roll back safely, but its saved result could still say it was interrupted. The old Gateway and startup recovery could publish conflicting terminal results before the serving Gateway read the launcher's trial.

Related: #203925, #204215, #204054, #204253, #203994, #204063, #203981.

## User Impact

The Gateway that is ready records the activation result from the trial, without an expired preparation lock overriding the same run. Existing report headlines, cause, next step, serving-version details, and the visible restarting phase are preserved. No schema or configuration change.

A reused PID alone no longer makes an update fail: without a matching trial, the recorded lock deadline remains authoritative.

## Why This Change Was Made

Preparation owns refusals, already-current results, and failures before publication. It checks for an active trial while holding the preparation lock, so a concurrent request cannot prepare across another request's newly published trial. Gateway readiness settles trial outcomes first, preserves active trial phases, and then settles only a dead lock whose row remains running. This removes the old Gateway's second terminal writer and startup's PID/uptime guess without comparing update correlation IDs. Restart is armed before its nonterminal progress write, and pending trials publish only after preparation bookkeeping.

The notice and report paths share a pure serving-version projection, without importing backend ledger mutation code into Control UI. Status rendering is retained unchanged. A complete LSP audit found production readers for every remaining report export, so none was deleted only to meet a line target.

Production code on this PR's six touched runtime files against integrated main `38e8b1e330a162ca7435dda27ca43d268fbc8017` (tests/support/harness excluded): **2,562 → 2,557 (−5)**. `tokei` measured 2,553 before the final four explicit no-op switch-case lines. The database-worker registry and synthetic-module test harness each add one test infrastructure line separately.

### Retained compatibility repair: #204322

The contributor's recovery code is unchanged. This is not a modern launcher-trial settlement path:

- [Eligibility](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-candidate-check-early-release.ts#L132-L176) is only moving-`main` Git updaters from November 17–19, with `releases/<id>/build` and the old `lib/node_modules/openclaw` link, when schemas must change or recovery is already in progress. Automatic recovery additionally requires a matching running Linux systemd user service. Current Git and npm/pnpm installs do not take it.
- Both terminal-recording functions have one production caller: the [`cli-oneshot` worker mode](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-migrated-finalize.worker.ts#L93-L108), which returns without entering Gateway startup. Gateway processes are separate children, not these workers.
- The [first ready check precedes opening the repair run](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-early-release-recovery.ts#L385-L404). The [second precedes finishing and cleanup](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-early-release-recovery.ts#L442-L454). Its success means the checkout and PATH repair is complete, not merely that a Gateway booted. Failure can also be recorded when the migrated release never becomes ready. There is no current v2 trial handoff for that repair operation, so moving its record to either ready event would lose or prematurely finish it.

**Published versions: none.** Published Git tags `v2026.11.5`, `v2026.10.33`, `v2026.11.6`, `v2026.11.7`, `v2026.11.8`, and `v2026.11.10-beta.1`–`.3` contain neither the early Git release-path module nor its runner. Earlier releases predate its introducing commit `6747b1ec5ae`; no published `v` tag lies between that commit and layout replacement `2ef6f7bade7`. The snapshots report a release-like version but belong to the moving `main` dev channel, not a published release.

**Deletion trigger:** retire this main-only recovery family and its early-layout check at the first regular stable cut after published `v2026.11.8` (stable/dev are distinct in [release policy](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/docs/reference/RELEASING.md#release-channels)). Already-started recovery units retain their own code until they finish.

## Evidence

- Base owner regression: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_31f06e4e9eeb9c36b954bef19ed05bad), base `a6893b815789aa305070547ad28a032c7c87500e` plus the regression. Both committed and rolled-back trials incorrectly became interrupted; the live reused-PID case also incorrectly failed (three expected failures, three passes).
- Consumer proof for the earlier shape: 1,264 tests passed across 65 files, with one skipped file. The only two failures were the new preparation tests running without the host SQLite broker; [both passed after project registration](https://crabbox.openclaw.ai/portal/runs/run_5f8278182e180f2864a4103697ac117a). Existing report and UI tests are included.
- Runtime patch head `48594843ded928e56eaf849ce6d156ce94065d2a`: [AWS proof](https://crabbox.openclaw.ai/portal/runs/run_494f1acc71169d7dd0313d8740a2b91c) passed **21 tests in both owner files and the session-identity ratchet**, including all three active-trial phases and the concurrent-publication race. No full consumer suite was rerun.
- Integrated head `285de72e5bc3b2d617e2646d6124dacc997b822c` merges main `38e8b1e330a162ca7435dda27ca43d268fbc8017` and documents the verified bridge exception without changing its recovery code. Its 21 owner tests and ratchet passed. Its subsequent build failed before either matrix case started; no matrix pass is claimed.
- The auth regression now uses real `prepareUpdate` with an injected lock-link failure, keeping the same failed-outcome assertions. Its [affected CI gate passed](https://github.com/openclaw/openclaw/actions/runs/45443743806/job/138623113263) on test-only commit `e8e54bfec0a09ea5d48d09f4638e0493711f7336`.
- Qualification source `0fb086108808764c16e6f354cf1557478d9ff974`: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_d9922f2b7283a54e4c847e4f2b4e5799) passed **101 owner/report tests**, the session-identity ratchet, and full T/T+1 builds including Control UI. Canonical healthy schema **41→42** passed: committed trial, succeeded ledger row, two fixture rows retained, target build serving (165.095 s whole scenario, not a measured outage).
- **Separate rollback-restore class RED, not addressed by this settlement cut:** the crash trial rolled back and `/readyz` returned success on schema41, but the actual SQL ledger row remained `running/restarting`; the serving Gateway could not read its restored database (`database disk image is malformed`) and deferred settlement. The CLI reported a read-only-worker rollback error. Trial, crash marker, actual ledger rows, schema/readiness summary, and bounded launcher/Gateway journal were captured. The rollback/state owner is investigating this separately; no unchanged retry or weakened assertion.
- The UI import leak was ours, not inherited. It is fixed by the unchanged projection moving to the pure notice module; [UI E2E 1/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992698), [2/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992590), and [Control UI performance](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651991532) now pass. No override is requested for UI or other owned failures.
- Local ClawSweeper runtime review: **patch is correct, zero findings**, exact head `48594843ded928e56eaf849ce6d156ce94065d2a`. Subsequent changes are the current-main integration, compatibility documentation, auth fixture, and browser-safe projection ownership described above.
- Final head `4f4c6a7bb68acde5a46edb40ab5a4e1c3405ec5e` differs from that qualification source only by the no-op exhaustive cases below and one fixture allowlist entry loading the **real** notice module instead of an unexpected-call stub. Outcome assertions remain unchanged. These are owned CI fixes; their checks must pass. The qualification remains behavior-equivalent.

```diff
 case "restoring":
   return;
+case undefined:
+case "committed":
+case "rolled-back":
+  break;
```

- Remaining CI planner fixture red is **MAIN-ALSO**, superseding the earlier ci-triage OURS label: [one clean-main AWS run](https://crabbox.openclaw.ai/portal/runs/run_266010a78ce4d0e864cfa9f696fd7f68) at `269f88452ac261cec1d8e99e7b740cedfe341161` reproduced the same expected-four/actual-five assertion (**173 passed, one failed**). No planner or fixture change is included. The [scoped maintainer override](#204700 (comment)) covers only that main failure and its aggregate gate. Exhaustive lint and compact-small-6 both pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…w#204700)

## What Problem This Solves

An update could start successfully or roll back safely, but its saved result could still say it was interrupted. The old Gateway and startup recovery could publish conflicting terminal results before the serving Gateway read the launcher's trial.

Related: openclaw#203925, openclaw#204215, openclaw#204054, openclaw#204253, openclaw#203994, openclaw#204063, openclaw#203981.

## User Impact

The Gateway that is ready records the activation result from the trial, without an expired preparation lock overriding the same run. Existing report headlines, cause, next step, serving-version details, and the visible restarting phase are preserved. No schema or configuration change.

A reused PID alone no longer makes an update fail: without a matching trial, the recorded lock deadline remains authoritative.

## Why This Change Was Made

Preparation owns refusals, already-current results, and failures before publication. It checks for an active trial while holding the preparation lock, so a concurrent request cannot prepare across another request's newly published trial. Gateway readiness settles trial outcomes first, preserves active trial phases, and then settles only a dead lock whose row remains running. This removes the old Gateway's second terminal writer and startup's PID/uptime guess without comparing update correlation IDs. Restart is armed before its nonterminal progress write, and pending trials publish only after preparation bookkeeping.

The notice and report paths share a pure serving-version projection, without importing backend ledger mutation code into Control UI. Status rendering is retained unchanged. A complete LSP audit found production readers for every remaining report export, so none was deleted only to meet a line target.

Production code on this PR's six touched runtime files against integrated main `d0782abed304605ff96699085776fa447e3f4d54` (tests/support/harness excluded): **2,562 → 2,557 (−5)**. `tokei` measured 2,553 before the final four explicit no-op switch-case lines. The database-worker registry and synthetic-module test harness each add one test infrastructure line separately.

### Retained compatibility repair: openclaw#204322

The contributor's recovery code is unchanged. This is not a modern launcher-trial settlement path:

- [Eligibility](https://github.com/openclaw/openclaw/blob/d0782abed304605ff96699085776fa447e3f4d54/src/infra/update-candidate-check-early-release.ts#L132-L176) is only moving-`main` Git updaters from November 17–19, with `releases/<id>/build` and the old `lib/node_modules/openclaw` link, when schemas must change or recovery is already in progress. Automatic recovery additionally requires a matching running Linux systemd user service. Current Git and npm/pnpm installs do not take it.
- Both terminal-recording functions have one production caller: the [`cli-oneshot` worker mode](https://github.com/openclaw/openclaw/blob/d0782abed304605ff96699085776fa447e3f4d54/src/infra/update-migrated-finalize.worker.ts#L93-L108), which returns without entering Gateway startup. Gateway processes are separate children, not these workers.
- The [first ready check precedes opening the repair run](https://github.com/openclaw/openclaw/blob/d0782abed304605ff96699085776fa447e3f4d54/src/infra/update-early-release-recovery.ts#L385-L404). The [second precedes finishing and cleanup](https://github.com/openclaw/openclaw/blob/d0782abed304605ff96699085776fa447e3f4d54/src/infra/update-early-release-recovery.ts#L442-L454). Its success means the checkout and PATH repair is complete, not merely that a Gateway booted. Failure can also be recorded when the migrated release never becomes ready. There is no current v2 trial handoff for that repair operation, so moving its record to either ready event would lose or prematurely finish it.

**Published versions: none.** Published Git tags `v2026.11.5`, `v2026.10.33`, `v2026.11.6`, `v2026.11.7`, `v2026.11.8`, and `v2026.11.10-beta.1`–`.3` contain neither the early Git release-path module nor its runner. Earlier releases predate its introducing commit `c303d979c41`; no published `v` tag lies between that commit and layout replacement `8d7301e6086`. The snapshots report a release-like version but belong to the moving `main` dev channel, not a published release.

**Deletion trigger:** retire this main-only recovery family and its early-layout check at the first regular stable cut after published `v2026.11.8` (stable/dev are distinct in [release policy](https://github.com/openclaw/openclaw/blob/d0782abed304605ff96699085776fa447e3f4d54/docs/reference/RELEASING.md#release-channels)). Already-started recovery units retain their own code until they finish.

## Evidence

- Base owner regression: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_31f06e4e9eeb9c36b954bef19ed05bad), base `e48368087277475b47996815403ad103cd416089` plus the regression. Both committed and rolled-back trials incorrectly became interrupted; the live reused-PID case also incorrectly failed (three expected failures, three passes).
- Consumer proof for the earlier shape: 1,264 tests passed across 65 files, with one skipped file. The only two failures were the new preparation tests running without the host SQLite broker; [both passed after project registration](https://crabbox.openclaw.ai/portal/runs/run_5f8278182e180f2864a4103697ac117a). Existing report and UI tests are included.
- Runtime patch head `48594843ded928e56eaf849ce6d156ce94065d2a`: [AWS proof](https://crabbox.openclaw.ai/portal/runs/run_494f1acc71169d7dd0313d8740a2b91c) passed **21 tests in both owner files and the session-identity ratchet**, including all three active-trial phases and the concurrent-publication race. No full consumer suite was rerun.
- Integrated head `285de72e5bc3b2d617e2646d6124dacc997b822c` merges main `d0782abed304605ff96699085776fa447e3f4d54` and documents the verified bridge exception without changing its recovery code. Its 21 owner tests and ratchet passed. Its subsequent build failed before either matrix case started; no matrix pass is claimed.
- The auth regression now uses real `prepareUpdate` with an injected lock-link failure, keeping the same failed-outcome assertions. Its [affected CI gate passed](https://github.com/openclaw/openclaw/actions/runs/45443743806/job/138623113263) on test-only commit `e8e54bfec0a09ea5d48d09f4638e0493711f7336`.
- Qualification source `0fb086108808764c16e6f354cf1557478d9ff974`: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_d9922f2b7283a54e4c847e4f2b4e5799) passed **101 owner/report tests**, the session-identity ratchet, and full T/T+1 builds including Control UI. Canonical healthy schema **41→42** passed: committed trial, succeeded ledger row, two fixture rows retained, target build serving (165.095 s whole scenario, not a measured outage).
- **Separate rollback-restore class RED, not addressed by this settlement cut:** the crash trial rolled back and `/readyz` returned success on schema41, but the actual SQL ledger row remained `running/restarting`; the serving Gateway could not read its restored database (`database disk image is malformed`) and deferred settlement. The CLI reported a read-only-worker rollback error. Trial, crash marker, actual ledger rows, schema/readiness summary, and bounded launcher/Gateway journal were captured. The rollback/state owner is investigating this separately; no unchanged retry or weakened assertion.
- The UI import leak was ours, not inherited. It is fixed by the unchanged projection moving to the pure notice module; [UI E2E 1/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992698), [2/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992590), and [Control UI performance](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651991532) now pass. No override is requested for UI or other owned failures.
- Local ClawSweeper runtime review: **patch is correct, zero findings**, exact head `48594843ded928e56eaf849ce6d156ce94065d2a`. Subsequent changes are the current-main integration, compatibility documentation, auth fixture, and browser-safe projection ownership described above.
- Final head `4f4c6a7bb68acde5a46edb40ab5a4e1c3405ec5e` differs from that qualification source only by the no-op exhaustive cases below and one fixture allowlist entry loading the **real** notice module instead of an unexpected-call stub. Outcome assertions remain unchanged. These are owned CI fixes; their checks must pass. The qualification remains behavior-equivalent.

```diff
 case "restoring":
   return;
+case undefined:
+case "committed":
+case "rolled-back":
+  break;
```

- Remaining CI planner fixture red is **MAIN-ALSO**, superseding the earlier ci-triage OURS label: [one clean-main AWS run](https://crabbox.openclaw.ai/portal/runs/run_266010a78ce4d0e864cfa9f696fd7f68) at `0ef684ebc6840c92d9ae493cfe64b390acd90e49` reproduced the same expected-four/actual-five assertion (**173 passed, one failed**). No planner or fixture change is included. The [scoped maintainer override](openclaw#204700 (comment)) covers only that main failure and its aggregate gate. Exhaustive lint and compact-small-6 both pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
An update could start successfully or roll back safely, but its saved result could still say it was interrupted. The old Gateway and startup recovery could publish conflicting terminal results before the serving Gateway read the launcher's trial.

Related: #203925, #204215, #204054, #204253, #203994, #204063, #203981.

The Gateway that is ready records the activation result from the trial, without an expired preparation lock overriding the same run. Existing report headlines, cause, next step, serving-version details, and the visible restarting phase are preserved. No schema or configuration change.

A reused PID alone no longer makes an update fail: without a matching trial, the recorded lock deadline remains authoritative.

Preparation owns refusals, already-current results, and failures before publication. It checks for an active trial while holding the preparation lock, so a concurrent request cannot prepare across another request's newly published trial. Gateway readiness settles trial outcomes first, preserves active trial phases, and then settles only a dead lock whose row remains running. This removes the old Gateway's second terminal writer and startup's PID/uptime guess without comparing update correlation IDs. Restart is armed before its nonterminal progress write, and pending trials publish only after preparation bookkeeping.

The notice and report paths share a pure serving-version projection, without importing backend ledger mutation code into Control UI. Status rendering is retained unchanged. A complete LSP audit found production readers for every remaining report export, so none was deleted only to meet a line target.

Production code on this PR's six touched runtime files against integrated main `38e8b1e330a162ca7435dda27ca43d268fbc8017` (tests/support/harness excluded): **2,562 → 2,557 (−5)**. `tokei` measured 2,553 before the final four explicit no-op switch-case lines. The database-worker registry and synthetic-module test harness each add one test infrastructure line separately.

The contributor's recovery code is unchanged. This is not a modern launcher-trial settlement path:

- [Eligibility](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-candidate-check-early-release.ts#L132-L176) is only moving-`main` Git updaters from November 17–19, with `releases/<id>/build` and the old `lib/node_modules/openclaw` link, when schemas must change or recovery is already in progress. Automatic recovery additionally requires a matching running Linux systemd user service. Current Git and npm/pnpm installs do not take it.
- Both terminal-recording functions have one production caller: the [`cli-oneshot` worker mode](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-migrated-finalize.worker.ts#L93-L108), which returns without entering Gateway startup. Gateway processes are separate children, not these workers.
- The [first ready check precedes opening the repair run](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-early-release-recovery.ts#L385-L404). The [second precedes finishing and cleanup](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/src/infra/update-early-release-recovery.ts#L442-L454). Its success means the checkout and PATH repair is complete, not merely that a Gateway booted. Failure can also be recorded when the migrated release never becomes ready. There is no current v2 trial handoff for that repair operation, so moving its record to either ready event would lose or prematurely finish it.

**Published versions: none.** Published Git tags `v2026.11.5`, `v2026.10.33`, `v2026.11.6`, `v2026.11.7`, `v2026.11.8`, and `v2026.11.10-beta.1`–`.3` contain neither the early Git release-path module nor its runner. Earlier releases predate its introducing commit `6747b1ec5ae`; no published `v` tag lies between that commit and layout replacement `2ef6f7bade7`. The snapshots report a release-like version but belong to the moving `main` dev channel, not a published release.

**Deletion trigger:** retire this main-only recovery family and its early-layout check at the first regular stable cut after published `v2026.11.8` (stable/dev are distinct in [release policy](https://github.com/openclaw/openclaw/blob/38e8b1e330a162ca7435dda27ca43d268fbc8017/docs/reference/RELEASING.md#release-channels)). Already-started recovery units retain their own code until they finish.

- Base owner regression: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_31f06e4e9eeb9c36b954bef19ed05bad), base `a6893b815789aa305070547ad28a032c7c87500e` plus the regression. Both committed and rolled-back trials incorrectly became interrupted; the live reused-PID case also incorrectly failed (three expected failures, three passes).
- Consumer proof for the earlier shape: 1,264 tests passed across 65 files, with one skipped file. The only two failures were the new preparation tests running without the host SQLite broker; [both passed after project registration](https://crabbox.openclaw.ai/portal/runs/run_5f8278182e180f2864a4103697ac117a). Existing report and UI tests are included.
- Runtime patch head `48594843ded928e56eaf849ce6d156ce94065d2a`: [AWS proof](https://crabbox.openclaw.ai/portal/runs/run_494f1acc71169d7dd0313d8740a2b91c) passed **21 tests in both owner files and the session-identity ratchet**, including all three active-trial phases and the concurrent-publication race. No full consumer suite was rerun.
- Integrated head `285de72e5bc3b2d617e2646d6124dacc997b822c` merges main `38e8b1e330a162ca7435dda27ca43d268fbc8017` and documents the verified bridge exception without changing its recovery code. Its 21 owner tests and ratchet passed. Its subsequent build failed before either matrix case started; no matrix pass is claimed.
- The auth regression now uses real `prepareUpdate` with an injected lock-link failure, keeping the same failed-outcome assertions. Its [affected CI gate passed](https://github.com/openclaw/openclaw/actions/runs/45443743806/job/138623113263) on test-only commit `e8e54bfec0a09ea5d48d09f4638e0493711f7336`.
- Qualification source `0fb086108808764c16e6f354cf1557478d9ff974`: [AWS run](https://crabbox.openclaw.ai/portal/runs/run_d9922f2b7283a54e4c847e4f2b4e5799) passed **101 owner/report tests**, the session-identity ratchet, and full T/T+1 builds including Control UI. Canonical healthy schema **41→42** passed: committed trial, succeeded ledger row, two fixture rows retained, target build serving (165.095 s whole scenario, not a measured outage).
- **Separate rollback-restore class RED, not addressed by this settlement cut:** the crash trial rolled back and `/readyz` returned success on schema41, but the actual SQL ledger row remained `running/restarting`; the serving Gateway could not read its restored database (`database disk image is malformed`) and deferred settlement. The CLI reported a read-only-worker rollback error. Trial, crash marker, actual ledger rows, schema/readiness summary, and bounded launcher/Gateway journal were captured. The rollback/state owner is investigating this separately; no unchanged retry or weakened assertion.
- The UI import leak was ours, not inherited. It is fixed by the unchanged projection moving to the pure notice module; [UI E2E 1/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992698), [2/2](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651992590), and [Control UI performance](https://github.com/openclaw/openclaw/actions/runs/45451818804/job/138651991532) now pass. No override is requested for UI or other owned failures.
- Local ClawSweeper runtime review: **patch is correct, zero findings**, exact head `48594843ded928e56eaf849ce6d156ce94065d2a`. Subsequent changes are the current-main integration, compatibility documentation, auth fixture, and browser-safe projection ownership described above.
- Final head `4f4c6a7bb68acde5a46edb40ab5a4e1c3405ec5e` differs from that qualification source only by the no-op exhaustive cases below and one fixture allowlist entry loading the **real** notice module instead of an unexpected-call stub. Outcome assertions remain unchanged. These are owned CI fixes; their checks must pass. The qualification remains behavior-equivalent.

```diff
 case "restoring":
   return;
+case undefined:
+case "committed":
+case "rolled-back":
+  break;
```

- Remaining CI planner fixture red is **MAIN-ALSO**, superseding the earlier ci-triage OURS label: [one clean-main AWS run](https://crabbox.openclaw.ai/portal/runs/run_266010a78ce4d0e864cfa9f696fd7f68) at `269f88452ac261cec1d8e99e7b740cedfe341161` reproduced the same expected-four/actual-five assertion (**173 passed, one failed**). No planner or fixture change is included. The [scoped maintainer override](#204700 (comment)) covers only that main failure and its aggregate gate. Exhaustive lint and compact-small-6 both pass.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit d000ca3)

Release adaptation: conflicts in docs/install/updating.md, src/update/run.ts resolved by applying the source change over release-only hunks; source hunks verified unchanged (whitespace-insensitive).

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Related: #204035

## What Problem This Solves

After an update rolls back, Settings → Updates can blame a Node security warning, mark completed preparation as failed, show healthy service checks as unverified, and tell the user to diagnose before using its enabled Retry button. Raw startup logs also appear as a failed update action. Successful core updates can look clean while a plugin step is visibly failed.

## User Impact

The report keeps the recorded startup failure and the previous version's running identity. It gives one recovery path: retry the update; if it fails again, choose **Report update failure**. Completed preparation stays completed, live preparation progress remains visible, and startup logs remain available in expandable diagnostics and saved JSON.

No schema, protocol, update status, plugin lifecycle, retry mechanism, flag, or timer changes. The plugin-maintenance command genuinely refuses the candidate's schema migration while the previous Gateway serves. This PR shows that actual refusal instead of its preceding runtime warning; the separate lifecycle defect remains tracked in #204035.

## Why This Change Was Made

- Preparation writes both start and completion through the existing callback and step upsert. A later rollback no longer changes successfully completed work to failure.
- Plugin failure detail starts with the CLI's explicit reason, not arbitrary stderr's first line.
- The ready Gateway records existing rollback and serving facts. Startup output is a diagnostic receipt, not a blamed failed action; finished-run diagnostics start collapsed.
- The shared report omits `Cause: unknown`, while the UI omits checks that were never observed. Real negative/unavailable observations remain visible. A restored, ready Gateway gets Retry guidance instead of contradictory triage-first advice.
- Machine Doctor lint receipts stay unchanged in saved JSON, but do not appear as installation actions or selected output. The landed success-only inspection handoff stays after the terminal write, and main's rule that every warning counts toward attention is unchanged.
- Successful core updates count failed supplemental steps toward “warnings need attention,” without changing their success status. A matching warning receipt is counted once, not again as a failed step.

<details>
<summary>Status and preparation readers</summary>

The release rollback remains `failed`. Changing it to the already-existing `rolled-back` value would alter readers that are not part of this repair:

| Reader | Existing behavior |
| --- | --- |
| Shared report | Both have headlines; general failure advice specifically checks `failed`. |
| UI headline/progress | Both are terminal; the historical failure projection checks `failed`. |
| Recorded-attempt panel / Retry | Both are reportable; live permissions and busy state gate Retry. No failed-version blacklist is added. |
| `openclaw update status` | Both render, but current health/recovery and historical projection specifically check `failed`. |
| `update.run` admission | Pending trial/restore and a live preparation lock gate admission, not a failed version. |
| Notices / notifications | Both have summaries; failure-phase/recovery enrichment specifically checks `failed`. |
| Telemetry / result claims | Both are reportable non-success outcomes. Preserve `failed`; fill the existing rollback and running-version facts. Claim/send policy is unchanged. |
| Run watcher | Every status other than running is terminal and uses existing broadcast/final-notice custody. |
| Doctor | Abandonment/prerequisite notes specifically check `failed`; recorded warnings remain separate. |

Preparation readers already support both `in_progress` and `completed`: UI progress renders the active step and completed receipts; status JSON retains both; CLI progress keeps canonical staging; interrupted-preparation recovery from #203925 uses lock ownership and fails only unfinished steps. Start writes are retained, including during long Windows staging.

</details>

## Evidence

- Seven selected regressions fail on reported main `6f2bd815fecb` for the intended bad facts.
- Final implementation: `b36163728ccebd2383578d2c7e71016e8502983c`, including the synchronous advisory-handoff fix from #204063. Rendering the real healthy row `d9fd94cb` gives exactly **1 warning needs attention**. The duplicate `plugins` + `warning:plugins` regression is red at 2 before its fix and passes at 1 after it.
- Core/UI types, type-aware changed-source lint and formatting pass. Earlier integrated source passed 121 core/UI cases; 202 CLI/status/notification/report consumer cases passed for the attention change. All 62 final report assertions emitted pass; 43 watcher and 14 UI cases passed. A cold ack-notice test exceeded 120 s once; it passed in serial isolation, but the 360 s command bound stopped that run before its final two advisory cases. No timeout or assertion was weakened, and no wholly green final aggregate command is claimed. Earlier broad changed-check/consumer limits remain recorded.
- Local ClawSweeper reviewed final head `b36163728cce` at normal priority: **complete, patch correct, zero findings**.
- Hosted CI is **green on exact head `b36163728cce`**. The local cold-import/command-bound observations above remain recorded rather than hidden.
- **Earlier-head independent native Linux T → T+1: PASS** on `a924446274ff`, run `d9fd94cb-b844-4b75-9279-3a3fd42ce0f1` (`control-ui`, `succeeded`). Real schema 41 → 42, Service/Version pass, no unobserved warning badges or machine JSON; stored lint receipt unchanged. [Earlier-head UI/CLI images, before the attention-suffix correction](#204054 (comment)).
- **Earlier-head rollback and same-install healthy Retry: PASS** on `a924446274ff`, runs `511ad687-9d79-471b-950a-159a89099f2e` / `105ecb31-bae3-4c18-87b9-9e806be9822a`. Normal 10-minute trial budget, restored schema 41, database/WAL matching preimages, positive serving facts, completed preparation and enabled Retry. [Inspected rollback, Retry and CLI images](#204054 (comment)).
- **Exact-final-head native Linux healthy UI/CLI proof: PASS** on `b36163728cce`, run `34b0027c-adff-4eca-ae65-bd4d9815075e` (`control-ui`, `succeeded`). Both actual Settings and captured CLI output show **“1 warning needs attention”** for the naturally failed plugin step, with positive serving facts and no unobserved badges or raw JSON. Real schema 41 → 42 and the STRICT fixture table were verified. [Inspected final-head screenshots and proof details](#204054 (comment)).
- Initial CI found two browser tests expecting terminal diagnostics to stay open. The repaired test opens the visible summary before reading details; all **8 mock-Gateway browser E2E cases pass** locally (41.69 s). The repair is included in the integrated pushed head.

Production growth is 68 net lines, tests 184, docs 12. The extra production code records required facts and completion at their existing owners; no new subsystem or durable field is introduced.

### Before: the recorded Linux rollback

The startup headline is correct, but the details blame a runtime warning, show four unobserved checks as warnings, and tell the user to diagnose before retrying.

![Before: timeout outcome above the raw startup tail](https://github.com/user-attachments/assets/156029ba-daa4-4613-9811-45f078d37d21)

![Before: warning-led blame, unknown cause, and conflicting retry guidance](https://github.com/user-attachments/assets/8a2a8bb1-837c-4017-9025-1871b9e7c470)

### After: final-head healthy report

![Final Settings Updates: successful core update with one real issue needing attention](https://github.com/user-attachments/assets/3214dae8-e17d-464d-b5af-3cc14a583874)

![Final update status: faithful rendering of actual captured CLI stdout](https://github.com/user-attachments/assets/1af2798a-3e11-4198-a140-b1ccadaaa7e4)

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 6837fd3)

Release adaptation: Extract only successful-update attention counts and dedupe when the supplemental failure already has a warning. Exclude rollback, prep, launcher, retry UI and recovery hints.

Companion audit: Use the existing update report owner; other donor UI/recovery changes do not participate in this headline fix.

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

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant