Skip to content

fix: clarify Doctor refusal diagnostics and update recovery - #168905

Merged
steipete merged 2 commits into
mainfrom
upd/upd-l1544
Oct 11, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-l1544

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Refs #168750

What Problem This Solves

An activation Doctor failure can leave migrated state with incomplete config or plugin maintenance, while the nested-effect error gives no useful admission context and recovery guidance can stop at inspection or generic triage.

User Impact

Migrated-state failures recommend the profile-aware openclaw update repair command while retaining backup and writer-custody warnings. An unverified Gateway also retains the existing triage guidance. Nested-effect refusals include access=effect and up to four caller function names, capped at 160 characters; stack paths and arguments are omitted.

Why This Change Was Made

The original nested-effect cause remains unconfirmed: 35-minute fake-timer probes with nested maintenance, update admission, and database closure did not reproduce it. This change preserves admission enforcement and adds a bounded diagnostic for the next field report.

The repair command acquires fresh authority, reruns Doctor, reloads config, and converges plugins. Its instruction supplements the existing advice for an unverified Gateway. The initial PR head accidentally suppressed that triage advice for migrated failures; the follow-up restores the original condition and strengthens the existing integration test to require both commands in the recorded action and report. Non-migrated recovery keeps its previous behavior.

Overall production: +17/-6 lines (net +11); tests: +94/-5 (net +89). The CI follow-up itself changes two files, +3/-2 lines.

Evidence

  • node scripts/run-vitest.mjs src/cli/update-cli/update-command-post-update-recovery.test.ts --maxWorkers=1: exact pre-PR tree c6d71fae0ed1 passed all 40 tests (172.86s wall); initial head 5f3f079721ec passed 38 and failed both reported triage assertions (94.72s wall); corrected tree passes all 40, including assertions for both triage and update repair (162.44s wall). The triage regression was introduced by this PR, not inherited.
  • Direct callers plus callers through update-command-result were exercised locally: 38 files pass. One separate failure remains in update-command-fresh-doctor-authority.test.ts, healthy case: config I/O fails with Plugin inventory has retired. It reproduces on unchanged 5f3f079721ec (1 failed/1 passed, 37.55s wall), before recovery guidance is produced. No retry, timeout, skip, or assertion weakening was used.
  • The unchanged admission diagnostic retains its prior 3-test regression proof. All 92 originally selected import-dependent files passed at 5f3f079721ec; that earlier run took 2040.97s including 13m35s of runtime preparation.
  • The correction passes check:changed --base 5f3f079721ec7aa9e8caf8442e0bfcbeec3d99cf with the previously proven inherited Knip scan explicitly omitted. The full original check and an unchanged-base replay both report the same unused exports in cli-session-history.claude.ts, approval-handler-runtime.ts, the GitHub connections files, and skill-workshop-page.test-support.ts. No baseline or suppression edits. Formatting, lint, typechecks, schema/version checks, runtime import cycles, and remaining guards pass. Prior Madge proof found zero cycles; imports are unchanged by the correction.
  • The reported CI type error in run-loop-startup.test-support.ts is outside this diff and left alone per maintainer direction. Isolated Codex review was attempted again but remains unavailable (HTTP 401); lead review of this PR head is still needed. All proof used local isolated test state. CI on the new head is not claimed as completed.

Preserve actionable update repair guidance after state migration and append bounded, path-free caller names to nested maintenance admission refusals. The original activation failure remains unconfirmed.

Refs #168750
@clawsweeper

clawsweeper Bot commented Oct 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 cli CLI command changes size: S labels Oct 11, 2026
@steipete
steipete marked this pull request as ready for review October 11, 2026 05:33
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR recommends profile-aware update repair after migrated-state failures and adds bounded caller names to nested-effect refusal diagnostics.

Example: An update using profile work fails with state-migrated-no-rollback and an unverified running Gateway.

  • Before: The recorded recovery action recommends triage without explicitly recommending update repair.
  • After: The action includes openclaw --profile work update repair alongside triage, while preserving installation and recovery-snapshot precautions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch appears correct and has meaningful harness coverage; evidence is test-based and the linked incident is only partially addressed.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-approved PR is outside the ordinary contributor proof gate; supplied evidence exercises real reporting persistence and maintenance admission in tests, without a shipped CLI capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: After a migrated-state update failure, users receive incomplete recovery advice and an admission error that does not identify the calling operation.
Reason: The related discussion explicitly approves this direction, and the PR uses a related reference rather than claiming to resolve the activation defect.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides maintainer-approved recovery guidance and useful diagnostics, and the corrected head has no actionable introduced defect. The underlying activation failure remains unresolved.

Priority: P2
Reviewed head: 71ca4742b1cd33dd3cafc78b83e5a82e0aa56869

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied tests do not show the shipped CLI displaying the revised migrated-failure guidance or nested-effect diagnostic.
Agent review details

How this fits together

Doctor's database maintenance owner enforces admission; update reporting consumes recorded recovery and serving facts to produce terminal guidance, saved next actions, and Markdown reports.

flowchart TD
  A[Activation Doctor] --> B[Maintenance admission]
  B --> C[Bounded refusal diagnostic]
  C --> D[Update recovery facts]
  D --> E[Recovery guidance]
  E --> F[Terminal and saved reports]
  F --> G[Existing update repair command]
Loading

Technical review

Best possible solution:

Land the focused recovery and diagnostic improvement while keeping the activation incident open for an identified caller-level fix.

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

