Repository navigation
fix(config): preserve authored settings across includes - #139949
Conversation
Keep untouched model aliases and params in their authored rows. Finish roster/include reconstruction before applying explicit settings, and share recorded array ownership between projection and copying so unchanged include-backed writes retain their reload semantics. Validated with 292 focused tests, 33 real filesystem scenarios, the full changed gate, and a scoped-clean P2 review. Related: #130706
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:52 AM ET / 08:52 UTC. ClawSweeper reviewWhat this changesThe PR preserves authored model settings and include directives when configuration writes combine agent changes with explicit settings, while preventing duplicated included array entries. Merge readiness✅ Ready for maintainer review This remains a useful fix: the reviewed main revision and latest release retain the pre-fix behavior. No actionable introduced defect was found, and the maintainer-authored, protected PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s configuration writer combines requested edits with authored files and resolved runtime settings. It prepares the persisted configuration before validation, file writing, and subsequent reload. flowchart TD
A[Authored configuration and includes] --> C[Prepare configuration write]
B[Runtime settings and requested edits] --> C
C --> D[Restore authored structure]
D --> E[Check array ownership and explicit settings]
E --> F[Validate and persist configuration]
E --> G[Reject unsafe include changes]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +38, Tests +231. Total +269 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep authored values and include contributions distinct throughout the existing writer, applying explicit intent only after structural reconstruction. Do we have a high-confidence way to reproduce the issue? Yes, from source: an unrelated write with a normalized model key and authored parameters reaches deletion of the original row on reviewed main; the regression fixtures specify this case. No runtime reproduction was executed during this review. Is this the best way to solve the issue? Yes. The patch repairs the existing persistence owner, reuses include ownership checks, and leaves model normalization with explicitly touched model entries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8503408bc14. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Final head The initial CI run exposed an existing Doctor legacy-list/include case that the first candidate rejected. The writer now reindexes the recorded pre-migration evidence to the same canonical roster paths used by include preservation, without changing its values or replacing Doctor's original facts. The unchanged Doctor suite passes all 21 cases alongside 128 writer tests. A separate production Doctor flow reproduced the failure before repair and now passes migration → atomic write → disk/reload → second no-op, preserving include bytes and environment references. All previous 33 real filesystem scenarios pass again on the final writer source. Final production delta is +45; tests +231. The latest ClawSweeper review had no findings or rank-up items but covered the earlier head; the final seven-line coordinate repair has its own clean P2 and real-flow proof. @clawsweeper re-review |
|
Merged via squash.
|
) * fix(config): preserve authored values during config writes Keep untouched model aliases and params in their authored rows. Finish roster/include reconstruction before applying explicit settings, and share recorded array ownership between projection and copying so unchanged include-backed writes retain their reload semantics. Validated with 292 focused tests, 33 real filesystem scenarios, the full changed gate, and a scoped-clean P2 review. Related: openclaw#130706 * fix(config): align include evidence with canonical roster paths
Share authored-source projection between root and nested include writers while preserving native and custom-I/O ownership. Validate explicit removals on a copy and apply them once to final output so indexed deletion cannot splice twice. Project runtime edits with value-presence semantics so full replacements retain literal nulls and omitted keys remain deletions. Keep config.patch's RFC deletion contract, legacy empty-parent behavior, and source-key unset semantics intact. Doctor persists migrated source instead of schema defaults, and committed plugin inventory refresh uses its caller's environment with published ownership. Remove duplicate projection, deletion, environment-baseline and forwarding helpers; reuse canonical coercion and hashing. Preserve main's nested include ownership, CAS/path/env guards, migration validation and existing SDK contracts. The integrated followup removes 14 production lines. Its seven owner/sibling files pass 488 tests, and the complete changed gate passes for all sixteen paths. Final compiled SDK, CLI and Gateway proof follows on this committed candidate. Related: #130706, #139949, #116108, #140579.
…40579) * fix(config): preserve authored writes and refresh committed plugin state Carry source/runtime input provenance through config mutations and lower writes. Preserve explicit default-equal changes, originating environment references, include ownership, and the public model mutator result. Keep each CLI, wizard, and update candidate paired with its native write preparation and merge base. Refresh plugin inventory from committed config while keeping staged probes explicit and preserving config path, snapshot and concurrent-write checks. Remove redundant source projection, duplicate option contracts and lazy-loader adapters. Keep the plugin draft clone because validation mutates aliased values. The classic wizard adopts its returned merge base without dropping earlier security or telemetry choices. Update-process fixtures follow the current preparation owner and retain real Doctor, JSON and terminal-output assertions. Related: #130706, #139949. * test(config): align writer fixtures with source preparation Use the native write-snapshot contract for agent deletion fixtures, assert captured environment provenance in plugin install results, and replay authored source settings for Gateway no-op checks. Retain the independent regression matrix for explicitly authoring runtime-default values. Remove a redundant async forwarding callback while preserving the existing triage, environment restoration, Windows recovery and presentation owners. This saves four production lines and keeps the combined update module within its line limit without a suppression. Validation: all 19 reproduced CI failures pass; 237 focused and sibling tests, including update flag, triage and cleanup ordering, pass. Independent P2 review finds no actionable issue. Related: #130706, #140579.
…enclaw#140579) * fix(config): preserve authored writes and refresh committed plugin state Carry source/runtime input provenance through config mutations and lower writes. Preserve explicit default-equal changes, originating environment references, include ownership, and the public model mutator result. Keep each CLI, wizard, and update candidate paired with its native write preparation and merge base. Refresh plugin inventory from committed config while keeping staged probes explicit and preserving config path, snapshot and concurrent-write checks. Remove redundant source projection, duplicate option contracts and lazy-loader adapters. Keep the plugin draft clone because validation mutates aliased values. The classic wizard adopts its returned merge base without dropping earlier security or telemetry choices. Update-process fixtures follow the current preparation owner and retain real Doctor, JSON and terminal-output assertions. Related: openclaw#130706, openclaw#139949. * test(config): align writer fixtures with source preparation Use the native write-snapshot contract for agent deletion fixtures, assert captured environment provenance in plugin install results, and replay authored source settings for Gateway no-op checks. Retain the independent regression matrix for explicitly authoring runtime-default values. Remove a redundant async forwarding callback while preserving the existing triage, environment restoration, Windows recovery and presentation owners. This saves four production lines and keeps the combined update module within its line limit without a suppression. Validation: all 19 reproduced CI failures pass; 237 focused and sibling tests, including update flag, triage and cleanup ordering, pass. Independent P2 review finds no actionable issue. Related: openclaw#130706, openclaw#140579.
) * fix(config): preserve authored values during config writes Keep untouched model aliases and params in their authored rows. Finish roster/include reconstruction before applying explicit settings, and share recorded array ownership between projection and copying so unchanged include-backed writes retain their reload semantics. Validated with 292 focused tests, 33 real filesystem scenarios, the full changed gate, and a scoped-clean P2 review. Related: openclaw#130706 * fix(config): align include evidence with canonical roster paths (cherry picked from commit 53600f3)
Related: #130706
What Problem This Solves
Configuration updates could lose authored model aliases or parameters, discard explicit settings beside
$include, or reject root-owned arrays. Explicit writes could also duplicate composed arrays on reload. These cases affect plugin migration writes, combined roster/settings changes, and Doctor's legacy-agent migration.Why This Change Was Made
Finish roster and include reconstruction once, then apply explicit settings. Keep model-key normalization with the touched-model owner. Projection and explicit copying share array ownership derived from the recorded pre-migration source; the writer reindexes that evidence when legacy agent lists move to canonical entries, without migrating its field values.
Already-satisfied array, object and index writes retain their authored contribution. Actual changes to included or mixed array contributions remain protected. Duplicate preservation, traversal and error-construction paths were removed.
User Impact
Unrelated updates preserve model metadata. Root-owned arrays remain editable, including environment-backed arrays. Explicit settings survive combined roster writes, and Doctor preserves nested includes and environment references while migrating legacy agents. Catalog-suppressed models still require explicit repair.
Evidence
299f5072b866a4a127a2b5d6a26c501f5395c2e3fa008abedf670e5e0289e4e1; final head:c5325345b532beea56227d5e85c8bef8abf5e683.The initial hosted run caught the legacy-list/include coordinate regression; the existing test and real Doctor flow now pass. Fresh exact-head CI passed on
c5325345b532beea56227d5e85c8bef8abf5e683. Single-agent to multi-agent topology expansion under an include retains its existing refusal, verified on the base; supported explicit multi-agent roster changes are covered.