Skip to content

fix: point doctor to the config file when validation fails - #202070

Merged
roboclaw-bot merged 2 commits into
openclaw:mainfrom
jipeng6036-del:fix/doctor-invalid-config-recovery-hint
Nov 20, 2026
Merged

roboclaw-bot merged 2 commits into
openclaw:mainfrom
jipeng6036-del:fix/doctor-invalid-config-recovery-hint

Conversation

@jipeng6036-del

@jipeng6036-del jipeng6036-del commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #202032

What Problem This Solves

When Doctor encounters an invalid setting it cannot migrate, its recovery hint sends users to config unset. That command also requires a valid config, so users get stuck when they follow the hint.

User Impact

Doctor now shows how to locate the active config and tells users to correct the reported setting there. The command includes the selected profile when one is active.

Why This Change Was Made

config file can resolve the path while the config still fails validation. The fallback uses that read-only command and preserves any more specific repair hint supplied by the check.

Thanks to @anmol0b for reporting the recovery loop and to the ClawSweeper review for the invalid gateway.port test case.

Evidence

On Windows I ran the built CLI with an isolated profile and set gateway.port to a string. On the base, Doctor recommended config unset, which exited 1 and left the invalid value in place. On this branch, Doctor gives the active-profile lookup command. I used the returned path to correct the port, and the same final-validation check then passed.

Terminal excerpts show the actual output. I redacted the fixture directory and kept only the relevant fields in the final JSON.

> node openclaw.mjs doctor --fix --non-interactive
Location: gateway.port
Next step: Run `openclaw --profile proof-pr202032-fixed-followup-built doctor --fix` to migrate or remove retired keys. If no migration applies, find the active config with `openclaw --profile proof-pr202032-fixed-followup-built config file`, correct or remove the reported setting manually, and rerun Doctor.

> node openclaw.mjs config file
<isolated-profile>\openclaw.json

# After correcting gateway.port in that file
> node openclaw.mjs doctor --lint --only core/doctor/final-config-validation --json
{"ok":true,"checksRun":1,"findings":[]}

I updated the existing final-validation regression to check the new hint and removed the separate converter test. The existing case failed on the prior PR head and passed after the test update.

  • pnpm test src/flows/doctor-health-contributions.test.ts --maxWorkers=1 passed 94 tests in 496s locally.
  • pnpm test src/flows/doctor-lint-flow.test.ts --maxWorkers=1 passed 5 tests in 34s locally.
  • Changed-file lint and formatting and git diff --check passed. The follow-up changes tests only. It reuses the Windows runtime build from the preceding commit, which has identical production sources. The required hosted CI gate passed on a581cc465b29.

Independent Linux check on the published [email protected]: with a string in gateway.port, Doctor recommended config unset, but that command exited 1 without changing the profile. config file located the same file, and final validation passed after correcting the port there. This confirms the bug on stable. It does not verify upgrading that profile to the PR build; the published-driver update job was skipped.

@clawsweeper

clawsweeper Bot commented Nov 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Doctor now directs users to locate and correct the active config file when automatic repair cannot resolve validation errors.

Example: The active profile contains gateway.port set to "invalid".

  • Before: Doctor recommends config unset, which rejects the invalid config and recommends Doctor again.
  • After: Doctor supplies the profile-aware config file command and explains how to correct the reported setting.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with real CLI recovery evidence and the prior finding resolved; hosted validation remains unexecuted behind GitHub’s workflow hold.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Inspectable Windows built-CLI excerpts exercise Doctor with an invalid gateway.port, show the changed profile-aware guidance and config path, and show successful validation after correction; the subsequent commit changes only the regression assertion.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Following Doctor’s fallback sends operators between two commands that cannot repair the invalid setting.
Reason: The linked report establishes broken recovery guidance, and the change restores the existing actionable-error contract without adding options or changing validation policy.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR fixes a real recovery loop with a minimal change, and the prior regression-test finding is resolved.

Priority: P2
Reviewed head: a581cc465b2962c526c6bde679ad6b6f03acc120

Before merge

  • Await maintainer action - Resolve the action_required hold on the exact-head CI workflow so required checks can execute.

Findings

None.

Agent review details

How this fits together

Doctor converts configuration validation errors into shared repair and lint findings; the CLI renders their recovery hints to operators.

flowchart TD
  A[Invalid active config] --> B[Doctor validation]
  B --> C[Shared health findings]
  C --> D[Profile aware recovery hint]
  D --> E[Config file path lookup]
  E --> F[Manual correction and validation]
Loading

Technical review

Best possible solution:

Use the existing shared finding converter to provide a working config-file recovery path while preserving config-write validation.

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

Current-main source establishes the Doctor/config-unset loop, and the contributor supplies built-CLI recovery output; no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete repair: correct the shared recovery hint using the existing path lookup instead of widening mutation admission for invalid config.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Doctor final-validation recovery guidance keeps the original intent (952b5eb: Record failed repairs and provide actionable findings when final validation leaves invalid configuration.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 952b5eb adds src/flows/doctor-config-validation-findings.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 952b5eb3186c; files: src/flows/doctor-config-validation-findings.ts)

PR surface

Source +1, Tests 0. Total +1 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 1 1 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 3 2 +1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: This fixes misleading recovery guidance in an advanced CLI configuration workflow with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-19T21:39:34.445Z sha bcc5214 :: needs real behavior proof before merge. :: [P2] Update the existing final-validation regression with the new guidance

Reviewed November 19, 2026, 5:05 PM ET / 22:05 UTC (Revision 2).

@jipeng6036-del

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 19, 2026
@sallyom sallyom self-assigned this Nov 20, 2026
@roboclaw-bot
roboclaw-bot merged commit b4a41aa into openclaw:main Nov 20, 2026
136 of 139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: XS status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: doctor's fallback hint says to use config unset, but config unset refuses invalid configs and points back to doctor

3 participants