Repository navigation
fix(update): retain ledger phases in failure reports - #144281
fuller-stack-dev merged 8 commits into
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. |
…eflight # Conflicts: # src/cli/update-cli/update-command-report.test.ts # src/infra/update-failure-report-prepare.ts
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 12:02 AM ET / 04:02 UTC (Revision 8). ClawSweeper reviewWhat this changesThe interactive update-failure report includes sanitized failed phases from the same attempt’s stored history while preserving measured exit codes and lifecycle order. Merge readiness✅ Ready for maintainer review This remains a useful, well-supported repair: current main and v2026.9.4 still omit ledger-only failures from the CLI report. Earlier findings are resolved, and no new blocking defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe update CLI receives a final update result and offers operators a sanitized failure report. This change supplements compact results with existing SQLite run history before preview and explicit submission consent. flowchart TD
A[Final update result] --> D[Prepare failure report]
B[Selected state directory] --> C[Read same-attempt history]
C --> D
D --> E[Bound and redact failed phases]
E --> F[Operator previews report]
F --> G{Confirm submission}
G --> H[Submit or cancel]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +58, Tests +114. Total +172 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep failure-report enrichment in the existing report owner, using read-only same-attempt history without changing update execution, stored data, or submission consent. Do we have a high-confidence way to reproduce the issue? Yes: current main's report builder consumes only result.steps, so a compact empty result omits same-attempt ledger failures. The supplied real CLI/SQLite traces demonstrate the report-path repair; this read-only review did not execute code. Is this the best way to solve the issue? Yes: the patch reuses the canonical reader and existing redaction/consent flow, preserving measured exits and recorded order without introducing another storage owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 67e68e9b5801. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review at head d0cac57 (source review plus hosted CI; nothing executed locally). The production change is right: main's One cleanup before landing: |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer review and conflict repair completed for this atomic-update remediation component.
The prepared tree is Release-note impact: retain same-attempt lifecycle failure phases in managed-update reports when the handoff omits them. Fixes #144280. |
|
Updated landing status for signed head Merged main
The old run's complete failures were where-chip max-lines, unused cloud-target exports, cursor policy, and a native Bash iterator-close timeout. The earlier cache-retention timeout cause remains unproven. Passing controls do not waive hosted failures; no deadline, assertion, budget, or unrelated source was changed. Exact-head CI run 34671559894 is now pending. Native preparation and landing require its green result. This changes diagnostics only, not updater execution or a published driver's first attempt. No deployment or scheduler action. Exact-head CI continuationAttempt 1 completed with all earlier failures cleared. One new failure remained: large-16 hit the existing three-second no-output deadline in the verified-CLI invocation fixture. Its test and execution sources match the PR base and current main. An unchanged focused control passed both invocation cases, in 240 ms and 117 ms. This does not establish the hosted timeout cause. Requested one targeted retry of that failed job and its dependent gate, preserving the original shard order and exact head. No blanket rerun, source change, or deadline/assertion adjustment. Attempt 2 is pending; native landing remains gated. Final qualificationAttempt 2 passed on the same signed head. The targeted job passed 3,577 tests with four skipped, including the invocation fixture in 718 ms and 332 ms at its original deadline. All 168 checks are successful, 43 skipped, with none pending or failed. Fresh exact-head ClawSweeper found no actionable defect. Native preparation and merge verification both passed. Landing has not yet been dispatched. The earlier timeout cause remains unproven; original failure evidence is retained. |
|
Merged via squash.
|
Merge main while retaining bounded owner-recorded diagnostics through the ledger and public report. Restrict command-derived error codes and public messages, preserve Doctor requirements, and share the report projection. Absorb runtime-preflight metadata from #144923 and same-attempt ledger ordering from #144281 through the existing failureFacts contract. Co-authored-by: zhang-guiping <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Update failures could lose the check and underlying cause while passing through Doctor output, ledger history, restart handoffs, and public report preparation. Record bounded failure facts at the existing producers and carry them through those contracts. Human summaries, openclaw update status --json, and reviewed GitHub reports now preserve the initiating failure alongside recent recovery failures. Public reports project source-owned identifiers and recognized causes through the shared privacy boundary, redacting private values before preview and submission. The canonical Doctor lint parser preserves the underlying requirement before log truncation. Optional diagnostic fields leave schema versions, retention, recovery policy, configuration, and protocol versions unchanged. Fixes #144945 Refs #145252 #144923 #144281 #145321 Supersedes #144923's separate errorDetails path while preserving its runtime facts. Thanks to @zhangguiping-xydt and @vincentkoc for the adopted runtime-preflight code. Retains #144281's same-attempt ledger ordering (thanks to @jason-allen-oneal) and #145321's orthogonal settlement correction. Regression proof covers all six fact families, Doctor cause retention, public preview/submission redaction, mutable private plugin metadata, and summary selection. The recorded readyz failure survives replay through the reviewed local/public renderer. The main integrations preserve the existing build-identity comparison, snapshot-capacity fields, typed refusals, and canary plumbing alongside failure facts. A fresh full-branch P1 autoreview of the final integration is scoped-clean. ClawSweeper's prior privacy and Doctor-cause findings are resolved; no landing fixups were needed. The maintainer accepted this bounded reporting repair with recovery qualification still unproved. The published-driver upgrade passed, but baseline restoration and same-schema rollback timed out; those results remain updater-owner follow-ups and are not claimed as successful recovery proof. Exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/34687654108/attempts/1. No rerun was needed. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: zhang-guiping <[email protected]>
* fix(update): retain ledger phases in failure reports * style(update): format merged report module * fix(update): preserve unknown ledger-only failure exits * test(update): use complete ledger report fixture --------- Co-authored-by: Jason (Json) <[email protected]>
…aw#145390) Update failures could lose the check and underlying cause while passing through Doctor output, ledger history, restart handoffs, and public report preparation. Record bounded failure facts at the existing producers and carry them through those contracts. Human summaries, openclaw update status --json, and reviewed GitHub reports now preserve the initiating failure alongside recent recovery failures. Public reports project source-owned identifiers and recognized causes through the shared privacy boundary, redacting private values before preview and submission. The canonical Doctor lint parser preserves the underlying requirement before log truncation. Optional diagnostic fields leave schema versions, retention, recovery policy, configuration, and protocol versions unchanged. Fixes openclaw#144945 Refs openclaw#145252 openclaw#144923 openclaw#144281 openclaw#145321 Supersedes openclaw#144923's separate errorDetails path while preserving its runtime facts. Thanks to @zhangguiping-xydt and @vincentkoc for the adopted runtime-preflight code. Retains openclaw#144281's same-attempt ledger ordering (thanks to @jason-allen-oneal) and openclaw#145321's orthogonal settlement correction. Regression proof covers all six fact families, Doctor cause retention, public preview/submission redaction, mutable private plugin metadata, and summary selection. The recorded readyz failure survives replay through the reviewed local/public renderer. The main integrations preserve the existing build-identity comparison, snapshot-capacity fields, typed refusals, and canary plumbing alongside failure facts. A fresh full-branch P1 autoreview of the final integration is scoped-clean. ClawSweeper's prior privacy and Doctor-cause findings are resolved; no landing fixups were needed. The maintainer accepted this bounded reporting repair with recovery qualification still unproved. The published-driver upgrade passed, but baseline restoration and same-schema rollback timed out; those results remain updater-owner follow-ups and are not claimed as successful recovery proof. Exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/34687654108/attempts/1. No rerun was needed. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: zhang-guiping <[email protected]>
Closes #144280
What Problem This Solves
Fixes an issue where operators reporting a failed managed update could receive an empty
stepslist even though the same update attempt’s durable ledger retained failed activation and rollback phases. The interactive “Report update failure” flow is the affected surface, and the missing phases make an outage harder to diagnose and recover.Why This Change Was Made
The report builder now reads the canonical ledger for the same attempt when the compact handoff result omits phases, merges only failed durable lifecycle steps not already present, bounds and redacts them using existing report rules, and falls back safely if the ledger is unavailable or locked. No schema, configuration, database, or updater ownership behavior changes.
User Impact
Operators get failure reports that preserve actionable activation and rollback phase names rather than publishing
steps: []. Existing compact-result behavior remains compatible, and sensitive command, path, and detail text stays redacted.Evidence
Current-head proof and results are below. The prior ledger-only
exit 1preview is superseded by the correctedexit unknowntrace.Related but distinct: #139082 covers startup timing, #142744 is a Darwin/npm unsafe-handoff auto report, and #143767 covers human-readable warning retention.
Evidence: exact-head report preview
Tested HEAD:
d0cac57175998799f61cccff09f3333bbc19cca8Review correction
Addresses the ledger-only exit-code finding. Durable steps record failure status, not a process exit code, so the adapter now preserves
nulland the existing renderer showsexit unknown. Direct results still retain their actual code; the overlap regression verifies an observedexit 7appears once.Real behavior proof
Surface: the production CLI
runInteractiveUpdateFailureAction()entry point, its real Clack selection/confirmation prompts, realgetUpdateRun()SQLite reader, and real report preparation. A standalone harness seeds synthetic state with the production ledger APIs and invokes the same report action used by the updater. It does not mock the prompts, ledger, formatter, or transport. This is report-action proof, not a full update/install run.Environment: Linux x64, Node 24.19.0, source checkout at the full HEAD above. SQLite is a real
state/openclaw.sqlitefile (schema version 17); the writer is closed before entering the report action. The compact update result hassteps: []. The selected and ambient state directories contain the same attempt ID but different failed phases, demonstrating that the preview uses the admitted state scope rather than ambient state.Before: identical harness on
577a5a820b82c0d7716c67ca4d667ae37507e9dbproducedexit 1for activation and package rollback. The expected-unknown assertion failed (exit 1). The regression suite reproduced the same error (1 failed, 35 passed).After: on
d0cac57175998799f61cccff09f3333bbc19cca8, select Report update failure, then No at submission confirmation. Recorded output:The preview contained neither the ambient decoy nor synthetic private ledger detail. No GitHub issue was submitted. Both before/after used the same unchanged harness (SHA-256
014e91e520fb5a848c35c123ae386423832dcf67b513199916358424dc52df05).Exact executed command (from the pinned source checkout, in a PTY; input Down+Enter, then
n+Enter):script -q -e -c 'env -i PATH=/home/rev/.openclaw/tools/node-v24.19.0/bin:/usr/bin:/bin TERM=xterm-256color LANG=C.UTF-8 OPENCLAW_HOME=/tmp/openclaw-144281-readiness-20260910/green OPENCLAW_STATE_DIR=/tmp/openclaw-144281-readiness-20260910/green/ambient-state node --import ./scripts/tsx.mjs /tmp/openclaw-144281-readiness-20260910/preview.mts /tmp/openclaw-144281-readiness-20260910/green' /tmp/openclaw-144281-readiness-20260910/green-preview.ansiAdditional checks: 50 tests passed on the committed head (36 report-preparation + 14 CLI consent/report tests), targeted type-aware lint exit 0, formatter and
git diff --checkclean. Independent scoped autoreview (P0–P2) was clean. Test command:OPENCLAW_VITEST_MAX_WORKERS=1 node --import ./scripts/tsx.mjs scripts/test-projects.mts src/infra/update-failure-report-prepare.test.ts src/cli/update-cli/update-command-report.test.tsNot exercised: actual package installation, managed-service activation/rollback, packaged-binary execution, or GitHub issue submission. The report action uses real isolated SQLite data and terminal interaction; tests cover the additional direct-result precedence and consent branches.
Complete standalone proof harness
Save as
preview.mtsat the path used in the command above. It creates only synthetic isolated state.Maintainer integration evidence
Signed head
845603b266f269d45b199dcf851919573603e24eincorporates landed inherited CI repairs from main while preserving the contributor ancestry and four-file report patch. 103 focused tests and native changed-source checks pass. Real CLI/SQLite red-green and missing/corrupt-store proof remains preserved. Current evidence, timing limitations, and exact-head CI.This is report enrichment, not update execution or live deployment. An already-installed older updater cannot gain these diagnostic improvements before installing them. Native landing remains conditional on exact-head required checks.