mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:30:42 +00:00
fix(config): recover prefixed config JSON
This commit is contained in:
@@ -100,6 +100,10 @@ The Gateway also keeps a trusted last-known-good copy after a successful startup
|
||||
`openclaw.json` is later changed outside OpenClaw and no longer validates, startup
|
||||
and hot reload preserve the broken file as a timestamped `.clobbered.*` snapshot,
|
||||
restore the last-known-good copy, and log a loud warning with the recovery reason.
|
||||
If a status/log line is accidentally prepended before an otherwise valid JSON
|
||||
config, gateway startup and `openclaw doctor --fix` can strip the prefix,
|
||||
preserve the polluted file as `.clobbered.*`, and continue with the recovered
|
||||
JSON.
|
||||
The next main-agent turn also receives a system-event warning telling it that the
|
||||
config was restored and must not be blindly rewritten. Last-known-good promotion
|
||||
is updated after validated startup and after accepted hot reloads, including
|
||||
|
||||
Reference in New Issue
Block a user