Skip to content

fix(triage): stop reporting failed updates as resolved - #153443

Merged
steipete merged 3 commits into
mainfrom
upd/repair-lifecycle-self-contention
Sep 20, 2026
Merged

steipete merged 3 commits into
mainfrom
upd/repair-lifecycle-self-contention

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: plain openclaw triage --run can report “already resolved” for a failed update, or keep rejecting a healthy installation after successful recovery followed by another upgrade or rollback.

Fixes #153378. Thanks to @johnnyjrizzo for the report and recovery evidence.

User Impact

Triage keeps unresolved updates and pending plugin migrations visible, with update repair guidance for post-update recovery. A later successful recovery or upgrade can clear a historical failure after the current installation is verified; a subsequent verified rollback to that recovered version preserves the resolution. Acknowledging an abandoned run still requires fresh Doctor validation, so current configuration errors remain visible. Historical ledger records are preserved.

Why This Change Was Made

The resolution owner now selects and validates ledger history in one place. Plain triage accepts a later successful update or verified rollback restoring the same or a newer version, then validates the current package or Git installation, Doctor findings, and managed Gateway readiness. A rollback uses its own recorded previous/restored identity and completed package-restoration step; it does not reuse an older failure's previous version. Explicit failure artifacts retain strict checks against their original target. Previews and acknowledged abandoned runs cannot hide a failure or replace completion evidence; pending migrations are checked before and after validation.

Refs #153377 (investigated, not reproduced), #153147, and #153261. Adopted repair already uses the coordinator release handoff in published 2026.9.5 and current source. No custody or lifecycle changes are included here; the contention report remains open pending lock-holder evidence.

Evidence

  • 300 focused tests passed across seven files: triage command, failure artifacts, recovery/target handling, resolution owner, and real SQLite ledger. The follow-up regressions failed before the repair for failed A → successful A → successful B and acknowledged abandonment with current Doctor errors. Additional failing-before cases cover generic update-failed history and Git-to-package upgrades. The newest command regression failed with exit 1 before this fix for failed A → successful A → later verified rollback to A; it now reports “Rollback to …” and verifies the restored installation. Missing restoration, inconsistent before/after identity, and an explicit artifact tied to the older failure still reject. Pending migrations and newer previews remain covered.
  • Full pnpm check:changed passed, including production/test types, all three unused-export scans, changed-file lint, storage/runtime guards, and zero runtime import cycles. git diff --check passed. No gate was skipped.
  • Fresh P1 autoreview: scoped-clean on the staged complete PR candidate, including the new rollback fix; no accepted/actionable P0/P1 findings.
  • Retained macOS PTY proof from b7b5085e5d8ebe543859554be1cbc66495eabd62: isolated state created by the integrity-verified published npm 2026.9.5 ledger was consumed through pnpm openclaw triage --run. No Gateway was started or modified. This earlier live proof covers the unchanged pending-migration and missing-completion refusal behavior; it was not rerun on this follow-up head. The new historical-recovery behavior is covered by the current command-level regressions above.
Published-state fixture Captured candidate result
Failed finalize:doctor, pending Codex migration, no restart sentinel Exit 1; Embedded repair unrepaired, pending Codex warning, and visible openclaw update repair guidance. The failed row and pending migration remain intact; no inference turn starts.
Same failed finalization, followed by a newer skipped/dry-run row; no pending migration Exit 1; reports that the updater has not recorded completed resolution and points to update repair. The preview and older failure remain intact; no inference turn starts.

The retained PTY cells took 621.5 s and 536.6 s including source builds, artifact-lock waits, and diagnostics; these are correctness results, not startup benchmarks. Initial harness attempts overlapped source builds and omitted the required TTY; those attempts are not counted as passing proof.

Rollback follow-up production +6/−3 (net +3); tests +35/−6 (net +29); docs +1/−1. Complete PR production +147/−170 (net −23); tests +346/−148 (net +198); docs +4/−4. No configuration/CLI options, environment variables, SQLite schemas, dependencies, or baselines changed.

Landing review disposition

All three confirmed ClawSweeper findings are fixed in cbd5f52:

  • Stop resolved historical failures from blocking later upgrades — fixed at cbd5f52. Implicit history selection belongs to the resolution owner. A later successful same-or-newer update supplies the current installation target, including installation-kind changes and generic failure reasons. Explicit artifacts retain strict target validation. The failed A → successful A → successful B command regression accepts healthy B and verifies B's version.
  • Validate current Doctor health after abandonment acknowledgement — fixed at cbd5f52. Acknowledgement clears the historical blocker and continues fresh Doctor validation, followed by ownership and pending-migration checks. The retained-notification regression with current Doctor errors reports those errors and exits nonzero without claiming “already resolved.”
  • Preserve settled recovery across a later verified rollback — fixed at cbd5f52. The reader already supplies the latest terminal rollback. The resolution owner now accepts that qualifying restored identity as implicit completion and verifies the rollback's own previous/restored identity and completed restoration, then checks the current runtime, Doctor, and Gateway. The old failed row remains historical evidence; it no longer supplies the wrong pre-rollback version or target. The full command regression and negative restoration/explicit-artifact cases pass. No schema, sentinel, or additional history-selection policy was introduced.

