Skip to content

fix(config): preserve authored settings through updates and setup - #140579

Merged
steipete merged 6 commits into
mainfrom
codex/130706-config-source-owner-20260906
Sep 7, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/130706-config-source-owner-20260906

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

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 $include files, default-valued settings deliberately pinned by the operator, and earlier wizard security/telemetry choices.

Connected failures affected literal null values 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.apply requests and runtime-derived replacements preserve valid nullable values; config.patch retains 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 nextConfig calls remain supported, and source producers use sourceConfig. 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 639605e4c0420b197633baf09a0121dbd306cbf2 integrates main 599762504579943ae1b04dd1de6f2e15dddf4b8a. 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 2426584909a9df7e0a3c55e8bc5eb1a29f727fa9 compatibility 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.

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.
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling plugin: file-transfer size: XL maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 01:28
@steipete
steipete requested a review from a team as a code owner September 7, 2026 01:28
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 7, 2026, 6:42 PM ET / 22:42 UTC.

ClawSweeper review

What this changes

Preserves 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
Reviewed head: 639605e4c0420b197633baf09a0121dbd306cbf2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The repair is coherent and well covered in source, but incomplete upgrade validation limits confidence in landing it.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Earlier built writer, Gateway RPC, and registry evidence remains attributed to its recorded revision; the separately declared current-head compatibility hold is still open.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Earlier built writer, Gateway RPC, and registry evidence remains attributed to its recorded revision; the separately declared current-head compatibility hold is still open.
Evidence reviewed 9 items Pinned introduction inspected: The local introduced delta is base 5997625 through head 639605e. Local inspection recovered the complete file list omitted from the prompt. The stale test merge was not used to attribute removal of main-branch behavior.
Central repair remains absent from current main: Fetched main still uses merge-patch-based runtime projection and the nextConfig-only replacement input. The central writer and Gateway files are unchanged between the pinned base and fetched main. No merged replacement for this remaining repair is established.
Snapshot-aware replacement boundary: The replacement input distinguishes sourceConfig from existing nextConfig callers while retaining mutation locking, snapshot/path checks, base-hash checks, and guarded include routing.
Findings None None.
Security None None.

How this fits together

Configuration 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]
Loading

Before merge

  • Resolve merge risk (P1) - The shared projection and Doctor changes affect persisted root/include values and public SDK writes; incomplete current-head compatibility checks leave preservation of existing configurations insufficiently established.
  • Complete next step (P2) - Complete the declared current-head natural build, two compiled Doctor cases, eight SDK cases, registry environment case, and plugin-consent caller case with complete receipts.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus regression coverage production net +43; tests and support net +2191 Production growth supports explicit input provenance and shared projection while the larger test delta covers preservation across callers and file layouts.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the declared compatibility checks (recommended)
    Finish the current-head compiled Doctor, SDK, registry-environment, and plugin-consent checks with fresh and existing-config outcomes before landing.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This repairs concrete configuration-preservation defects without evidence of an urgent current outage.
  • merge-risk: 🚨 compatibility: Persisted configuration projection and public SDK write semantics change while the declared current-head upgrade checks remain incomplete.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Earlier built writer, Gateway RPC, and registry evidence remains attributed to its recorded revision; the separately declared current-head compatibility hold is still open.

Evidence

What I checked:

  • Pinned introduction inspected: The local introduced delta is base 5997625 through head 639605e. Local inspection recovered the complete file list omitted from the prompt. The stale test merge was not used to attribute removal of main-branch behavior. (639605e4c042)
  • Central repair remains absent from current main: Fetched main still uses merge-patch-based runtime projection and the nextConfig-only replacement input. The central writer and Gateway files are unchanged between the pinned base and fetched main. No merged replacement for this remaining repair is established. (src/config/runtime-source-projection.ts:79, 24d76fdc10a7)
  • Snapshot-aware replacement boundary: The replacement input distinguishes sourceConfig from existing nextConfig callers while retaining mutation locking, snapshot/path checks, base-hash checks, and guarded include routing. (src/config/mutate.ts:1096, 639605e4c042)
  • Persisted-value regression coverage: The inspected writer matrix checks source/runtime/legacy inputs, root/include preservation, literal null versus omission, explicit defaults, and single indexed removal. Setup fixtures check fresh and existing configurations, telemetry choices, environment drift, and saved merge bases. These tests were inspected, not executed during this review. (src/config/io.write-config.test.ts:2754, 639605e4c042)
  • Public SDK compatibility documented: The SDK documentation explicitly retains runtime-derived nextConfig writes, describes sourceConfig replacements with their original snapshot and environment, and preserves updateConfig's mutator-result contract. Public docs: docs/plugins/sdk-runtime/config-and-utilities.md. (docs/plugins/sdk-runtime/config-and-utilities.md:34, 639605e4c042)
  • Captured compatibility evidence and remaining hold: The supplied complete PR body at sourceRevision 114ea19bc4a18808741e3e05bc0136056e9fe913173524e47b941ed1bbb38803 reports completed built SDK, Gateway RPC, registry, setup, include, and nullable-value checks on 2426584. It expressly leaves the current-head natural build, two compiled Doctor cases, eight SDK cases, registry environment case, and plugin-consent caller case unfinished. Earlier Doctor receipt collection was incomplete and its supplement did not dispatch. The previous review's concrete rank-up therefore remains unresolved. (639605e4c042)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • sasan1200: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the declared current-head build and compatibility supplement, retaining assertions and recording fresh and existing-config outcomes.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-07T03:54:53.726Z sha 8566764 :: blocked before merge. :: none
  • reviewed 2026-09-07T09:03:37.311Z sha a3ad79a :: blocked before merge. :: none
  • reviewed 2026-09-07T09:16:08.926Z sha a3ad79a :: blocked before merge. :: none
  • reviewed 2026-09-07T10:37:11.271Z sha a3ad79a :: blocked before merge. :: none
  • reviewed 2026-09-07T11:28:04.444Z sha a3ad79a :: blocked before merge. :: none
  • reviewed 2026-09-07T17:02:00.043Z sha 2426584 :: blocked before merge. :: none
  • reviewed 2026-09-07T17:14:20.517Z sha 2426584 :: blocked before merge. :: none
  • reviewed 2026-09-07T20:26:35.683Z sha e6c7550 :: blocked before merge. :: none

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.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 7, 2026
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.
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 7, 2026
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.
Keep the saved source baseline and agent preparation's returned configBase
paired through wizard persistence. Preserve current main's setup diagnostic
and typed startup-maintenance error handling while integrating its changes.

Related: #130706, #139949.
@steipete
steipete merged commit 07636e8 into main Sep 7, 2026
186 checks passed
@steipete
steipete deleted the codex/130706-config-source-owner-20260906 branch September 7, 2026 23:12
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant