





























@@ -300,9 +300,10 @@ Related:
300300- [Configuration](/gateway/configuration)
301301- [Doctor](/gateway/doctor)
302302303-## Gateway restored last-known-good config
303+## Gateway rejected invalid config
304304305-Use this when the Gateway starts, but logs say it restored `openclaw.json`.
305+Use this when Gateway startup fails with `Invalid config` or hot reload logs say
306+it skipped an invalid edit.
306307307308```bash
308309openclaw logs --follow
@@ -313,19 +314,19 @@ openclaw doctor
313314314315Look for:
315316316-- `Config auto-restored from last-known-good`
317-- `gateway: invalid config was restored from last-known-good backup`
318-- `config reload restored last-known-good config after invalid-config`
319-- A timestamped `openclaw.json.clobbered.*` file beside the active config
320-- A main-agent system event that starts with `Config recovery warning`
317+- `Invalid config at ...`
318+- `config reload skipped (invalid config): ...`
319+- `Config write rejected: ...`
320+- A timestamped `openclaw.json.rejected.*` file beside the active config
321+- A timestamped `openclaw.json.clobbered.*` file if `doctor --fix` repaired a broken direct edit
321322322323<AccordionGroup>
323324<Accordion title="What happened">
324-- The rejected config did not validate during startup or hot reload.
325-- OpenClaw preserved the rejected payload as `.clobbered.*`.
326-- The active config was restored from the last validated last-known-good copy.
327-- The next main-agent turn is warned not to blindly rewrite the rejected config.
328-- If all validation issues were under `plugins.entries.<id>...`, OpenClaw would not restore the whole file. Plugin-local failures stay loud while unrelated user settings remain in the active config.
325+- The config did not validate during startup, hot reload, or an OpenClaw-owned write.
326+- Gateway startup fails closed instead of rewriting `openclaw.json`.
327+- Hot reload skips invalid external edits and keeps the current runtime config active.
328+- OpenClaw-owned writes reject invalid/destructive payloads before commit and save `.rejected.*`.
329+- `openclaw doctor --fix` owns repair. It can remove non-JSON prefixes or restore the last-known-good copy while preserving the rejected payload as `.clobbered.*`.
329330330331</Accordion>
331332<Accordion title="Inspect and repair">
@@ -338,16 +339,17 @@ Look for:
338339```
339340</Accordion>
340341<Accordion title="Common signatures">
341-- `.clobbered.*` exists → an external direct edit or startup read was restored.
342+- `.clobbered.*` exists → doctor preserved a broken external edit while repairing the active config.
342343- `.rejected.*` exists → an OpenClaw-owned config write failed schema or clobber checks before commit.
343344- `Config write rejected:` → the write tried to drop required shape, shrink the file sharply, or persist invalid config.
344-- `Rejected validation details:` → the recovery log or main-agent notice includes the schema path that caused the restore, such as `agents.defaults.execution` or `gateway.auth.password.source`.
345-- `missing-meta-vs-last-good`, `gateway-mode-missing-vs-last-good`, or `size-drop-vs-last-good:*` → startup treated the current file as clobbered because it lost fields or size compared with the last-known-good backup.
345+- `config reload skipped (invalid config):` → a direct edit failed validation and was ignored by the running Gateway.
346+- `Invalid config at ...` → startup failed before Gateway services booted.
347+- `missing-meta-vs-last-good`, `gateway-mode-missing-vs-last-good`, or `size-drop-vs-last-good:*` → an OpenClaw-owned write was rejected because it lost fields or size compared with the last-known-good backup.
346348- `Config last-known-good promotion skipped` → the candidate contained redacted secret placeholders such as `***`.
347349348350</Accordion>
349351<Accordion title="Fix options">
350-1. Keep the restored active config if it is correct.
352+1. Run `openclaw doctor --fix` to let doctor repair prefixed/clobbered config or restore last-known-good.
3513532. Copy only the intended keys from `.clobbered.*` or `.rejected.*`, then apply them with `openclaw config set` or `config.patch`.
3523543. Run `openclaw config validate` before restarting.
3533554. If you edit by hand, keep the full JSON5 config, not just the partial object you wanted to change.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。