Final maintainer disposition

The ClawSweeper review updated September 20, 2026 at 09:13 UTC reviewed cbd5f52, confirms all three prior findings are addressed, and reports no additional actionable correctness or security defect. It lists no further Rank-up moves.

The remaining compatibility decision is accepted under the explicit maintainer landing direction: retain the documented updater-completion requirement. Healthy Doctor results alone must not turn recorded incomplete recovery into an “already resolved” verdict. The operator receives openclaw update repair guidance; published-state CLI evidence and current command regressions support that behavior. Historical records remain intact, and no schema or lifecycle ownership change is introduced.

ClawSweeper revision 6 (09:35 UTC, same head) confirms the compatibility choice is settled and adds a request to confirm data-model compatibility proof. Confirmed using the existing published-state proof: the isolated macOS PTY cells consumed ledger state created by published npm 2026.9.5, preserved failed rows and pending migrations, and returned truthful unrepaired results through the real triage command. The PR changes read-only history selection and resolution validation; it does not change a SQLite schema, rewrite stored records, or introduce a migration/backfill. Current command regressions cover subsequent successful upgrades, verified rollback, and acknowledgement with current Doctor errors. No additional data-model migration is applicable.

Use recorded failure and completion evidence across newer previews, retain pending migration warnings, and keep recovery guidance visible. Fixes #153378. Thanks to @johnnyjrizzo for the report.
@clawsweeper

clawsweeper Bot commented Sep 20, 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 docs Improvements or additions to documentation commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 05:13
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 20, 2026, 5:35 AM ET / 09:35 UTC (Revision 6).

ClawSweeper review

What this changes

Triage checks update history and pending migrations before reporting recovery, while recognizing later successful upgrades and verified rollbacks.

Merge readiness

⛔ Blocked before merge - 1 item remains

The fix remains necessary on current main. All three prior findings are addressed, and the recorded maintainer disposition settles the compatibility choice. No additional actionable correctness or security defect was found.

Priority: P2
Reviewed head: cbd5f52a2e9f68eb239650407e1b93f8c2f67d9f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant production-path evidence, meaningful regression coverage, and no remaining actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Recorded macOS PTY runs exercised the actual triage command against published 2026.9.5 ledger state and observed truthful refusal with preserved records. That earlier-head proof remains applicable to the unchanged refusal paths; current upgrade, rollback, and acknowledgement fixes are supported by inspected command regressions, not a claimed new live run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Recorded macOS PTY runs exercised the actual triage command against published 2026.9.5 ledger state and observed truthful refusal with preserved records. That earlier-head proof remains applicable to the unchanged refusal paths; current upgrade, rollback, and acknowledgement fixes are supported by inspected command regressions, not a claimed new live run.
Evidence reviewed 8 items Current main still needs the fix: Fetched main still discards uncorrelated implicit update failures and falls through to Doctor-only validation when no failure context remains.
Latest release retains the reported path: The v2026.9.5 source also contains the uncorrelated-notification exclusion and Doctor-only fallback; the supplied related work does not establish a merged replacement for this fix.
Resolution owner and prior findings: The checker selects implicit history centrally, performs fresh Doctor validation after abandonment acknowledgement, accepts qualifying later completion, and checks a superseding rollback against its own previous/restored identity and completed restoration step.
Findings None None.
Security None None.

How this fits together

Triage diagnoses an OpenClaw installation and can run a bounded repair turn. Its resolution checker combines updater records, migration state, Doctor findings, installed runtime checks, and Gateway readiness to determine the recovery verdict.

flowchart TD
  A[Triage request] --> B[Resolution checker]
  C[Update history and saved failure] --> B
  D[Pending migrations] --> B
  B --> E[Doctor and installation checks]
  E --> F[Gateway readiness]
  F --> G[Recovery verdict and guidance]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -23, Tests +198, Docs 0. Total +175 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 147 170 -23