Current-main source establishes the incomplete guidance and context-free refusal; the original managed-handoff activation failure has no high-confidence reproduction.

Is this the best way to solve the issue?

Reusing the existing repair command and enriching the enforced refusal is appropriate for this scope; resolving the activation failure still requires identifying its re-entering caller.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Nested maintenance-effect refusal keeps the original intent (44e7181: Allow policy reads during authority evaluation without recursive effects or revoked work.)
  • Readiness-pending recovery guidance changes intended behavior with a stated reason (53fc4b9: Preserve a Gateway still starting after an unconfirmed readiness observation; this PR explains why migrated failures also need maintenance guidance.)
  • Healthy migrated-state repair recommendation changes intended behavior with a stated reason (16095df: Consolidate workflows while preserving diagnostics; the PR explains replacing inspection advice with the existing repair command.)
  • Recorded serving and unsafe-recovery guidance keeps the original intent (48ff3d1: Derive advice from recorded recovery facts without contradicting the serving verdict.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +11, Tests +89. Total +100 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 17 6 +11
Tests 3 94 5 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 111 11 +100

Review metrics

Metric Value Why it matters
Production versus test LOC Production +17/-6; tests +94/-5 Small production growth reuses recovery ownership and adds bounded diagnostics; test growth covers distinct recovery branches and persisted reporting.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR improves recovery advice and failure diagnosis without changing recovery execution or admission policy.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T05:39:25.535Z sha 5f3f079 :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 2:19 AM ET / 06:19 UTC (Revision 2).

Keep the existing unsafe-recovery triage guidance alongside the added update repair instruction. The post-update integration cases now require both commands in the recorded action and rendered report.

Refs #168750
@steipete
steipete merged commit 49ca813 into main Oct 11, 2026
131 of 132 checks passed
@steipete
steipete deleted the upd/upd-l1544 branch October 11, 2026 06:22
RomneyDa added a commit that referenced this pull request Oct 12, 2026
…68905) (extracted hotfix)

Original subject: fix(update): route migrated-no-rollback failures to update
repair and name nested maintenance effects (#168905).

Extracted from #168905 (49ca813): took only the
src/cli/update-cli/update-recovery-guidance.ts hunks and their tests
(update-recovery-guidance.test.ts, two assertions in
update-command-post-update-recovery.test.ts). On the branch a
state-migrated-no-rollback failure either reports "readiness observation
ended" or tells the operator to run `openclaw doctor` / re-run `openclaw
update`, when the correct next step is `openclaw update repair` from the
installed version. Left out the openclaw-state-db async-lifecycle
nested-effect naming change, which is diagnostic-only and unrelated to the
guidance bug.

Extracted-from: 49ca813
Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 12, 2026
Release provenance: 89329f6 -> #168587
Release provenance: e6a9022 -> #168905
Release provenance: 15f3f12 -> #162266
Release provenance: 20805b8 -> #169430
Release provenance: 568fec8 -> #169102
Release provenance: 39dba6d -> #160440
Release provenance: 5df28c7 -> #168393
Release provenance: 10bcd8e -> #168164
Release provenance: dc5f1f5 -> #168446
Release provenance: 9f1e441 -> #168044
Release provenance: 5a235fc -> #168651
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
… name nested maintenance effects (openclaw#168905)

After an update ends in state-migrated-no-rollback, the next action now points to openclaw update repair (fresh authority, Doctor rerun, config reload, plugin convergence) while keeping triage guidance for unverified recovery. The maintenance authority nested-effect error now names the offending caller (bounded, no paths or arguments) so field reports identify the cause. Root cause of the nested effect in openclaw#168750 is not yet reproduced. Refs openclaw#168750.
RomneyDa added a commit that referenced this pull request Oct 13, 2026
…68905) (extracted hotfix)

Original subject: fix(update): route migrated-no-rollback failures to update
repair and name nested maintenance effects (#168905).

Extracted from #168905 (49ca813): took only the
src/cli/update-cli/update-recovery-guidance.ts hunks and their tests
(update-recovery-guidance.test.ts, two assertions in
update-command-post-update-recovery.test.ts). On the branch a
state-migrated-no-rollback failure either reports "readiness observation
ended" or tells the operator to run `openclaw doctor` / re-run `openclaw
update`, when the correct next step is `openclaw update repair` from the
installed version. Left out the openclaw-state-db async-lifecycle
nested-effect naming change, which is diagnostic-only and unrelated to the
guidance bug.

Extracted-from: 49ca813
Co-authored-by: Peter Steinberger <[email protected]>

10.3 resolution: 10.3 lacks the deferred post-install verification advisory and keeps
the split healthy-candidate branches, so only the readiness exclusion and the two
`openclaw update repair` routes were applied.

(cherry picked from commit e6a9022)
hilsbos pushed a commit to hilsbos/openclaw that referenced this pull request Oct 22, 2026
… name nested maintenance effects (openclaw#168905)

After an update ends in state-migrated-no-rollback, the next action now points to openclaw update repair (fresh authority, Doctor rerun, config reload, plugin convergence) while keeping triage guidance for unverified recovery. The maintenance authority nested-effect error now names the offending caller (bounded, no paths or arguments) so field reports identify the cause. Root cause of the nested effect in openclaw#168750 is not yet reproduced. Refs openclaw#168750.

(cherry picked from commit 49ca813)
Co-authored-by: RomneyDa <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant