Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
When openclaw doctor --fix finishes with a config that is still invalid, and no migration covers the rejected key, its fallback hint says to run openclaw config unset <key>. But openclaw config unset (like set and patch) refuses to run on an invalid config, and says to run openclaw doctor --fix. The two commands point at each other, and neither one fixes the config.
Steps to reproduce
This was traced in source on main @ 59ca885.
- Put a key into
openclaw.jsonthat the schema rejects and that no Doctor migration covers. - Run
openclaw doctor --fix. The final validation finding (src/flows/doctor-config-validation-findings.ts:21-23) uses the fallback:Run `openclaw doctor --fix` to migrate or remove retired keys. If no migration applies, correct the value or use `openclaw config unset <key>` with the rejected key path, then rerun Doctor. - Run
openclaw config unset <rejected.path>. Config writes go throughrunConfigOperations, thenloadValidConfigForWrite(src/cli/config-cli-runner.ts), thenensureValidConfigSnapshotForCli(src/cli/config-cli-validation.ts:55-67). That function exits 1 on any invalid snapshot and prints the repair hint "Runopenclaw doctor --fixto repair, then retry."docs/cli/config.mdalso says config writers do not bypass the invalid-config guard.
The fallback hint was added in 952b5eb. No test covers it.
Expected behavior
Doctor's fallback hint names something that works on an invalid config, for example editing the file shown by openclaw config file, or another supported repair path. Or config unset is allowed to remove exactly the rejected paths from an invalid config, so the existing hint works.
Actual behavior
Doctor says to use config unset, config unset says to use doctor --fix, and the user is stuck in a loop.
OpenClaw version
main @ 59ca885
Operating system
Not OS-specific
Install method
Any
Model
NOT_ENOUGH_INFO (no model involved)
Provider / routing chain
NOT_ENOUGH_INFO (no provider involved)
Logs
NOT_ENOUGH_INFO (traced in source; message strings quoted above)
Impact and severity
Medium for recovery. This is the path users take when setup or an upgrade leaves a config that is invalid in a way no migration handles, and both suggested commands lead back to each other.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 19, 2026
Codex review: this still needs some work.
Summary
This issue establishes a current-source recovery loop with a narrow repair, and the related upgrade PR does not address the misleading fallback.
Reproducibility: Current source establishes both sides of the loop, including rejection before deletion; no CLI reproduction or tests were run during this read-only review.
Regression provenance
Possible regression — suspected (reviewed change). No predecessor PR is attributed.
Next step
Replace Doctor’s unusable fallback and establish a failing regression showing that unresolved invalid configuration receives a working recovery path.
Review details
Best possible solution:
Doctor should direct operators to locate and correct the active configuration file when automatic repair leaves validation errors.
Do we have a high-confidence way to reproduce the issue?
Current source establishes both sides of the loop, including rejection before deletion; no CLI reproduction or tests were run during this read-only review.
Is this the best way to solve the issue?
Correcting the fallback is the smallest complete repair; allowing mutations against invalid starting configurations would unnecessarily expand the config writer’s contract.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against d5f3e4d7b75a.
Label changes
Label changes:
No label changes.
Label justifications:
P2: A source-proven recovery defect affects an advanced CLI configuration workflow, with no demonstrated widespread outage.impact:ux-friction: The suggested recovery commands send operators back and forth instead of explaining the supported manual correction path.maturity:stable: CLI Doctor is the primary M4 owner, its Doctor category scores are Stable, and actionable guided repair is an established contract.Evidence reviewed
Acceptance criteria:
What I checked:
src/flows/doctor-config-validation-findings.ts:23, d5f3e4d7b75a)src/cli/config-cli-validation.ts:79, d5f3e4d7b75a)src/flows/doctor-health-contributions.test.ts:3104, d5f3e4d7b75a)src/cli/config-cli.ts:447, d5f3e4d7b75a)src/flows/doctor-config-validation-findings.ts:23, 952b5eb3186c)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 19, 2026, 3:16 PM ET / 20:16 UTC.