Tests 2 346 148 +198
Docs 1 4 4 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 497 322 +175

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/update-triage-resolution.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Retain the accepted updater-completion contract, verify the current recovered installation, and preserve historical failures without letting them pin future upgrades.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a failed ledger entry without a correlated restart notification reaches Doctor-only validation on current main. No runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes. The existing resolution owner now decides recovery consistently. Doctor-only recovery may require update repair under the explicitly accepted compatibility change.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 03e1d2043091.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This fixes misleading recovery verdicts in the bounded installation-triage workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Recorded macOS PTY runs exercised the actual triage command against published 2026.9.5 ledger state and observed truthful refusal with preserved records. That earlier-head proof remains applicable to the unchanged refusal paths; current upgrade, rollback, and acknowledgement fixes are supported by inspected command regressions, not a claimed new live run.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded macOS PTY runs exercised the actual triage command against published 2026.9.5 ledger state and observed truthful refusal with preserved records. That earlier-head proof remains applicable to the unchanged refusal paths; current upgrade, rollback, and acknowledgement fixes are supported by inspected command regressions, not a claimed new live run.

Evidence

What I checked:

  • Current main still needs the fix: Fetched main still discards uncorrelated implicit update failures and falls through to Doctor-only validation when no failure context remains. (src/commands/triage.ts:226, 03e1d2043091)
  • Latest release retains the reported path: The v2026.9.5 source also contains the uncorrelated-notification exclusion and Doctor-only fallback; the supplied related work does not establish a merged replacement for this fix. (src/commands/triage.ts:226, ec9c1a13db89)
  • Resolution owner and prior findings: The checker selects implicit history centrally, performs fresh Doctor validation after abandonment acknowledgement, accepts qualifying later completion, and checks a superseding rollback against its own previous/restored identity and completed restoration step. (src/infra/update-triage-resolution.ts:141, cbd5f52a2e9f)
  • Command-level regression coverage: Tests exercise missing notifications, 101 newer previews, unavailable history, pending migrations, later upgrades, verified rollbacks, invalid restoration, strict explicit artifacts, and acknowledged abandonment with current Doctor errors. These tests were inspected, not executed during this read-only review. (src/commands/triage-run.test.ts:104, cbd5f52a2e9f)
  • Retained production-path proof: The captured PR body records two macOS PTY runs through pnpm openclaw triage --run using state created by published npm 2026.9.5. Both returned exit 1 with truthful unrepaired guidance, preserved records, and no inference. This evidence belongs to the earlier head and covers the unchanged pending-migration and missing-completion refusal paths; subsequent historical-recovery changes have command-regression evidence. (b7b5085e5d8e)
  • Compatibility disposition: The supplied maintainer-authored PR body explicitly accepts requiring updater-recorded completion instead of Doctor-only recovery and documents update repair guidance. The previous completed review at the same head contains no findings or outstanding rank-up moves. This resolves the earlier human-choice blocker. Public docs: docs/cli/triage.md. (docs/cli/triage.md:74, cbd5f52a2e9f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-20T05:20:53.271Z sha b7b5085 :: blocked before merge. :: [P2] Stop resolved historical failures from blocking later upgrades | [P2] Validate current Doctor health after abandonment acknowledgement
  • reviewed 2026-09-20T06:39:12.212Z sha b7b5085 :: blocked before merge. :: [P2] Stop resolved historical failures from blocking later upgrades | [P2] Validate current Doctor health after abandonment acknowledgement
  • reviewed 2026-09-20T07:36:39.965Z sha 6954cd2 :: blocked before merge. :: [P2] Preserve settled failures across a later verified rollback
  • reviewed 2026-09-20T08:37:13.404Z sha 6954cd2 :: blocked before merge. :: [P2] Preserve settled failures across a later verified rollback
  • reviewed 2026-09-20T09:12:29.180Z sha cbd5f52 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 20, 2026
@steipete
steipete merged commit 1bbd60d into main Sep 20, 2026
230 of 231 checks passed
@steipete
steipete deleted the upd/repair-lifecycle-self-contention branch September 20, 2026 09:38
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
Plain triage could discard failed update history and report “already resolved” from healthy Doctor results. Centralize update-history selection and completion checks in the resolution owner, preserve pending plugin migrations, and keep explicit failure artifacts tied to their original targets.

Accept later successful upgrades and verified rollbacks after validating the current installation, Doctor results, and managed Gateway readiness. Abandoned-run acknowledgement still requires fresh Doctor checks. Incomplete recovery stays visible with update repair guidance; historical ledger records remain intact.

Fixes openclaw#153378. Thanks to @johnnyjrizzo for the report and recovery evidence.

Validation: 300 focused tests across seven files and full check:changed passed in the repair lane. Retained isolated macOS PTY proof with published 2026.9.5 ledger state confirms pending migrations and missing completion remain unrepaired; current command regressions cover the later recovery and rollback fixes. The review of record is scoped-clean and exact-head CI passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: triage --run ignores failed update without a correlated restart sentinel

1 participant