Skip to content

fix(update): clear repeated Doctor guidance after repair - #153261

Merged
steipete merged 1 commit into
mainfrom
upd/abandoned-run-acknowledgement
Sep 20, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/abandoned-run-acknowledgement

Conversation

@steipete

@steipete steipete commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Doctor repeatedly asks operators to run openclaw update repair for abandoned updates that repair cannot acknowledge because they are older than 30 minutes or are not the latest history record.

Fixes #153228. Thanks to @IWhatsskill for the source-cited report.

User Impact

After successful repair, Doctor stops repeating the repair instruction for outstanding abandoned runs in its latest 100 history records. Original failed outcomes and unknown target-build evidence remain intact. Live or possibly active updates remain protected, and failed repair leaves its outstanding history visible.

Why This Change Was Made

Repair now selects all unacknowledged abandoned history and passes those IDs to the existing successful-finalization acknowledgement loop. Terminal age only controls whether a fresh record can use the existing ledger-only shortcut; old history still requires full convergence. The existing reconcile:acknowledged step records the outcome, with no schema, options, dependencies, or watcher changes.

This does not depend on #153178 or duplicate its failed-finalization recovery observations. The lifecycle test file and nearby recovery docs may need a mechanical merge with that PR.

Evidence

  • Failing-before proof: the aged-run selection assertion and the real repair/finalizer/SQLite/Doctor regression both failed for the missing acknowledgement; 95 existing/control cases passed. Final focused proof: 233 tests passed across 8 files, including ledger readers, driver liveness, repair/finalization, Doctor, and Gateway watcher interruption coverage.
  • Isolated CLI proof used records created by the integrity-verified published npm 2026.9.5 ledger: two abandoned runs aged 2–3 hours behind a newer successful run. Candidate doctor --fix printed 2 abandoned-history instructions; candidate update repair --yes --json exited 0 (status: warning, plugin convergence ok, all seven phases completed); the next doctor --fix exited 0 with 0 abandoned-history instructions. Both rows retain failed/abandoned and their original finish times, with the existing acknowledgement step persisted. State and its pre-repair SQLite/config backup stayed inside the task worktree; no Gateway was started or modified.
  • The first CLI fixture disabled bundled-plugin discovery and failed post-plugin readiness, leaving both records unacknowledged. Restoring normal discovery produced a valid readiness report (35 checks, 0 findings) and successful repair. No product workaround was added; the final repair retained two nonfatal Doctor warnings.
  • Full node scripts/check-changed.mjs passed, including core/test typechecks, all three unused-export scans, lint, schema guards, and import-cycle checks. git diff --check passed. Fresh P1 autoreview: scoped-clean.

Production: +12/-10 (net +2). Tests: +74/-2 (net +72). Docs: +4. The fix changes repair selection and clarifies the freshness predicate; the reader, acknowledgement writer, Doctor reporting owner, and Gateway watcher remain unchanged.

Review disposition

ClawSweeper reviewed head 45afc7fe5d3123d8391781664d6ff3eeb0f7b622 at 2026-09-19 23:51 UTC and reported no correctness findings, security findings, before-merge actions, or Rank-up moves. No review changes or skips are needed. The existing finalization and ledger acknowledgement owners remain canonical.

Select all unacknowledged abandoned runs in Doctor's history window for
successful repair acknowledgement. Keep the freshness window only for the
ledger-only shortcut, preserving full convergence for older history and
liveness admission for running updates.

Preserve failed outcomes and missing target-build evidence while stopping
Doctor's repeated repair guidance. Thanks to @IWhatsskill for the report.

Fixes #153228
@clawsweeper

clawsweeper Bot commented Sep 19, 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 cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 19, 2026
@steipete
steipete marked this pull request as ready for review September 19, 2026 23:41
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 9:36 PM ET / September 20, 2026, 01:36 UTC (Revision 2).

ClawSweeper review

What this changes

