Repository navigation
fix(config): preserve authored settings through updates and setup - #140579
Conversation
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.
|
🦞👀 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: blocked before merge. Reviewed September 7, 2026, 6:42 PM ET / 22:42 UTC. ClawSweeper reviewWhat this changesPreserves operator-authored configuration, environment references, explicit defaults, and nullable values through updates, setup, Gateway requests, and plugin SDK writes. Merge readiness⛔ Blocked before merge - 4 items remain This remains useful work beyond the merged include fixes. No actionable introduced defect was found, but the explicitly declared compatibility validation remains incomplete. Priority: P2 Review scores
Verification
How this fits togetherConfiguration writes enter through CLI commands, setup, Gateway requests, and plugin helpers. The shared writer reconciles those edits with authored files and then refreshes runtime configuration and plugin discovery. flowchart TD
A[CLI and setup] --> C[Configuration mutation]
B[Gateway and plugin requests] --> C
D[Authored files and read snapshot] --> C
C --> E[Source projection and ownership checks]
E --> F[Root or include file]
F --> G[Runtime and plugin discovery]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one snapshot-aware writer that preserves authored values and existing SDK behavior, supported by completed fresh-setup and upgrade compatibility evidence. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main projects replacement values through merge-patch semantics, which conflate literal null with deletion; the branch adds direct writer and Gateway regression cases. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes, the shared writer is the appropriate repair boundary, and explicit source inputs preserve the existing runtime-input API. Landing readiness still depends on the declared compatibility checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 24d76fdc10a7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
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.
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.
Retain the reviewed config source-provenance changes inside current main's update finalization lifecycle. Preserve its phase budgets, process cleanup, prepared worker entrypoints and current plugin uninstall owner. Move the same SDK guidance into main's split config-and-utilities page. Group wizard test roots with their onboarding command owners. Every canonical test remains assigned exactly once, compiler options are unchanged, and all shards stay within the existing 720-root cap. This resolves the added wizard regression's 721-root overflow without dropping coverage or raising the limit. Validation: 82 focused and process cases pass, including the full 14-case finalization suite; 395 unrelated CLI cases were intentionally filtered. The complete 17-path gate passes all production/test types, core/script lint and architecture guards. Independent P2 review finds no actionable issue in the integrated writer; the subsequent test-root routing adjustment also has independent config review and canonical coverage proof. Final compiled SDK, CLI and Gateway proof follows on the committed candidate. Related: #130706, #140579.
Preserve main's update execution and finalization ownership while retaining native write snapshots. Carry source provenance into the extracted plugin install-config owner and route management writes through that owner.
|
Merged via squash.
|
…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.
Related: #130706, #139949, #116108.
What Problem This Solves
Fixes an issue where users changing configuration or completing setup could save runtime-only defaults, lose authored values or environment references, or have explicit changes silently undone. This includes settings stored in
$includefiles, default-valued settings deliberately pinned by the operator, and earlier wizard security/telemetry choices.Connected failures affected literal
nullvalues in full replacements and runtime-derived edits, indexed array removals through the writer/SDK, Doctor migrations that saved schema defaults, and plugin discovery using stale or mismatched environment values after a config write.Why This Change Was Made
The mutation and persistence owners carry the input's source/runtime basis together with its native read snapshot, hash and environment. Root and include writes share projection and explicit-value handling. A presence-aware projection preserves literal values, including
null, while treating omitted keys as removals; array removals are validated on a copy and applied once to final output, after materialization.Doctor validates migrations but persists their source candidate. Registry refresh reads committed configuration with the correct published/caller environment, while prepared setup probes retain their explicit config and installer-owned records. The classic wizard keeps its matched merge base across agent preparation. Duplicate projection/deletion pipelines, environment-baseline readers, option declarations and loader adapters are removed; forwarding wrappers are inlined, and remaining coercion, hash and schema reads use canonical helpers.
User Impact
Requested settings survive updates without copying unrelated defaults into the file. Full
config.set/config.applyrequests and runtime-derived replacements preserve valid nullable values;config.patchretains its existing null-means-delete contract. Source-key unsets retain their documented exact-key behavior. The config CLI already handles indexed deletions without replaying them; the double-removal repair concerns direct writer/SDK requests.Existing runtime-derived
nextConfigcalls remain supported, and source producers usesourceConfig. Snapshot, path, include-graph, concurrent-write, consent and publication checks remain in place. No operator configuration option, environment variable, database schema or protocol version is added.This repair was found while extracting Peter Steinberger's (@steipete) work in #130706 and extends #139949.
Evidence
Current head
639605e4c0420b197633baf09a0121dbd306cbf2integrates main599762504579943ae1b04dd1de6f2e15dddf4b8a. All 18 focused wizard/default-agent, provenance and config-health tests pass, including main's typed startup-maintenance failures. The complete changed gate for the five overlapping paths passes. A fresh independent four-pass P2 review of the full 132-path PR is scoped-clean. Exact-head CI passed: 109 successful jobs, 15 skipped, zero failures. The committed tree matches the reviewed and tested tree.A natural full build on Blacksmith Testbox passed on that exact head and tree. All twelve compiled compatibility cases passed: two Doctor config owners, eight public SDK scenarios, explicit caller-environment registry refresh and the plugin-consent caller. Source/runtime inventories were byte-identical before and after both suites. Every child process joined, every fixture was removed, and the Docker containers were removed. Doctor's effect guard recorded no unexpected filesystem, process or network attempts.
The full 167-file evidence stream was received and its hashes verified locally. The first decoder compared plain strings against the exporter's filesystem-component order; a local reader correction reconciled the already-complete stream without rerunning product code or changing an assertion, deadline, source/build guard or remote artifact. The original failed decode is preserved separately. Earlier incomplete evidence from an expired lease is not claimed as a passing collection. Stopping a Testbox lease can cancel its hosting workflow; the command and decoded proof receipts establish the result.
The single wizard conflict retains the writer's saved merge base and the base returned by agent preparation, alongside main's comment. Other overlapping changes preserve main's diagnostics, documentation and ratchet updates. All other PR paths retain the same ordered additions and deletions. Dependency versions, lockfile, package exports and package-manager pin are unchanged; main's build-entry and declaration tooling remain intact.
Historical
2426584909a9df7e0a3c55e8bc5eb1a29f727fa9compatibility evidence includes a natural full build, SDK8, real Gateway RPC9, registry CLI9, caller/setup19, include13, caller-environment1, nullable-value8 and the full 52-case Gateway configuration suite. The subsequent e6 head passed 104 selected integration tests and the full 132-path changed gate. These receipts retain their actual source attribution rather than being relabeled as current executions.The compiled cases use synthetic config and owned processes. Doctor exercises its real config migration, decision and persistence owners; later host/auth/plugin effects are bounded synthetic boundaries. This is not a full Doctor CLI, provider-inference or operator-deployment test. The original local Doctor effect-guard failure remains recorded; the Linux capsule provides a private temporary filesystem for normal SQLite lifecycle IPC.
An older models/params-removal RPC timed out at its unchanged 30-second deadline. An unchanged diagnostic and continuation passed, but no root cause was established; the timeout remains an unattributed follow-up. The original multi-workspace CPU incident is not claimed reproduced or resolved.
The PR adds 43 production lines against its integrated main base after removing duplicate projection, deletion and adapter paths. Test support is counted separately. Final extraction-campaign accounting uses actual squash parents.