Skip to content

fix(update): report configuration failures during repair - #144819

Merged
fuller-stack-dev merged 2 commits into
mainfrom
fix/update-repair-runtime
Sep 15, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
fix/update-repair-runtime

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Small follow-ups: #147547 separates repair turns; #147584 adds the delegated worker receiver; #147608 isolates local route setup; #147645 keeps delegated repair turns under updater ownership.

What Problem This Solves

Update repair incorrectly tells users to check model setup when loading the copied configuration fails.

User Impact

Repair reports the actual configuration or database error. Genuine model-selection failures keep their existing guidance.

Why This Change Was Made

The blanket catch arrived with the original repair loop in #138673, which introduced structured repair outcomes; no catch-specific rationale was recorded. The inner inference selector still handles model/auth failures. Config errors now reach the existing outer handler, which redacts and bounds the reason and returns aborted. Both aborted and unavailable prevent activation; cancellation and environment cleanup remain intact. Manual triage still fails, but shows the config error instead of suggesting onboarding. The migrated-runtime fix is already on main via #145044.

Evidence

The future-schema regression fails on main and passes with this fix. All 27 focused runtime, repair-loop, and inference tests passed again during the catch-provenance audit on d86aeec3c572; independent P0–P2 review is clean. Changed checks pass. The updater patch is unchanged after rebasing onto main, which now includes the independently merged Reef clock-fixture fix #147551; exact-head CI passes.

@clawsweeper

clawsweeper Bot commented Sep 11, 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: M maintainer Maintainer-authored PR labels Sep 11, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review September 11, 2026 09:35
@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. 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 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 11:08 PM ET / September 15, 2026, 03:08 UTC (Revision 17).

ClawSweeper review

What this changes

Update repair reports configuration and database failures through its existing error handler and adds a regression test for an unsupported database schema.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main and v2026.9.4 still replace configuration failures with misleading model guidance. No actionable correctness or security findings remain in the narrowed patch; the latest qualification addresses the relevant diagnostic behavior.

Priority: P2
Reviewed head: ccd812c86fc06498d8bb30e5d91d40a7917c4886

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused simplification with meaningful regression coverage, relevant qualification, and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor gate does not apply to this MEMBER-authored diagnostic fix, and no authority change triggers additional proof. The captured integrated-head qualification exercises the production configuration loader and repair loop with a real database refusal, model failure, and cancellation; broader worker and published-driver claims concern the separated scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor gate does not apply to this MEMBER-authored diagnostic fix, and no authority change triggers additional proof. The captured integrated-head qualification exercises the production configuration loader and repair loop with a real database refusal, model failure, and cancellation; broader worker and published-driver claims concern the separated scope.
Evidence reviewed 7 items Introduced change and review continuity: The local merge-base comparison matches the supplied two-file patch. Comparing the previous reviewed head d86aeec with the checkout produced no differences in either changed file. The previous completed review retained no findings.
Current main still has the defect: The fetched main implementation catches configuration loading failures and substitutes the generic instruction to check model setup.
Latest release comparison: The source at the supplied v2026.9.4 release commit also contains the blanket catch. GitHub contents inspection succeeded after the local release-blob read failed.
Findings None None.
Security None None.

How this fits together

Update repair loads the target installation’s configuration before selecting an inference route. Its repair loop reports failures to update orchestration and manual triage, while callers retain validation and activation decisions.

flowchart TD
  A[Update or manual triage] --> B[Load target configuration]
  B -->|Configuration error| C[Redact and bound error]
  B -->|Loaded| D[Select inference route]
  D -->|Unavailable| E[Model setup guidance]
  D -->|Available| F[Repair and validate]
  C --> G[Report unsuccessful repair]
  E --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -8, Tests +22. Total +14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 11 -8
Tests 1 23 1 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 26 12 +14

Review metrics

None.

Technical review

Best possible solution:

