Skip to content

fix(doctor): report refused config repairs as incomplete - #125282

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-doctor-cron-refusal-outcome
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-doctor-cron-refusal-outcome

Conversation

@steipete

@steipete steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running openclaw doctor --fix (or accepting an interactive repair) could see Doctor complete. and receive exit code 0 after cron-ownership safety refused the requested config write. The refusal also stops remaining diagnostics, so automation could treat an unconverged and partially unchecked installation as healthy.

Why This Change Was Made

Doctor now records every atomic config-write refusal in one closed outcome shared by validation and cron-ownership safety. Later contributions still stop rather than consuming an unpersisted candidate, while finalization reports the run as incomplete and exits 1. A config persistence failure also takes precedence over the updater's recoverable post-install advisory when both outcomes coexist; the unsafe write remains refused.

Production LOC: +21/-33 (net -12). The change replaces two parallel booleans with one discriminated outcome and removes duplicate terminal/short-circuit policy.

User Impact

Operators and scripts now get a truthful nonzero result when Doctor could not apply accepted repairs. Existing actionable refusal guidance remains unchanged, and no unsafe cron-owner write is forced.

Evidence

  • node scripts/run-vitest.mjs src/flows/doctor-health.test.ts src/flows/doctor-health-contributions.test.ts src/commands/doctor-config-flow.validation-refusal.test.ts src/infra/package-update-steps.test.ts — 143 tests passed.
  • The regression drives the real Doctor finalizer with both a cron-ownership refusal and a recoverable updater advisory, then proves exit 1 wins, Doctor complete. is absent, and no advisory result is published.
  • Existing contribution tests prove the typed cron refusal leaves config uncommitted, prevents later contributions, and suppresses duplicate retries.
  • node scripts/check-changed.mjs — all production checks and core production typecheck passed. The broad core-test typecheck is blocked by unrelated ui/src/pages/chat/route-loader.ts(712,38): TS2339; this branch does not touch that file, and the same baseline was independently reproduced at frozen exact 7810edca33f866df373b32e1779f7ecd51fbf78e.
  • Fresh structured autoreview: clean, correctness 0.99.

@steipete steipete self-assigned this Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 13:02
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 17, 2026
@steipete
steipete merged commit 7068006 into main Aug 17, 2026
284 checks passed
@steipete
steipete deleted the codex/autoqa-doctor-cron-refusal-outcome branch August 17, 2026 13:13

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants