mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-21 18:08:05 -06:00
9bdc37f4ba
`openclaw onboard` refuses a corrupt openclaw.json and tells the operator to run `openclaw doctor --fix`. Doctor then answered with one sentence -- "Config could not be parsed or recovered ... refusing to apply repairs" -- named no next step, and exited 1. The operator was left looping between two commands that pointed at each other. The refuse path also wrote openclaw.json.clobbered.<timestamp> and called it "Original preserved", but it had not clobbered anything: at that point the snapshot is a reread of the live file, so the copy was byte-identical to the untouched config. Three failed runs left three identical copies. Drop the copy and say what to do instead: name the file, state that it cannot be repaired automatically, and point at `openclaw config validate` for the exact parse position, hand-editing, or moving the file aside and re-running `openclaw onboard`. Commands go through formatCliCommand so profile and container invocations stay pasteable. `doctor-config-preflight.ts` was the only caller of the public preserveConfigSnapshotAsClobbered wrapper, so the wrapper, its factory entry and its barrel export go too; the genuine recovery paths keep using the core helper and still preserve real originals. Production -16 LOC.