Bug Description
After upgrading OpenClaw, running openclaw doctor --fix enters a broken loop where no fixes can persist because the tool fails atomically on any validation error.
Reproduction Steps
- Have a config with multiple issues, e.g.:
plugins.deny references a non-existent plugin (openclaw-weixin)
models.providers.bailian.models.*.compat.thinkingFormat has invalid enum values
- stale
plugins.allow / plugins.entries references (acpx)
- Run
openclaw doctor — it reports all issues and says Run "openclaw doctor --fix" to apply changes.
- Run
openclaw doctor --fix
Observed Behavior
--fix starts by auto-restoring config from last-known-good because the current config is invalid:
Config auto-restored from last-known-good: ...openclaw.json (doctor-invalid-config); Rejected validation details: plugins.deny: plugin not found: openclaw-weixin; ...
- It then claims to apply fixes:
Set plugins.bundledDiscovery="compat"
Installed missing configured plugin "feishu"
plugins.allow: removed 1 stale plugin id (acpx)
plugins.entries: removed 1 stale plugin entry (acpx)
- Finally it crashes with exit code 1 due to an unrelated validation error:
Error: Config validation failed: models.providers.bailian.models.0.compat.thinkingFormat: Invalid input (allowed: "openai", "openrouter", "deepseek", "zai")
- Run
openclaw doctor again — the stale acpx references are back, and all prompts to run --fix reappear.
Expected Behavior
doctor --fix should:
- Either not auto-restore last-known-good when the user explicitly asked to fix the current config, OR
- Apply all possible fixes and save them incrementally, so that fixing one issue isn't blocked by another unrelated validation error.
Environment
- OS: Windows 10 Education 10.0.19045
- Shell: PowerShell
- OpenClaw: just upgraded to latest
Impact
This makes doctor --fix effectively unusable for real-world configs that accumulate multiple issues across upgrades. Users are forced to manually edit openclaw.json instead of using the automated repair tool.
Bug Description
After upgrading OpenClaw, running
openclaw doctor --fixenters a broken loop where no fixes can persist because the tool fails atomically on any validation error.Reproduction Steps
plugins.denyreferences a non-existent plugin (openclaw-weixin)models.providers.bailian.models.*.compat.thinkingFormathas invalid enum valuesplugins.allow/plugins.entriesreferences (acpx)openclaw doctor— it reports all issues and saysRun "openclaw doctor --fix" to apply changes.openclaw doctor --fixObserved Behavior
--fixstarts by auto-restoring config from last-known-good because the current config is invalid:Set plugins.bundledDiscovery="compat"Installed missing configured plugin "feishu"plugins.allow: removed 1 stale plugin id (acpx)plugins.entries: removed 1 stale plugin entry (acpx)openclaw doctoragain — the staleacpxreferences are back, and all prompts to run--fixreappear.Expected Behavior
doctor --fixshould:Environment
Impact
This makes
doctor --fixeffectively unusable for real-world configs that accumulate multiple issues across upgrades. Users are forced to manually editopenclaw.jsoninstead of using the automated repair tool.