Repository navigation
fix(update): retain finalization failure reasons in reports - #147286
Conversation
|
🦞👀 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. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 3:44 PM ET / 19:44 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserves finalization failure reasons, installation type, and redacted diagnostics in update history and failure reports, while distinguishing standalone package finalization from parent-owned rollback. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful reporting fix absent from current main and the latest release. No blocking code or security findings remain; the documented maintainer disposition addresses the previous review’s proof request. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s update finalizer runs Doctor and plugin maintenance, recording outcomes in the update ledger. Status views and user-reviewed failure reports consume those records to explain failures and recovery outcomes. flowchart TD
A[Update finalization] --> B[Doctor and plugin maintenance]
B --> C[Record failure reason and diagnostics]
A --> D[Standalone or parent-owned run]
D --> C
C --> E[Existing update ledger]
E --> F[Matching-run report preparation]
F --> G[Redacted report preview]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +80, Tests +192, Docs +7. Total +279 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep failure facts in the existing ledger and derive reports from the matching run without implying package rollback or Gateway health that was never observed. Do we have a high-confidence way to reproduce the issue? Yes, from source: a finalization failure without an explicit terminal reason loses its cause on current main, and the report path lacks matching-run reason enrichment. Reporter evidence and the submitted regressions corroborate it; no runtime reproduction was executed here. Is this the best way to solve the issue? Yes. The patch repairs the existing producer-to-ledger-to-report path, preserves explicit outcomes, and keeps diagnostics bounded without introducing another storage or recovery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9d5615cee1c7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…#147286) * fix(update): retain finalization failure reasons in reports Record finalization reason and install facts before triage, preserve explicit parent outcomes, and report the recognized Doctor cause with an explicit standalone package rollback non-outcome. Refs openclaw#147160, openclaw#146514. Reported by @Navras98 (openclaw#147160). * chore: refresh finalization report CI
Related: #147160, #146514
What Problem This Solves
Failed update finalization could record
reason: null, leaving status and the generated issue with an unknown cause, install kind, and rollback outcome even though Doctor's error was available.Reported by @Navras98 (#147160).
User Impact
Finalization failures retain the failing check's code (or phase name), and the reviewed report shows the first recognized diagnostic line instead of an unknown exit. Standalone package finalization records that package rollback is unnecessary because it does not replace the core package. This makes no claim that Doctor left config/state unchanged or that Gateway health was verified.
Why This Change Was Made
The finalization lifecycle now records the reason atomically with its failed step; terminal failure preserves it when the parent supplies no explicit reason. The CLI finishes the admitted run before triage and uses that same run ID for reporting. Common report preparation consumes only matching ledger facts and preserves explicit result reasons, measured package-manager modes, and verified recovery outcomes.
Install classification uses the existing package/Git detector once. Durable reports use that install kind when no measured npm/pnpm/bun mode is available. An explicit skipped step records the package rollback non-outcome only for standalone package finalization. Inherited runs and post-core children, including the published 2026.9.3 marker without a run ID, leave rollback with their parent.
Removed paths: duplicate install-kind probes, the unrelated standalone report identity, and the hardcoded CLI reason that masked the ledger. Production delta: +80 lines; the added code carries facts through the existing ledger/report owners. No schema, retention, dependency, config, or activation changes. The maintenance refusal itself remains owned by #146514.
Evidence
Regression tests were run unchanged against the original production code by saving and reversing only the production diff, then reapplying it (no stash). The CLI/ledger run failed 13 tests: null reasons across every finalization phase and an interactive preview with unknown mode and
unexpected-error. The report-only regression separately failed becauseReason code: doctor-failedwas absent.Candidate focused proof: all 194 tests passed across finalization, command/interactive reporting, fresh Doctor handling, diagnostic redaction, and the durable ledger.
Coverage includes thrown Doctor refusals, returned plugin failures, every
finalize:*phase, parent reason precedence, matching run identity, private diagnostic suffix removal, and post-core children with/without a run ID.pnpm check:changed: passed (including core and test typechecks, targeted lint, schema and import-cycle guards).Independent Codex autoreview at P2: scoped-clean after fixing a pre-ledger stderr redaction finding; the emitted-record regression covers the correction.
Original CI: run 34775810071 reported an unrelated failure in checks-node-compact-small-32:
test/scripts/test-projects.test.ts:1044expects five QA Profile Evidence targets, but routing also returnstest/scripts/qa-profile-run-status.test.ts. The CI run is completed with failure; the other observed checks passed, with no cancellations. No unrelated source change was added to this PR. The CI checkout is merge6533953c02859c524e42f98415ac6e949efd2639, with parents main0afc02335308892d7efa3ccf7d981e912c6dd238and this head9be5afeee9e1f106dd708cc97e25760a92a2009f. GitHub's parent-to-merge comparison contains only this PR's 11 files; the failing routing owner and test are unchanged.Refresh CI: run 34778204511 completed successfully for
af563f73427fc9e8a5fb303f38deaf210bae5da9. The exact-head watcher returnedGREEN; no failed or cancelled jobs required a retry. The empty refresh is tree-identical to the reviewed head. Its observed checkout is272ef4ef64b19c9a499ec2e440902421661c9819, with mainc08d8406c28baddbc2ff2b7a80a284c839b24e3fas its first parent; that parent contains the routing correction.Limitations: synthetic isolated-state proof, not a live npm update or Gateway restart. The published-driver contract was checked at the 2026.9.3 tag and exercised through its handoff markers; no full published-package installation matrix was run. Existing historical runs cannot recover facts that were never recorded, and existing diagnostic size limits still apply.
ClawSweeper review
Latest reviewed head:
af563f73427fc9e8a5fb303f38deaf210bae5da9(19:44 UTC), tree-identical to the approved code at9be5afeee9e1f106dd708cc97e25760a92a2009f. No code or security findings were identified, so no code fixups were needed. The maintainer accepted the existing regression, handoff-marker, and report-boundary evidence for this reporting-only repair; the requested full published-updater × candidate execution remains a documented proof gap. This change does not alter package replacement, Doctor admission, parent recovery, or Gateway activation. The generic data-model compatibility reminder does not require a migration here: this patch adds no schema, storage format, retention, or recovery changes. No re-review was requested by this lane because the code is unchanged; ClawSweeper refreshed its review automatically.