mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:01:26 +00:00
fix(config): add resolved field to ConfigFileSnapshot for pre-defaults config
The initial fix using snapshot.parsed broke configs with $include directives.
This commit adds a new 'resolved' field to ConfigFileSnapshot that contains
the config after $include and ${ENV} substitution but BEFORE runtime defaults
are applied. This is now used by config set/unset to avoid:
1. Breaking configs with $include directives
2. Leaking runtime defaults into the written config file
Also removes applyModelDefaults from writeConfigFile since runtime defaults
should only be applied when loading, not when writing.
This commit is contained in:
committed by
Peter Steinberger
parent
9e8d9f114d
commit
3189e2f11b
@@ -114,6 +114,12 @@ export type ConfigFileSnapshot = {
|
||||
exists: boolean;
|
||||
raw: string | null;
|
||||
parsed: unknown;
|
||||
/**
|
||||
* Config after $include resolution and ${ENV} substitution, but BEFORE runtime
|
||||
* defaults are applied. Use this for config set/unset operations to avoid
|
||||
* leaking runtime defaults into the written config file.
|
||||
*/
|
||||
resolved: OpenClawConfig;
|
||||
valid: boolean;
|
||||
config: OpenClawConfig;
|
||||
hash?: string;
|
||||
|
||||
Reference in New Issue
Block a user