fix(config): prevent config wipeout on resolution or validation failure#1083
Closed
mukhtharcm wants to merge 3 commits intoopenclaw:mainfrom
Closed
fix(config): prevent config wipeout on resolution or validation failure#1083mukhtharcm wants to merge 3 commits intoopenclaw:mainfrom
mukhtharcm wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Contributor
|
Config semantics today:
PR change made config.apply behave like merge‑patch:
|
Contributor
|
Landed on main with updated config safety + backup rotation; kept latest Fixes ordering in CHANGELOG while resolving conflicts. Commit: f8e673c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR ensures the configuration is preserved when
config.applyis used, even if the current config has resolution errors (missing env vars or broken includes).Why it was needed
A regression was introduced in
a36735b(Env Var Substitution) where a resolution failure would return an empty object{}. When tools like model switching (config.apply) then merged their changes into this empty object and wrote it back, the user's entire config was wiped out.Changes
src/config/io.ts): Failure during$includeresolution or${VAR}substitution now returns the best-effort config instead of{}. This ensures we don't "forget" the existing data.src/gateway/server-methods/config.ts): Updatedconfig.applyto useapplyMergePatchagainst the snapshot, providing a second layer of protection against destructive overwrites during quick toggles/swaps.Notes
This extends the logic from PR #764 to cover new failure modes introduced by recent config features.