feat(kiloclaw): validate openclaw config file saves#3542
Merged
pandemicsyn merged 5 commits intoMay 28, 2026
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit ( Resolved Issues (carried forward from prior review)
Files Reviewed (28 files changed across all commits)
Reviewed by claude-4.6-sonnet-20260217 · 3,144,230 tokens Review guidance: REVIEW.md from base branch |
St0rmz1
reviewed
May 28, 2026
St0rmz1
reviewed
May 28, 2026
St0rmz1
reviewed
May 28, 2026
St0rmz1
reviewed
May 28, 2026
St0rmz1
approved these changes
May 28, 2026
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.
Summary
openclaw.json, through the genericfiles/writecontroller endpoint, which performs no installed OpenClaw schema validation. This change adds validation before an upgraded instance savesopenclaw.json, preserving the user's changes and presenting an explicit Save anyway override when validation warns.openclaw.jsonsaves through a dedicatedfiles/write-openclaw-configendpoint only when the running controller advertises that capability. Capability gating lets not-yet-upgraded controllers keep their existing generic-save behavior; the dedicated endpoint is necessary so a controller rolled back after capability detection cannot ignore a new option on the generic endpoint and silently perform an unvalidated write.0600sibling candidate file under/root/.openclawand invokingopenclaw config validate --jsonwithOPENCLAW_CONFIG_PATHset to that candidate. OpenClaw therefore validates the pending save rather than the liveopenclaw.json, while placing the file in the same directory preserves ordinary relative-include resolution.Verification
Visual Changes
Reviewer Notes
files.write-openclaw-configcontinue using legacy genericfiles/write; capable controllers switchopenclaw.jsonto the validated path..openclaw.kiloclaw-validation-candidate.jsonnext to the live config with mode0600, executesopenclaw config validate --jsonwithOPENCLAW_CONFIG_PATHtargeting that staged file, parses the bounded JSON result, rechecks validated bytes before committing, and cleans up staged artifacts infinally. The internal staging filename is hidden from the generic file browser/read/write surface.