Repository navigation
fix: report update outcomes from the Gateway that is serving - #204700
Conversation
Let the ready Gateway settle trial outcomes before abandoned preparation can override them. Keep pre-activation failures with prepareUpdate, including lock acquisition, and publish pending trials only after preparation bookkeeping. Delete the old Gateway terminal writer and PID/uptime guess; preserve restarting progress after arming restart. Detach update notices from the legacy renderer. Register the broker-using owner test in its existing forked-process project and inject the lock fault only after row creation.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Correction — no maintainer override is requested for the UI failures. The UI build failures are owned by this PR: the report imported The serving-version helper is being moved unchanged to the existing pure notice module so the renderer never imports that backend chain. The corrected head must pass its UI build and CI gates; no bypass is requested. The auth fixture correction in |
|
Codex review: needs changes before merge. What this changesThis PR makes the ready Gateway settle activation outcomes from the launcher trial and keeps preparation failures with the preparation owner. Example: A successful trial still has an expired preparation lock for the same run.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: consolidating activation settlement is useful, but abandoned preparation can remain running after PID reuse, and an affected Gateway consumer test fails on this head. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherCLI and Gateway update requests prepare a release, publish a launcher trial, and restart; the serving Gateway records the outcome in update history for CLI, app, and notification readers. flowchart TD
A[CLI or Gateway request] --> B[Release preparation]
B --> C[Launcher trial]
C --> D[Ready Gateway]
D --> E[Update history]
E --> F[CLI app and notices]
Technical reviewBest possible solution: Keep trial-first settlement, retain abandoned-lock settlement until its deadline through the existing maintenance owner, and migrate the Gateway consumer test to preparation-owned failure recording. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that an expired preparation lock can finish a run as interrupted before its successful or rolled-back trial is read; the author also reports red-on-base owner regressions, but no target code was executed during this review. Is this the best way to solve the issue? Using preparation and ready-Gateway owners is the right repair, and the large run.ts diff is mostly indentation; deadline-based orphan recovery still needs a complete lifecycle. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15b7df380861. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -18, Tests +100, Docs +3. Total +85 across 11 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 24, 2026, 10:01 AM ET / 15:01 UTC. |
Move the existing active-trial refusal after lock acquisition so two concurrent update requests cannot prepare across a newly published trial. At Gateway ready, settle the trial first, preserve active trial phases, then settle only a dead lock whose recorded row remains running. Use recorded phase and row state instead of comparing update correlation IDs. Add the lock-acquisition race regression.
…lass-b-settlement
Preserve #204322 recovery logic unchanged after merging current main. Document that its CLI-only repair run starts after one Gateway ready event and cleanup finishes after the next, so neither event can settle that distinct repair operation. No published Git release tag shipped the Nov 17–19 layout; retire the main-only bridge at the first regular stable cut after v2026.11.8, retaining code for in-flight recoveries.
Preserve the existing authorized update outcome assertions. Replace the prepareUpdate rejection stub with the real preparation owner and a filesystem lock-link failure. Only this test file changes; Main approved retaining the 285de72 healthy/crash matrix as production-equivalent proof.
Move the unchanged serving-version projection to the pure notice module, keeping backend ledger mutation imports out of Control UI.
Spell out terminal and absent trial phases without changing settlement behavior. Let the synthetic-package regression evaluate the real pure notice owner after the serving helper move, preserving all outcome assertions.
|
Maintainer override: The remaining planner fixture failure is MAIN-ALSO, proven by one clean-main AWS run at
No planner/fixture edit is included here. This override applies only to that existing-main failure and its aggregate CI gate—not to owned failures. The UI build/import leak, exhaustive phase lint and synthetic-module fixture failures were fixed, and their affected final-head jobs pass. The independent crash-after-migration qualification remains a separate rollback-restore class red: the old Gateway serves again but cannot settle a row while reads of its restored database report corruption. It is explicitly recorded in the PR body, not called a qualification pass. |
|
Landed.
Separate and tracked: the crash-after-migration case still leaves the run unsettled, because other processes hold the state store during the switch; that is its own fix. |
## 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](openclaw/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]>
…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]>
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]>
Release adaptation: conflict resolution in the #204512/#204700 ports left indentation in src/update/run.ts and import order in src/update/cli.test.ts unformatted. The #204883 survivor fact helper sorts with an explicit comparator because the release script lint requires one. No behavior change. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
* fix: show Claude CLI document uploads only once in chat * fix: show Claude CLI document uploads only once in chat OpenClaw-Publication: 4555cb04-bff2-43b3-aff8-ec271d6567b2 * fix: keep Claude document uploads on the message that sent them * fix: preserve the released message queue result contract Release adaptation: Use an optional accepted-input observer instead of widening queueMessage's released Promise<void> contract. Reuse the stable steering and transcript-rewrite handlers; leave source admission, native image steering, config, and all SQLite schemas unchanged. The existing history index columns also carry exact document correlation. Keep the released model-hook test layout. Companion audit through be407a4: no later #203866 reference. PRs #208535 (Claude compacted fork summaries), #206158 (native subagent status), and #205663 (image dimensions) are separate. PRs #208252 (Codex source), #207022 (embedded prompt dispatch), #206969 (fallback), #205963 (Copilot question policy), and 50a7368 (snooze) do not own this path. SHA mentions in #204700 and #204685 are update/qualification records, not follow-ups. (cherry picked from commit 269f884) Co-authored-by: RomneyDa <[email protected]>
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).tokeimeasured 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:
mainGit updaters from November 17–19, withreleases/<id>/buildand the oldlib/node_modules/openclawlink, 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.cli-oneshotworker mode, which returns without entering Gateway startup. Gateway processes are separate children, not these workers.Published versions: none. Published Git tags
v2026.11.5,v2026.10.33,v2026.11.6,v2026.11.7,v2026.11.8, andv2026.11.10-beta.1–.3contain neither the early Git release-path module nor its runner. Earlier releases predate its introducing commit6747b1ec5ae; no publishedvtag lies between that commit and layout replacement2ef6f7bade7. The snapshots report a release-like version but belong to the movingmaindev 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). Already-started recovery units retain their own code until they finish.Evidence
a6893b815789aa305070547ad28a032c7c87500eplus the regression. Both committed and rolled-back trials incorrectly became interrupted; the live reused-PID case also incorrectly failed (three expected failures, three passes).48594843ded928e56eaf849ce6d156ce94065d2a: AWS proof 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.285de72e5bc3b2d617e2646d6124dacc997b822cmerges main38e8b1e330a162ca7435dda27ca43d268fbc8017and 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.prepareUpdatewith an injected lock-link failure, keeping the same failed-outcome assertions. Its affected CI gate passed on test-only commite8e54bfec0a09ea5d48d09f4638e0493711f7336.0fb086108808764c16e6f354cf1557478d9ff974: AWS run 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)./readyzreturned success on schema41, but the actual SQL ledger row remainedrunning/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.48594843ded928e56eaf849ce6d156ce94065d2a. Subsequent changes are the current-main integration, compatibility documentation, auth fixture, and browser-safe projection ownership described above.4f4c6a7bb68acde5a46edb40ab5a4e1c3405ec5ediffers 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.269f88452ac261cec1d8e99e7b740cedfe341161reproduced the same expected-four/actual-five assertion (173 passed, one failed). No planner or fixture change is included. The scoped maintainer override covers only that main failure and its aggregate gate. Exhaustive lint and compact-small-6 both pass.