Repository navigation
fix: expose live updater recovery failure diagnostics - #119096
fuller-stack-dev merged 1 commit into
Conversation
|
Codex review: found issues before merge. Reviewed August 4, 2026, 1:16 AM ET / 05:16 UTC. ClawSweeper reviewWhat this changesAdds bounded typed diagnostics to live-updater failure JSON so fleet automation can distinguish primary, proof, cleanup, and rollback failures without exposing process output. Merge readinessThis PR remains necessary, but one direct updater command still loses its operation identity in recovery diagnostics. The prior stopped-proof finding is fixed; retain the PR for the narrow log-query wrapper and regression test. Priority: P2 Review scores
Verification
How this fits togetherThe live updater fast-forwards a managed OpenClaw checkout, safely stops or recovers its Gateway, and emits a single JSON outcome for operators. Its error formatter converts updater, invariant, and child-process failures into the machine-readable result consumed by automation. flowchart LR
A[Live update request] --> B[Gateway suspension]
B --> C[Build and restart]
C --> D[Readiness and log audit]
D --> E[Typed failure formatter]
E --> F[Single JSON result]
F --> G[Fleet automation]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceTests +323, Other +310. Total +633 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make each updater-owned command producer attach its fixed operation label before the terminal formatter, then retain the stable existing JSON fields with bounded, redacted diagnostics. Do we have a high-confidence way to reproduce the issue? Yes: when the post-restart RPC log query fails and no local fallback log exists, current source rethrows its raw command error into recovery aggregation; the new formatter maps it only to external_command. Is this the best way to solve the issue? No: the formatter is the right terminal boundary, but the raw log-query producer must attach gateway.logs there rather than making the formatter infer command identity. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5a1daf81a554. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
38051fb to
5b55101
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5b55101 to
1d3c915
Compare
|
Merged via squash.
|
* origin/main: fix: preserve live updater failure diagnostics (#119096) fix: recover new-session models through Gateway startup (#119120) test(qa): cover instruction profile artifacts (#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (#119093) test(qa): prove overflow compaction pruning (#119033) fix(tool-search): preserve deferred MCP failures (#118363)
* 'main' of https://github.com/openclaw/openclaw: test(qa): cover sandboxed exec behavior (#119053) test(qa): prove shared-channel memory recall (#119111) fix(telegram): keep request deadlines through response bodies test(qa): cover gateway plugin approvals (#119128) fix(ai): keep OpenAI tool call id truncation UTF-16 safe (#110471) fix: preserve live updater failure diagnostics (#119096) fix: recover new-session models through Gateway startup (#119120) test(qa): cover instruction profile artifacts (#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (#119093) test(qa): prove overflow compaction pruning (#119033) fix(tool-search): preserve deferred MCP failures (#118363) fix(macos): keep setup activation within app checks test(setup): type provider kind fixture fix(setup): complete prepared model activation fix(protocol): regenerate Swift wizard models fix(ollama): activate the model selected during setup fix(setup): preserve the prepared model handoff
* origin/main: fix: preserve live updater failure diagnostics (openclaw#119096) fix: recover new-session models through Gateway startup (openclaw#119120) test(qa): cover instruction profile artifacts (openclaw#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (openclaw#119093) test(qa): prove overflow compaction pruning (openclaw#119033) fix(tool-search): preserve deferred MCP failures (openclaw#118363)
* 'main' of https://github.com/openclaw/openclaw: test(qa): cover sandboxed exec behavior (openclaw#119053) test(qa): prove shared-channel memory recall (openclaw#119111) fix(telegram): keep request deadlines through response bodies test(qa): cover gateway plugin approvals (openclaw#119128) fix(ai): keep OpenAI tool call id truncation UTF-16 safe (openclaw#110471) fix: preserve live updater failure diagnostics (openclaw#119096) fix: recover new-session models through Gateway startup (openclaw#119120) test(qa): cover instruction profile artifacts (openclaw#119078) fix(telegram): record automatic delivery message ids test(qa): cover memory promotion safety (openclaw#119093) test(qa): prove overflow compaction pruning (openclaw#119033) fix(tool-search): preserve deferred MCP failures (openclaw#118363) fix(macos): keep setup activation within app checks test(setup): type provider kind fixture fix(setup): complete prepared model activation fix(protocol): regenerate Swift wizard models fix(ollama): activate the model selected during setup fix(setup): preserve the prepared model handoff
What Problem This Solves
Fixes an issue where operators and fleet automation could not identify the primary failure and rollback failure when the live updater raised a nested recovery error. The schema v1 result retained only the aggregate
codeandmessage, while invariant codes/details, command status, member roles, and the aggregate cause relationship were lost.Why This Change Was Made
Adds an optional, bounded
error.diagnosticsobject while preserving the existing schema version, exit status, single-JSON stdout contract, anderror.code/error.messagefields. Updater-owned aggregate producers assign semantic roles, command producers assign fixed low-cardinality operation labels, and invariant wrappers retain bounded typed causes.The formatter intentionally excludes nested messages, stacks, argv, environment, paths, PIDs, stdout, stderr, command output, and arbitrary error properties. Recursive aggregates are cycle-safe and bounded to four levels and eight members.
AI-assisted: yes.
User Impact
Fleet operators and automation can distinguish the primary updater failure from proof, cleanup, or rollback failures and can identify safe invariant and command categories without parsing stderr or exposing sensitive process data.
Evidence
Red reproduction base:
12beeb7b29476d0ac96590e51bbc14fff63fbe60Final refreshed canonical base:
5a1daf81a554a9ff63604700824ea074d301f9dbThe intervening canonical range did not touch the updater, its tests, or its script declaration surface.
Before, a synthetic primary invariant plus rollback command failure produced only:
{"schemaVersion":1,"ok":false,"error":{"code":"update_failed","message":"Gateway replacement failed and the previous managed service could not be restored"}}After, the same failure class retains additive diagnostics:
{ "schemaVersion": 1, "ok": false, "error": { "code": "update_failed", "message": "Gateway replacement failed and the previous managed service could not be restored", "diagnostics": { "kind": "aggregate", "members": [ { "role": "primary", "error": { "kind": "invariant", "code": "gateway_launchagent_failed", "details": { "exitTimeoutSeconds": 0 } } }, { "role": "rollback", "error": { "kind": "command", "operation": "launchd.bootstrap", "status": 23 } } ], "causeMember": 1 } } }ClawSweeper identified two sibling recovery-boundary gaps on earlier heads. The final head retains both
gateway.suspend.prepareand non-mac stopped-proofgateway.statuscommand failures as typed invariant causes, with a maintenance-path regression covering suspension failure followed by stopped-proof failure.Compatibility search:
openclaw-live-updater/scripts/update-main.mjs,formatUpdateFailure(, andmaintainMain(found only the updater test and its declaration module as consumers.error.diagnosticsis additive and optional from a consumer perspective.Validation:
node scripts/run-vitest.mjs test/scripts/openclaw-live-updater.test.ts: 72 passed.23and stopped-proofgateway.statusstatus29, while excluding secret stderr and the entrypoint path.node scripts/check-changed.mjs -- <touched files>: all fail-safe lanes passed on trusted-source AWS runrun_70aefa702113, including all-project typecheck, full lint, script declarations, formatting, and import-cycle checks. The wrapper then attempted a duplicate local fallback because its portal summary handoff timed out; that expensive duplicate was stopped during typecheck per proof-routing policy.gateway.suspend.prepareplus status23; secret stderr, proof text, and the entrypoint path were absent.30879914876: successful.