Keep inference classification with its existing selector and let configuration failures reach the repair loop’s bounded, redacted diagnostic handler.

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

Yes. Current main’s blanket catch deterministically replaces a configuration exception with model guidance, and the supplied qualification reports a failing real-config baseline and corrected result; this review verified source without executing it.

Is this the best way to solve the issue?

Yes. Removing the redundant catch preserves the existing model-failure classifier, error redaction, environment cleanup, and unsuccessful-repair behavior without adding another owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Misleading repair diagnostics are a bounded existing-behavior bug; this patch does not change whether failed repair permits activation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor gate does not apply to this MEMBER-authored diagnostic fix, and no authority change triggers additional proof. The captured integrated-head qualification exercises the production configuration loader and repair loop with a real database refusal, model failure, and cancellation; broader worker and published-driver claims concern the separated scope.

Evidence

What I checked:

  • Introduced change and review continuity: The local merge-base comparison matches the supplied two-file patch. Comparing the previous reviewed head d86aeec with the checkout produced no differences in either changed file. The previous completed review retained no findings. (src/infra/update-repair-agent.runtime.ts:100, ccd812c86fc0)
  • Current main still has the defect: The fetched main implementation catches configuration loading failures and substitutes the generic instruction to check model setup. (src/infra/update-repair-agent.runtime.ts:105, dfaec136991a)
  • Latest release comparison: The source at the supplied v2026.9.4 release commit also contains the blanket catch. GitHub contents inspection succeeded after the local release-blob read failed. (src/infra/update-repair-agent.runtime.ts:100, 3a9d69db306c)
  • Existing error and cleanup owners: The repair loop catches the propagated error, redacts and bounds its message, returns aborted, and clears its timer. The environment scope restores configuration and environment in finally. Inference selection retains its own model/auth failure handling. Update consumers require repaired before treating repair as successful; manual triage prints the reason and retains a failure exit. (src/infra/update-repair-agent.ts:287, ccd812c86fc0)
  • Regression and current qualification: The added test uses a real disposable SQLite database with user_version 999999 and the production configuration-loading boundary. The captured qualification comment reports the real-config loop returning aborted with zero attempts and the actual schema reason on this head, while an unresolvable model remains unavailable and cancellation/environment controls pass. It reports 30 focused cases passing; this review did not execute tests. fix(update): report configuration failures during repair #144819 (comment). (src/infra/update-repair-agent.runtime.test.ts:13, ccd812c86fc0)
  • Feature history and separated work: Current-main history connects the repair loop to Peter Steinberger’s repair work and Josh Lehman’s target-runtime repair. The merged runtime change at fix: unattended update repair fails on newer candidate state #145044 addresses execution placement, not this remaining diagnostic catch. Earlier custody feedback is explicitly separated into follow-up PRs in the current body and qualification. (src/infra/update-repair-agent.ts, 6cb7280a4e85)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jalehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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 (16 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-13T23:35:40.326Z sha dadda1b598d0cc1cd6d040d1ff6e20ce889a043b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T23:48:40.582Z sha dadda1b598d0cc1cd6d040d1ff6e20ce889a043b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T00:03:07.726Z sha d86aeec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T00:10:26.003Z sha d86aeec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T00:29:44.208Z sha d86aeec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T00:42:04.420Z sha d86aeec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T01:17:51.000Z sha d86aeec :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T20:26:58.287Z sha d86aeec :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor

Maintainer review at head 7d31253 (source review plus hosted CI; nothing executed locally). Running the staged repair in the updated runtime is the right selection, but moving it into its own process has to carry the existing executor's child custody as well as the live run/requester checks. The new launch in update-repair-worker.ts:69-83 bypasses withUpdateCommandExecutorChild, so the worker never acquires a delegated executor: if the updater exits while the repair is still draining, the installation lease owner has no registered repair child to consult before admitting another updater (that registration is exactly what update-command-executor.ts records to prevent reclamation while children drain, see #144314 and #144778). Please wire the process through the existing child-delegation owner, retain original and staged-root custody through settlement, and prove that parent death leaves acquisition blocked until the repair child exits. Also verify that revoked executor authority prevents the final repair tool effect; the new test only makes the ledger terminal. ClawSweeper's exact-head review is blocked on the related maintainer-acceptance question for refusing older staged workers.