Successful update repair acknowledges older abandoned updates in Doctor’s recent history so their repair instructions stop repeating, while preserving the original failure records.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix for a gap still present on current main. The supplied CLI evidence supports the intended outcome, and no actionable correctness or security defect was found.

Priority: P2
Reviewed head: 45afc7fe5d3123d8391781664d6ff3eeb0f7b622

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant real CLI evidence, meaningful regression coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured isolated CLI run exercises candidate repair and Doctor against published-2026.9.5 ledger state, showing two repeated instructions become zero after successful convergence while original failures remain; failed readiness leaves them visible.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured isolated CLI run exercises candidate repair and Doctor against published-2026.9.5 ledger state, showing two repeated instructions become zero after successful convergence while original failures remain; failed readiness leaves them visible.
Evidence reviewed 8 items Pinned change and current-main necessity: The introduced delta selects unacknowledged abandoned records from the latest 100 runs. Fetched main still selects active runs or only the newest fresh abandoned run, leaving older and nonlatest abandoned records unreachable.
Current-main implementation: Inspected the complete repair command at fetched main; its recovery selection retains the reported age/latest-record restriction.
Latest-release behavior: The latest supplied release, v2026.9.5, retains the 30-minute freshness predicate. The PR’s published-ledger fixture directly exercises recovery of records produced by that release.
Findings None None.
Security None None.

How this fits together

OpenClaw records update attempts in its SQLite history, which Doctor reads to provide recovery guidance. The repair command selects outstanding records and acknowledges them through the existing recovery and finalization owners.

flowchart TD
  A[Update history] --> B[Repair command]
  B --> C[Check active updater ownership]
  C --> D[Select outstanding abandoned runs]
  D --> E[Healthy Gateway shortcut or full finalization]
  E --> F[Record successful acknowledgement]
  F --> G[Doctor omits resolved guidance]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +72, Docs +4. Total +78 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 10 +2
Tests 2 74 2 +72
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 90 12 +78

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #153228
Summary: This PR is a candidate fix for the reported acknowledgement-selection defect; another open PR targets the same defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep history selection aligned with Doctor’s reporting window and record successful recovery through the existing acknowledgement owner without erasing historical failures.

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

Yes: current-main source establishes that older, nonlatest abandoned records remain visible to Doctor but are omitted from repair acknowledgement. This review did not execute the reproduction.

Is this the best way to solve the issue?

Yes: the patch repairs selection at the existing command owner, retains freshness checks for the shortcut, and reuses established finalization and persistence behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repeated recovery instructions create persistent operator confusion, but the linked report observes no functional outage.
  • 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 (live_output): The captured isolated CLI run exercises candidate repair and Doctor against published-2026.9.5 ledger state, showing two repeated instructions become zero after successful convergence while original failures remain; failed readiness leaves them visible.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured isolated CLI run exercises candidate repair and Doctor against published-2026.9.5 ledger state, showing two repeated instructions become zero after successful convergence while original failures remain; failed readiness leaves them visible.

Evidence

What I checked:

  • Pinned change and current-main necessity: The introduced delta selects unacknowledged abandoned records from the latest 100 runs. Fetched main still selects active runs or only the newest fresh abandoned run, leaving older and nonlatest abandoned records unreachable. (src/cli/update-cli/update-repair-command.ts:104, 45afc7fe5d31)
  • Current-main implementation: Inspected the complete repair command at fetched main; its recovery selection retains the reported age/latest-record restriction. (src/cli/update-cli/update-repair-command.ts:153, c53eaf550972)
  • Latest-release behavior: The latest supplied release, v2026.9.5, retains the 30-minute freshness predicate. The PR’s published-ledger fixture directly exercises recovery of records produced by that release. (src/infra/update-run-activity.ts:106, ec9c1a13db89)
  • Success-only acknowledgement: The unchanged finalizer acknowledges selected records only after non-error convergence and rejects selected runs that resumed. The existing transactional ledger writer adds the acknowledgement step without replacing the failed outcome or finish time. (src/cli/update-cli/update-command-finalize.ts:434, 45afc7fe5d31)
  • Meaningful regression coverage: The added success/failure cases exercise the repair handler, real finalizer, SQLite ledger, and Doctor reporting with external operations mocked. They verify preserved failure records and that failed repair leaves both instructions visible. Existing tests cover live and unobservable drivers, continuation identity, and resumed updates. Tests were inspected, not executed during this read-only review. (src/cli/update-cli/update-command-lifecycle.test.ts:287, 45afc7fe5d31)
  • Captured real CLI evidence: The supplied PR body, captured under sourceRevision 3e03b021b696b977855b420f847ff291d1f148cb494b182922e3f25f82668bcc, describes isolated published-2026.9.5 ledger records aged 2–3 hours behind a newer success. Candidate Doctor displayed two instructions; candidate repair exited zero with successful convergence; subsequent Doctor displayed zero. Both original failures and finish times remained intact. A failed readiness attempt left both records unacknowledged. (45afc7fe5d31)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-19T23:51:01.759Z sha 45afc7f :: needs maintainer review before merge. :: none

@steipete
steipete merged commit b1c062d into main Sep 20, 2026
285 checks passed
@steipete
steipete deleted the upd/abandoned-run-acknowledgement branch September 20, 2026 02:08
@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 20, 2026
…153261)

Repair now acknowledges outstanding abandoned updates in Doctor's latest 100 history records, including aged runs behind newer updates. Doctor stops repeating resolved repair guidance while the original failed outcomes, finish times, and unknown target-build evidence remain intact.

The repair command selects the outstanding records and delegates acknowledgement to the existing successful-finalization owner. Aged records still require full convergence; active updater admission and failed-repair behavior remain protected.

Thanks to @IWhatsskill for the source-cited report in openclaw#153228.

Validation: 233 focused tests across 8 files; changed-file checks; isolated CLI repair against records from the published 2026.9.5 ledger reduced Doctor guidance from two instructions to zero while preserving historical failures. Campaign autoreview was scoped-clean and exact-head CI passed.
steipete pushed a commit that referenced this pull request Sep 20, 2026
Successful update repair now reports the historical run IDs whose acknowledgments were newly recorded, while preserving failed outcomes. The existing ledger writer returns whether it inserted the acknowledgment, and both repair paths use that result for JSON reporting.

Additional captured historical candidates go through the existing full finalizer. The captured 100-row history, 30-minute lightweight boundary, and live-updater protections remain intact. No schema, configuration, CLI option, or dependency changes.

Thanks to @IWhatsskill for the original report and discussion.

Validation: 235 focused tests across seven affected files and 1,183 routing tests passed on an isolated Testbox; scoped-clean Codex review and exact-head CI passed. Published-driver/candidate maintenance recovery remains a documented validation gap.

Related: #153228. Complements the historical-selection fix in #153261.
Co-authored-by: IWhatsskill <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
…53291)

Successful update repair now reports the historical run IDs whose acknowledgments were newly recorded, while preserving failed outcomes. The existing ledger writer returns whether it inserted the acknowledgment, and both repair paths use that result for JSON reporting.

Additional captured historical candidates go through the existing full finalizer. The captured 100-row history, 30-minute lightweight boundary, and live-updater protections remain intact. No schema, configuration, CLI option, or dependency changes.

Thanks to @IWhatsskill for the original report and discussion.

Validation: 235 focused tests across seven affected files and 1,183 routing tests passed on an isolated Testbox; scoped-clean Codex review and exact-head CI passed. Published-driver/candidate maintenance recovery remains a documented validation gap.

Related: openclaw#153228. Complements the historical-selection fix in openclaw#153261.
Co-authored-by: IWhatsskill <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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: S 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]: update repair cannot acknowledge abandoned runs older than 30 minutes, so Doctor repeats unactionable guidance

1 participant