mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:14:30 +00:00
fix(config): preserve config data when validation fails
When readConfigFileSnapshot encounters validation errors, it now: 1. Returns the resolved config data instead of empty object 2. Uses passthrough() on main schema to preserve unknown fields This prevents config loss when: - User has custom/unknown fields - Legacy config issues are detected but config is otherwise valid - Zod schema does not recognize newer fields Fixes config being overwritten with empty object on validation failure.
This commit is contained in:
committed by
Peter Steinberger
parent
b32f6a0e00
commit
20ba8d4891
@@ -296,7 +296,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) {
|
||||
raw,
|
||||
parsed: parsedRes.parsed,
|
||||
valid: false,
|
||||
config: {},
|
||||
config: resolved as ClawdbotConfig,
|
||||
issues: validated.issues,
|
||||
legacyIssues,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user