Skip to content

fix: suppress "Run doctor --fix" hint when already in fix mode with no changes#24666

Merged
steipete merged 1 commit intoopenclaw:mainfrom
stakeswky:fix/doctor-fix-hint-24566
Feb 24, 2026
Merged

fix: suppress "Run doctor --fix" hint when already in fix mode with no changes#24666
steipete merged 1 commit intoopenclaw:mainfrom
stakeswky:fix/doctor-fix-hint-24566

Conversation

@stakeswky
Copy link
Copy Markdown
Contributor

@stakeswky stakeswky commented Feb 23, 2026

Summary

  • Problem: openclaw doctor --fix shows "Run doctor --fix to apply changes" even when there are no pending changes, which is confusing.
  • Why it matters: Users who just ran --fix see a hint telling them to run the same command again, implying something is broken.
  • What changed: Added a !prompter.shouldRepair guard so the hint only appears when running plain doctor (without --fix).
  • What did NOT change (scope boundary): The config-write path, the --fix repair logic, and the "Doctor complete." outro are all untouched.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

  • When running openclaw doctor --fix with no config changes needed, the misleading "Run doctor --fix to apply changes" message is no longer shown. The command proceeds silently to "Doctor complete."
  • When running openclaw doctor (without --fix) and changes are detected, the hint is still shown as before.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node.js
  • Model/provider: N/A
  • Integration/channel: N/A

Steps

  1. Run openclaw doctor --fix when config is already up to date
  2. Observe output

Expected

  • No "Run doctor --fix" hint; just "Doctor complete."

Actual (before fix)

  • Shows "Run doctor --fix to apply changes" even though we just ran --fix

Evidence

  • Trace/log snippets: The diff is a single-line guard addition (elseelse if (!prompter.shouldRepair))

Human Verification (required)

  • Verified scenarios: Read the code path; prompter.shouldRepair is true when --fix is passed, false otherwise.
  • Edge cases checked: Plain doctor (no --fix) still shows the hint when changes exist. --fix with actual changes still writes config.
  • What you did not verify: Full integration test with a live config file.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the single-line change (else if back to else)
  • Files/config to restore: src/commands/doctor.ts
  • Known bad symptoms reviewers should watch for: The hint not appearing when it should (plain doctor with pending changes)

Risks and Mitigations

  • Risk: If prompter.shouldRepair is somehow undefined/falsy in an unexpected path, the hint could be suppressed incorrectly.
    • Mitigation: shouldRepair is always set to a boolean in createDoctorPrompter (line 32 of doctor-prompter.ts). No code path leaves it unset.

Greptile Summary

Prevents confusing "Run doctor --fix" hint from appearing when user already ran openclaw doctor --fix with no changes needed. The fix adds a guard checking !prompter.shouldRepair to line 298 so the hint only displays during plain doctor runs (without --fix), not when already in fix mode.

Confidence Score: 5/5

  • Safe to merge - single-line conditional fix with clear, correct logic
  • The change is minimal (single condition added), well-justified in the PR description, and correctly uses the existing prompter.shouldRepair flag that's always set to a boolean value in createDoctorPrompter. The logic is sound: when shouldWriteConfig is false and we're NOT in repair mode, show the hint; when in repair mode, skip the hint. No risk of breaking existing functionality.
  • No files require special attention

Last reviewed commit: c53f54a

…o changes

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566
@openclaw-barnacle openclaw-barnacle bot added commands Command implementations size: XS labels Feb 23, 2026
Copy link
Copy Markdown
Contributor

@steipete steipete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed for correctness and simpler alternatives; this is the best scoped change for the issue.

@steipete steipete merged commit ae281a6 into openclaw:main Feb 24, 2026
28 checks passed
sagarsaija pushed a commit to sagarsaija/openclaw that referenced this pull request Feb 24, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
plgs2005 pushed a commit to plgs2005/openclaw that referenced this pull request Feb 24, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
margulans pushed a commit to margulans/Neiron-AI-assistant that referenced this pull request Feb 25, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
kevinWangSheng pushed a commit to kevinWangSheng/openclaw that referenced this pull request Feb 26, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
kevinWangSheng pushed a commit to kevinWangSheng/openclaw that referenced this pull request Feb 26, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
(cherry picked from commit ae281a6)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
(cherry picked from commit ae281a6)

# Conflicts:
#	src/commands/doctor.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…o changes (openclaw#24666)

When running `openclaw doctor --fix` and no config changes are needed,
the else branch unconditionally showed "Run doctor --fix to apply changes"
which is confusing since we just ran --fix.

Now the hint only appears when NOT in fix mode (i.e. when running plain
`openclaw doctor`). When in fix mode with nothing to change, the command
silently proceeds to the "Doctor complete." outro.

Fixes openclaw#24566

Co-authored-by: User <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor --fix shows "Run doctor --fix" hint when no changes needed

2 participants