@RomneyDa
RomneyDa force-pushed the fix/update-repair-runtime branch from 7d31253 to bbd5074 Compare September 12, 2026 06:08
@RomneyDa RomneyDa changed the title fix(update): run staged repairs in the updated runtime fix(update): keep installations reserved until repair exits Sep 12, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the executor-custody feedback. Each inference turn now uses withUpdateCommandExecutorChild; the worker runs under the delegated executor and the parent retains validation and service orchestration. Both roots stay reserved until the child exits and the canonical owner verifies cleanup. Final tool effects recheck the live executor as well as the original requester/update record.

The original failure was reproduced by killing the updater while its repair child remained alive. A separate built regression reproduced an actual tool effect after executor revocation while the ledger remained running. Both are fixed. Final proof passed 33 focused tests, all four managed-service repair cases, and 13 built isolation E2Es, including requester cancellation and immediate refusal of malformed delegated turns. Full build/changed checks and final runtime rebuild/types/lint passed; fresh review completed with its sole claim disproved by the explicit exit handler and built exit-1 tests.

Rebased onto main and removed overlapping staged-runtime implementation already present there. The PR now describes the remaining custody repair and preserves released updater compatibility at the worker receiver.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@RomneyDa

Copy link
Copy Markdown
Member Author

The completed exact-head re-review confirms the custody feedback is addressed and reports no remaining code or security findings.

The published-updater proof is now available: Docker job installed [email protected] and upgraded seeded operator state to the package built from CI merge 5fdb14d60064, containing head bbd5074500e4. Package integrity and legacy-operator-state with automatic authenticated restart passed. Worker custody and revocation are covered separately by the built failure-boundary tests.

The older-target behavior is intentional in both repair phases. An older worker cannot recheck the live executor before a tool effect or yield custody for parent validation, so this updater stops that automatic repair attempt with triage guidance, including after activation or partial rollback. This implements the requested executor guarantee without weakening it. Successful updates and the existing rollback decision are unchanged; the released v2026.9.4 complete-loop receiver remains supported for older updaters installing this version.

No SQLite schema or persistent-store semantics changed. Native Windows descendant-cleanup proof remains unrun: general Windows CI passed but skipped the four real repair-effect cases and did not select the worker E2Es. The PR body records that limit rather than treating those general checks as repair-specific evidence.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 12, 2026
@RomneyDa
RomneyDa force-pushed the fix/update-repair-runtime branch from 8814ffa to 2e4f357 Compare September 13, 2026 23:18
@RomneyDa RomneyDa changed the title fix(update): keep installations reserved until repair exits fix(update): report configuration failures during repair Sep 13, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 13, 2026
@RomneyDa
RomneyDa force-pushed the fix/update-repair-runtime branch from 2e4f357 to dadda1b Compare September 13, 2026 23:29
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation cli CLI command changes labels Sep 13, 2026
@RomneyDa
RomneyDa force-pushed the fix/update-repair-runtime branch from dadda1b to 4fcaeae Compare September 13, 2026 23:49
@RomneyDa
RomneyDa changed the base branch from main to fix/reef-scan-test-clock September 13, 2026 23:49
@RomneyDa
RomneyDa force-pushed the fix/update-repair-runtime branch from 4fcaeae to d86aeec Compare September 13, 2026 23:56
@RomneyDa
RomneyDa changed the base branch from fix/reef-scan-test-clock to main September 13, 2026 23:56
@RomneyDa RomneyDa closed this Sep 14, 2026
@RomneyDa RomneyDa reopened this Sep 14, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 15, 2026
@fuller-stack-dev

fuller-stack-dev commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Maintainer qualification at integrated head ccd812c86fc06498d8bb30e5d91d40a7917c4886 is complete. All 30 focused tests pass in 25.75s. RomneyDa's d86aeec3 is the first parent; the two-file PR patch is byte-identical after main integration. No contributor code changes were needed.

  • All 27 existing runtime, repair-loop, and inference tests pass. Scoped type-aware lint and formatting pass. Fresh independent P0-P2 review is clean.
  • A separate real-config loop fixture reproduced the bug on pristine main dd338334572: a newer-schema SQLite refusal became "Check model setup." With this head, the same fixture returns aborted, zero attempts, and the actual schema reason through the existing bounded/redacted handler. The disposable database version and environment are preserved.
  • The same fixture keeps an actual unresolvable model unavailable with the existing model guidance, and preserves explicit caller cancellation. Runtime module setup occurs before the fixture's unchanged 10-second diagnostic budget. No production timeout or schema changed.
  • The change removes eight net production lines. selectUpdateRepairInference still owns model/auth classification, and withUpdateRepairEnvironment still restores its scope in finally. Manual triage retains failure exit behavior and now prints the config reason.

Focused command:

node scripts/run-vitest.mjs src/infra/update-repair-agent.runtime.test.ts src/infra/update-repair-agent.test.ts src/infra/update-repair-inference.test.ts --maxWorkers=1

The old-head refresh exposed a 60-second timeout in the unrelated all-glyph browser test. Main already fixes that through PR147613, so I integrated main with an expected-head update instead of changing UI code or timeouts here. Current exact-head CI passed, including the required aggregate gate: https://github.com/openclaw/openclaw/actions/runs/34923431011. Attempt 1 passed every selected test shard but hit a pnpm native-parser cache ENOENT during the dependency scan. One failed-job-only rerun passed the dependency scan and aggregate gate; the 121 healthy jobs were preserved.

Separate delegated-worker changes and their published-driver/Windows proof remain outside this two-file diagnostic fix. The original independent review remains applicable to the identical patch; the integrated runtime passed the same configuration, model, cancellation, and environment controls.

@fuller-stack-dev
fuller-stack-dev merged commit 060a3ed into main Sep 15, 2026
326 of 328 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/update-repair-runtime branch September 15, 2026 03:36
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
vincentkoc added a commit that referenced this pull request Sep 15, 2026
* commit 'd8e50a38fd1c4df6dd69bcbc155697c464e1be45': (23 commits)
  fix(cron): release queued reservations when activation fails (#141008)
  fix(gateway): reduce CPU work in session lists and searches (#148713)
  feat(gateway): add admin CPU profile diagnostics (#148004)
  fix(gateway): cap device-required probe cache to prevent unbounded growth (#147708)
  fix(ci): align Gateway E2E expectations (#148653)
  refactor(ai): remove unused overflow wrapper (#148719)
  feat: stage selected chat text as editable comments (#148649)
  fix(ci): admit reachable release refs with large histories (#148161)
  fix(agents): allow authorized email CLI actions (#148521)
  improve(agents): trim large tool results with less CPU (#148718)
  refactor(docker): share image version parsing (#148243)
  fix(ci): retain passing hosted checks after skipped duplicates (#148722)
  fix(update): report configuration failures during repair (#144819)
  refactor(imessage): share handle classification (#148229)
  fix(ui): keep the selected agent across Settings pages (#148667)
  test(telegram): reuse deferred fixture helper (#148501)
  fix(media): resize images before understanding (#122431)
  fix: preserve unfinished work during completed PR cleanup (#148704)
  refactor(migrate-hermes): reuse canonical config record coercion (#148645)
  perf(channels): reduce history worker metadata footprint (#148711)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

3 participants