Skip to content

refactor(config): deslop config - #158295

Merged
steipete merged 1 commit into
mainfrom
deslop/l52-config2
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l52-config2

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Maintainer-requested second pass over config: runtime helpers still duplicate canonical coercion, validation, and type owners and retain forwarding layers with no independent contract. Related: #157146.

User Impact

Malformed MCP OAuth client metadata URLs now produce field validation errors instead of escaping as TypeError: Invalid URL. The cleanup preserves config options, defaults, schema output, normal validation messages, include/write behavior, environment-token semantics, and migrations.

Why This Change Was Made

This removes 562 net production lines across 55 config files, reusing existing owners while preserving ordering and public interfaces. All 307 non-session production files were read. The result is below the 1,000-line target; the required coverage log for every production file over 200 lines is included below.

Simplifications and rationale
  • Reuse the shared JSON-schema object type and narrowing helper in doc generation and external-channel SecretRef schemas; remove parallel local definitions.
  • Simplify doc-baseline grouping, type merging, metadata selection, and identical artifact-map types; remove branches that cannot distinguish the generated values.
  • Reuse canonical WhatsApp DM allowlist validators and one identical SecretRef provider validator, preserving issue paths and text.
  • Consume already-validated binding data in root schema refinement; remove redundant type widening and revalidation.
  • Remove runtime-schema registry forwarding and redundant schema hint/path branches; remove orphan comments left behind by moved fields.
  • Reuse canonical integer, path, control-character, string, record, DM-policy, sender-policy, and exec-config owners instead of local implementations or declarations.
  • Consolidate native-command setting/default resolution and remove private binding and silent-reply projection wrappers.
  • Consume the environment scanner's existing token kinds directly, preserving its grammar and reference-name identity.
  • Fold include resolver forwarding and one-caller methods into the owning flow; retain boundary checks, error order, and merge semantics.
  • Share mutation-to-transform adaptation; remove redundant config-path validation and intermediate unset projection.
  • Fold SecretRef redaction into its actual caller, remove unused error state, and remove explicit secret-flag entries already covered by the existing classifier.
  • Remove flattened audit inputs used only by an obsolete compatibility test; all production callers use the canonical record shape. Reuse audit coercion and simplify historical argv comparison.
  • Remove audit and metadata-stamping forwarding exports after exhaustive importer/SDK searches; callers now use their existing owners directly.
  • Simplify config snapshot option forwarding while preserving default ownership and false/undefined behavior.
  • Delegate UTF-8 plugin-ID sorting to the platform implementation; simplify repeated Talk field normalization, group-policy fallback plumbing, and legacy normalization.

Fixes found along the way

The MCP URL refinement used throwing URL construction after a non-aborting Zod format check. The existing test accepted any thrown error, masking the crash. The strengthened test reproduces the original ERR_INVALID_URL through validateConfigObjectRaw; non-throwing parsing now returns the existing HTTPS/non-root field diagnostic for malformed input.

Compatibility assessment

Reviewed against the lane's hard contracts: this patch adds/removes no config option, changes no default or stored schema, and preserves serialized schema/docs, include/merge/write semantics, env-token grammar, SecretRefs, and existing migration outcomes. Canonical helpers replace equivalent local code; config metadata stamping and audit records retain their existing owners and stored shapes. Existing installations need no new operator action for this refactor. Malformed MCP metadata URLs intentionally gain the existing structured field diagnostic instead of an uncaught URL exception.

The complete source checks, byte comparisons, consumer tests, and published-updater compatibility cells below support that assessment. The exact-head ClawSweeper re-review accepted the compatibility proof as sufficient and found no actionable code or security defect; its remaining generic compatibility checklist is addressed by this assessment.

Evidence

  • Current-head CI 36183666470: 170 checks passed, 45 skipped, none pending; openclaw/ci-gate succeeded. Independent review is clean through P2; the rebase is patch-identical.
  • pnpm build passed (765 s), including declarations, SDK exports, UI, and metadata. pnpm plugin-sdk:check-exports and pnpm plugin-sdk:surface:check passed. The final candidate runtime also built successfully on the refreshed base.
  • pnpm config:schema:gen, pnpm config:docs:gen, and pnpm config:channels:gen: zero generated-file changes. Raw Zod JSON, schema metadata (excluding generatedAt), and all six doc artifacts match the refreshed clean base byte for byte.
  • Config tests: 477 files passed, 2 skipped; 6,921 tests passed, 6 skipped. This broad run also covered unchanged session config tests; no session source is changed. All 347 mapped non-live consumer files are now covered. The final 147 files passed 3,472 tests across Gateway, commands, plugins/SDK, routing, system-agent, UI E2E, and wizard projects.
  • Changed-file cost: pnpm test src/config/schema.test.ts --maxWorkers=1 passed 69 tests in 15.820 s wall; pnpm test src/config/io.audit.test.ts --maxWorkers=1 passed 36 tests in 14.976 s wall. Hosted CI reported 1 ms for the MCP URL regression case and 1.656 s aggregate case time for the 36 audit cases. These case timings exclude file startup overhead.
  • Final node scripts/check-changed.mjs --base origin/main passed on the refreshed base, including all guards, production/test typechecks, lint, and exact final source hashes. Credentialed live-provider tests were not run; no external provider contract changed.
  • Installed-upgrade proof passed: published [email protected] drove exact candidate 928faf4bf933e7c17d678ad27d7d2b852fc122c4 through base (541 s) and legacy-operator-state (393 s), serially against one tarball. Both succeeded on their first test attempts. The latter reported updateOutcome=success, updateRecovery=null, and updateRestartSource=baseline-update; config survival, authenticated Gateway replacement, health/readiness/RPC, clean Doctor, mock-provider turns, idempotence, and verified backup/restore passed. No live provider credentials were used.
Published updater compatibility evidence

Candidate tarball SHA-256: 8d2cd1f9f8f7c469a02d4003d9175f632ba6acd8ea656bad3ecc5d93d99b4078. The source wrapper verified the PR commit and full tree; packaging and registry preparation ran from a clean Git checkout at that exact commit.

The base scenario passed candidate-package-identity, installed-package-identity, automatic migration, post-Doctor config validation, state survival, and Gateway probes. Its additional restart exercise deliberately uses a candidate-to-future fixture (2026.9.99-first-hop.0); that is separate from the initial published-driver-to-candidate payload verification.

The legacy-operator-state scenario used the published driver's own restart (baseline-update, auto-auth). It preserved the baseline-authored config and structured env SecretRefs, agent/approval/job/workspace state, plugin intent, and mock-provider behavior. First-hop automatic-migration assertions ran before standalone Doctor. The published driver's separate post-core receipt is unavailable, which remains recorded as such; no receipt is inferred from a passed scenario.

Backup verification passed with archive SHA-256 874b436db1583ed35ac5d2cab367bbaad0c674ebf88cda798dd37879ee8636f2, verified raw transcript restoration, exact restored-agent preflight, and retained baseline readability. The baseline state/agent schemas were 18/23 and the candidate schemas 19/23; those schema changes already belong to main and are not introduced by this PR.

The installed scenarios use structured env SecretRefs; authored $include and ${VAR} syntax remain covered by the source config and consumer tests rather than these installed fixtures.

GIT_COMMIT=928faf4bf933e7c17d678ad27d7d2b852fc122c4 \
OPENCLAW_DOCKER_E2E_SELECTED_SHA=928faf4bf933e7c17d678ad27d7d2b852fc122c4 \
OPENCLAW_DOCKER_ALL_LANES=published-upgrade-survivor \
OPENCLAW_DOCKER_ALL_PARALLELISM=1 \
[email protected] \
OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS='base legacy-operator-state' \
OPENCLAW_UPGRADE_SURVIVOR_UPDATE_RESTART_MODE=auto-auth \
OPENCLAW_UPGRADE_SURVIVOR_ROOT_MANAGED_VPS=0 \
OPENCLAW_UPGRADE_SURVIVOR_LIVE_MODELS= \
OPENCLAW_UPGRADE_SURVIVOR_LIVE_OPENAI=0 \
OPENCLAW_UPGRADE_SURVIVOR_DOCKER_RUN_TIMEOUT=1500s \
node scripts/test-docker-all.mjs
Failure attribution and remote execution

The clean base reproduced exactly three Doctor missing-export failures and four guided-onboarding artifact-identity failures (30 other cases passed). Both are already owned by #157780. Applying its two fixture repairs only in the isolated Testbox checkout made the candidate pass all 37 cases; those fixture changes were then removed and are not part of this PR. Assertions and authority checks remained intact.

The first hosted CI hit 14 installer-fixture failures from its merge base. Main already fixed these in #158197 (e8378618c9dc); the patch-identical rebase incorporates that fix and the new CI is green. The refreshed base also contains the earlier agents test-type shard rebalance (d07b710d852).

All heavy commands ran through node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox --id <lease> --timing-json -- OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 ..., with one command per lease and frozen-lockfile installation on fresh leases. Consumer selections used node scripts/run-vitest.mjs; each selected file came from changed-export importer searches. The final three batches completed in 798.48 s (including a required runtime build), 309.37 s, and 273.43 s.

Provider Lease Commands/results Lifecycle
blacksmith-testbox tbx_01m3cmmgcd8hdefv2pehqestew Build, SDK, config and early consumer proof passed; later command interrupted by lease lifetime. Stopped.
blacksmith-testbox tbx_01m3ctex88mzj348h3yvh81v0n Original changed gate, strict generation comparisons and focused tests passed; exposed the seven independently owned E2E failures. Stopped.
blacksmith-testbox tbx_01m3d1nmjjtrx9j0ch8w8ncrsz Source verified; an extra proof-script commit check compared transport identity, so the command stopped before tests. No test evidence claimed. Stopped.
blacksmith-testbox tbx_01m3d2v2t7cmk7k2v267cffcgg Refreshed-base generation, clean-base reproduction, candidate E2E and final consumers and the final changed gate passed. A later upgrade-package build lost the Testbox connection before installation scenarios ran; no upgrade outcome is claimed from it. Provider API reports completed; stop confirmed already stopped.
blacksmith-testbox tbx_01m3dajja1vpdzw3t7pymrr6pd Source staging stalled on the overloaded host before upgrade execution; the wrapper was cancelled through its lifecycle owner. Stopped.
blacksmith-testbox tbx_01m3dh5zkv9keqhvdmzwr060xw Installed-upgrade proof, staged from a worker with the same wrapper and exact source verification. Native package/registry provenance uses a clean Git checkout at the PR head. Both installed scenarios passed; wrapper command exit 0 in 27m37.762s. Stopped; native stop confirmed completed.
Coverage: all 76 production files over 200 lines, sorted by baseline size
Lines File Status Decision
1742 src/config/io.write-prepare.ts READ First pass retained; authored-roster projection and include ownership preserve distinct reference/array contracts.
1179 src/config/mutate.ts READ Shared mutation-to-transform adaptation; retained lock ownership, include commit and rollback order.
1026 src/config/zod-schema.core.ts READ Prior pass #157146 exclusion; canonical schema or secret owner already simplified and behavior/validation compatibility retained.
846 src/config/zod-schema.agent-runtime.ts READ Prior pass #157146 exclusion; canonical schema or secret owner already simplified and behavior/validation compatibility retained.
811 src/config/schema.labels.ts READ Canonical field labels/help preserve published schema metadata bytes; no runtime duplication or unused metadata owner.
748 src/config/config-env-vars.ts READ Prior pass #157146; ownership snapshots, Windows key identity, acceptance publication, and rollback preserve distinct contracts; excluded from edits.
741 src/config/doc-baseline.ts READ Reuse shared JSON-schema type/narrowing; remove duplicate artifact type and equality wrapper; simplify kind grouping/type merges and unused hint-index path.
716 src/config/runtime-snapshot.ts READ Distinct immutable hash, generation and authority contracts; shared stringify has incompatible undefined/cycle semantics.
707 src/config/io.write-safety.ts READ Removed timestamp-only stampConfigVersion forwarder; path, inode, descriptor, permission and rollback fences retain distinct custody contracts.
698 src/config/io.observe-recovery.ts READ Call audit record owner directly; retained async/sync recovery runner and post-await current-owner gates.
693 src/config/io.snapshot.ts READ First pass retained; recovery, metadata admission, and env rollback paths have distinct contracts.
685 src/config/env-preserve.ts READ Prior pass #157146; array identity and authored escaped-reference guards preserve write-back semantics; excluded from edits.
674 src/config/io.write.ts READ Use canonical metadata stamping owner directly; read/validation/preflight/publication/audit/rollback ordering retained.
642 src/config/redact-snapshot.ts READ Folded single-use SecretRef-id helper into redaction owner and removed unused private error field.
642 src/config/schema.help.runtime.ts READ Authored help text and override order are exact generated-document contracts; no runtime flow or dead export to collapse.
640 src/config/channel-compat-normalization.ts READ Retained per-slot root/account streaming precedence and clone boundaries; generic deep-fill cannot preserve these distinct resolver contracts.
632 src/config/io.audit.ts READ Removed test-only flattened append compatibility; canonical string normalization; simplified scrub comparison and duplicate change tracking.
627 src/config/validation-plugin-rules.ts READ First-pass #157146 file; retained registry admission, diagnostic order, installed evidence and strict validation orchestration.
625 src/config/plugin-auto-enable.shared.ts READ First-pass #157146 file; retained plugin-specific candidate ownership and metadata-generation reuse policy.
621 src/config/includes.ts READ Inlined pass-through traversal and single-use class methods; retained all include root/depth/merge rules.
609 src/config/zod-schema.root-shape.ts READ Canonical Zod fragment with field order, strictness, defaults, and issue text contracts; shared fields already use their existing schema owners.
594 src/config/defaults.ts READ Simplified message default copy and removed redundant provider-default fallback; retained catalog omissions, alias ownership, and model identity paths.
564 src/config/zod-schema.gateway.ts READ Remove orphan comment describing retired chatMessageMaxWidth option above allowedOrigins.
530 src/config/io.runtime.ts READ Pass optional snapshot reader settings directly to factory default owner; retained public SDK aliases and live runtime custody.
530 src/config/schema.ts READ Replace manual heartbeat target seen/set loop with canonical uniqueStrings while retaining original nonstring-rejecting normalization.
512 src/config/validation-core.ts READ First-pass #157146 file; retained ordered short-circuit validation and authored-source diagnostics.
465 src/config/io.context.ts READ First pass retained; shared effect flow already unifies sync/async validation and recovery.
458 src/config/paths.ts READ Removed local resolveUserPath forwarder; every call supplies env/home and nonempty input to canonical infra/home-dir owner.
442 src/config/validation-plugin-config.ts READ Distinct missing, blocked, retired and deferred plugin outcomes have contract-specific messages; no safe common validator replaces them.
439 src/config/schema.lookup.ts READ Prior pass #157146 exclusion; lookup path guards and bounded schema projection remain distinct contracts.
436 src/config/channel-config-metadata.ts READ Imported canonical ChannelDmAllowFromMode; retained origin selection, schema traversal depth and sensitive-hint union behavior.
420 src/config/mcp-config.ts READ Read/write authority, redaction restoration and mutation hooks carry distinct contracts; kept normalized snapshots and post-commit ordering.
387 src/config/schema.help.core.ts READ Authored help text and override order are exact generated-document contracts; no runtime flow or dead export to collapse.
379 src/config/plugin-auto-enable.materialize.ts READ Channel-vs-plugin activation ownership and prefer-over/allowlist semantics are distinct; exported helpers all have runtime callers.
376 src/config/schema.tiers.ts READ Indexed exact/wildcard matcher preserves authored order and tier inheritance; generic lookup has different ancestor/cache semantics.
368 src/config/issue-location.ts READ JSON5 cursor preserves duplicate-key last-match, literal-line provenance, and redacted received-value output; no interchangeable existing owner.
366 src/config/schema.help.automation.ts READ Authored help text and override order are exact generated-document contracts; no runtime flow or dead export to collapse.
361 src/config/types.discord.ts READ Remove orphan comments detached from removed/extracted fields; retain every exported type and property.
356 src/config/io.load.ts READ First pass retained; shared effect flow preserves worker routing and current-authority checks.
355 src/config/zod-schema.root-support.ts READ Prior pass #157146 exclusion; canonical schema or secret owner already simplified and behavior/validation compatibility retained.
349 src/config/io.clobber-snapshot.ts READ Reused canonical errno predicate with original Error-only fence; sync and async lock timing contracts intentionally differ.
331 src/config/codex-plugin-diagnostics.ts READ Effective model/runtime route diagnostics already delegate to route owners; left Codex-backed policy unchanged.
330 src/config/io.health-state.ts READ No safe cut: observation generations, captured worker admission, conditional patching and postcommit error policy are independent requirements.
327 src/config/io.plugin-metadata.ts READ No safe cut: sync/async metadata routes share selection owner while retaining policy admission, artifact scope and workspace precedence.
326 src/config/validation-issues.ts READ First-pass #157146 file; retained Zod branch selection and SecretRef diagnostic filtering.
325 src/config/env-substitution.ts READ Prior pass #157146; uppercase/fallback/escaped token grammar and ordered traversal remain unchanged; excluded from edits.
325 src/config/talk.ts READ Grouped same-contract string normalization, reused canonical string coercion and removed duplicate fast-mode input guard.
322 src/config/mutate.include-io.ts READ Guarded publication and compensation stages each carry required authority and durable-write invariants.
306 src/config/zod-schema.agent-defaults-base.ts READ Prior pass #157146 exclusion; canonical schema or secret owner already simplified and behavior/validation compatibility retained.
285 src/config/io.read-helpers.ts READ No safe cut: include provenance, raw-hash sentinel, env resolution and authored tilde restoration are distinct contracts.
284 src/config/config-journal-snapshot.ts READ Storage audit owner; no change justified without changing worker/admission or fingerprint contracts.
279 src/config/docs-config-examples.ts READ Fence parser and layered strict validation preserve skip counters, localized-doc policy, and issue dedup; no duplicate generic owner.
278 src/config/types.secrets.ts READ Prior pass #157146 exclusion; canonical schema or secret owner already simplified and behavior/validation compatibility retained.
277 src/config/tools-by-sender.ts READ Prior pass #157146; typed buckets, legacy id compatibility, and bounded warning/cache lifetime retain explicit behavior; excluded from edits.
267 src/config/resolution-facts.ts READ WeakMap provenance, pending/resolved reference distinction and rewrite invalidation are all live.
265 src/config/utility-model-separation-migration.ts READ Kept source-fact and dynamic-ref deferral guards plus authored roster source paths; migration messages/order are contractual.
265 src/config/zod-schema.channel-messaging-common.ts READ Canonical Zod fragment with field order, strictness, defaults, and issue text contracts; shared fields already use their existing schema owners.
264 src/config/schema.help.models.ts READ Authored help text and override order are exact generated-document contracts; no runtime flow or dead export to collapse.
252 src/config/model-provider-config.ts READ Retained exact-row precedence, lazy resolver reentrancy and legacy fallback scan; model omission semantics differ from defaults owner.
248 src/config/io.write-topology.ts READ No safe cut: ownership migration and clone-on-write preserve authored aliases, explicit topology paths and same-store custody.
247 src/config/schema.help.agents.ts READ Authored help text and override order are exact generated-document contracts; no runtime flow or dead export to collapse.
246 src/config/types.telegram.ts READ Remove orphan comments for inherited reaction/prefix fields incorrectly attached to unrelated local fields.
244 src/config/channel-doctor-helpers.ts READ Existing canonical account traversal owns root-first migration and retired-key paths; streaming default-account materialization has separate inheritance.
241 src/config/channel-alias-migration.ts READ Existing descriptor owner already consolidates channel aliases; delivery-only and default-account contracts require its branches.
240 src/config/schema.hints.ts READ Inline kernel-channel classification into its only plugin-namespace caller; preserve prefix exclusions.
233 src/config/types.openclaw.ts READ Public config/SDK authoring type with intentional schema-derived fields or channel-specific compatibility; no dead export or equivalent local runtime flow.
230 src/config/validation.ts READ Sync/async wrappers select genuinely different default/strict modes; cloned pending facts and provenance must survive awaited metadata.
226 src/config/io.runtime-write-finalization.ts READ No safe cut: canonical reread generation, staged env publication, source checks and rollback need independent phases.
224 src/config/validation-channel-rules.ts READ First-pass #157146 file; retained inherited DM warning text and bundled schema issue projection.
219 src/config/group-policy.ts READ Flat groups preserve exact/wildcard and truthy fallback semantics before canonical scope owner; wrappers carry distinct group selection rules.
219 src/config/io.observe.ts READ Import audit record producer directly rather than observe-state re-export; sync producer and async captured owner retain separate lifecycle.
218 src/config/include-write-boundary.ts READ Each ownership rejection protects an observable include write case; no duplicate canonical owner.
218 src/config/merge-patch.ts READ First pass retained; RFC7396, ID-array and conflict semantics differ from generic merge helpers.
216 src/config/legacy.roster.ts READ First-pass #157146 file; retained ordered roster migration and workspace/ownership provenance.
208 src/config/plugin-auto-enable.apply.ts READ Same-turn cache and process metadata memo have separate invalidation lifecycles; custom fingerprints retain undefined-as-null semantics.
203 src/config/write-lock.ts READ No safe cut: nested scope joining, guarded admission, queue and file lock enforce separate in-process and cross-process custody.

@clawsweeper

clawsweeper Bot commented Sep 25, 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.

@steipete
steipete marked this pull request as ready for review September 25, 2026 19:44
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 928faf4bf933e7c17d678ad27d7d2b852fc122c4
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/config/io.owner-display-secret.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/official-external-channel-secret-schema.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/redact-argv.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/redact-snapshot.secret-ref.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/redact-snapshot.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/config/zod-schema.secret-input.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 9:36 PM ET / September 26, 2026, 01:36 UTC (Revision 7).

ClawSweeper review

What this changes

The branch consolidates configuration validation, writes, migrations, audit, and redaction helpers, and makes malformed MCP OAuth metadata URLs return field validation errors.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open. The malformed-URL failure remains on current main, and this branch is a useful landing candidate with credible compatibility evidence. I found no discrete introduced defect.

Priority: P3
Reviewed head: 928faf4bf933e7c17d678ad27d7d2b852fc122c4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and net smaller, with focused regression coverage, exact-head CI, and substantial upgrade evidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The captured PR evidence ties the exact config branch to published [email protected] update scenarios with reported after-fix Gateway restart, state survival, and backup restoration; the strengthened test covers malformed MCP URL diagnostics. No stored schema change is introduced, and the existing-state upgrade evidence supports compatibility. The linked outer Actions job was canceled and its logs were unavailable to this review host, so its internal terminal results were assessed from the captured PR evidence and prior exact-head review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured PR evidence ties the exact config branch to published [email protected] update scenarios with reported after-fix Gateway restart, state survival, and backup restoration; the strengthened test covers malformed MCP URL diagnostics. No stored schema change is introduced, and the existing-state upgrade evidence supports compatibility. The linked outer Actions job was canceled and its logs were unavailable to this review host, so its internal terminal results were assessed from the captured PR evidence and prior exact-head review.
Evidence reviewed 9 items Introduced URL repair: The PR replaces throwing URL construction with nullable parsing and checks for a null result before applying the HTTPS and pathname rules.
Regression test at validation entrypoint: The changed test sends malformed URLs through validateConfigObjectRaw and checks the field path and diagnostic.
Current-main necessity: Fetched current main still constructs this URL with new URL(value), so the central repair has not reached main.
Findings None None.
Security None None.

How this fits together

OpenClaw loads configuration files and environment values, resolves includes and migrations, then validates the result for the Gateway and plugins. Config writes and recovery also produce audit records and redacted diagnostics.

flowchart LR
A[Config files and environment] --> B[Includes and migrations]
B --> C[Schema validation]
C --> D[Config snapshot and writes]
D --> E[Gateway and plugins]
D --> F[Audit and redacted diagnostics]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

Source -562, Tests -24, Other -4. Total -590 across 58 files.

View PR surface stats
Area Files Added Removed Net
Source 55 350 912 -562
Tests 2 24 48 -24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 5 9 -4
Total 58 379 969 -590

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/config/legacy-private-network-migration.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep one owner for each config transformation while retaining current-main include-read diagnostics, structured MCP URL errors, and existing upgrade behavior.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main source gives a high-confidence malformed MCP metadata URL path through config validation, and the PR tests that entrypoint. This review did not execute the path.

Is this the best way to solve the issue?

Yes. Nullable URL parsing repairs the throwing refinement at its schema owner, while the broader substitutions reuse existing config owners; the recorded generation and upgrade checks support compatibility.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5be36d37cb73.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is primarily configuration cleanup with a narrow diagnostic repair.
  • merge-risk: 🚨 compatibility: The refactor touches config writes and migration paths used by existing installations; the published-updater evidence addresses the reviewed upgrade concern.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured PR evidence ties the exact config branch to published [email protected] update scenarios with reported after-fix Gateway restart, state survival, and backup restoration; the strengthened test covers malformed MCP URL diagnostics. No stored schema change is introduced, and the existing-state upgrade evidence supports compatibility. The linked outer Actions job was canceled and its logs were unavailable to this review host, so its internal terminal results were assessed from the captured PR evidence and prior exact-head review.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR evidence ties the exact config branch to published [email protected] update scenarios with reported after-fix Gateway restart, state survival, and backup restoration; the strengthened test covers malformed MCP URL diagnostics. No stored schema change is introduced, and the existing-state upgrade evidence supports compatibility. The linked outer Actions job was canceled and its logs were unavailable to this review host, so its internal terminal results were assessed from the captured PR evidence and prior exact-head review.

Evidence

What I checked:

  • Introduced URL repair: The PR replaces throwing URL construction with nullable parsing and checks for a null result before applying the HTTPS and pathname rules. (src/config/zod-schema.mcp-server.ts:11, 928faf4bf933)
  • Regression test at validation entrypoint: The changed test sends malformed URLs through validateConfigObjectRaw and checks the field path and diagnostic. (src/config/schema.test.ts:371, 928faf4bf933)
  • Current-main necessity: Fetched current main still constructs this URL with new URL(value), so the central repair has not reached main. (src/config/zod-schema.mcp-server.ts:11, 5be36d37cb73)
  • Published-updater proof: The captured PR body identifies the exact candidate head and reports successful published [email protected] base and legacy-operator-state upgrade scenarios, including config and state survival, authenticated Gateway replacement, and backup restoration. Its source body hash is 82926ee2ceb04531088fe98eac49d32634f8a004678eb398f49cedb5b91fa7b7. The outer linked Actions job is marked canceled, and this review host could not fetch its log through the network proxy; the terminal outcomes are reported in the captured body and were accepted by the prior exact-head ClawSweeper review. (928faf4bf933)
  • Exact-head CI: The cited CI run completed successfully for the pinned PR head. (928faf4bf933)
  • Secret-redaction boundary: The removed explicit credential-flag names remain covered by the existing suffix classifier; the two names without a sensitive suffix remain explicit. (src/config/redact-argv.ts:4, 928faf4bf933)

Likely related people:

  • Dallin Romney: Raw commit d7380c5 adds src/config/zod-schema.mcp-server.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d7380c539d28; files: src/config/zod-schema.mcp-server.ts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (6 earlier review cycles)
  • reviewed 2026-09-25T19:51:47.380Z sha dc68d10b9e2dcf16ca17b873b8cd97fcd4d42a89 :: blocked before merge. :: none
  • reviewed 2026-09-25T20:18:55.570Z sha 928faf4 :: blocked before merge. :: none
  • reviewed 2026-09-25T21:54:31.602Z sha 928faf4 :: blocked before merge. :: none
  • reviewed 2026-09-25T22:38:44.181Z sha 928faf4 :: blocked before merge. :: none
  • reviewed 2026-09-26T00:39:55.723Z sha 928faf4 :: blocked before merge. :: none
  • reviewed 2026-09-26T01:08:48.924Z sha 928faf4 :: blocked before merge. :: none

Reuse canonical normalization and schema helpers, remove redundant forwarding and compatibility paths, and preserve generated config artifacts. Return structured validation diagnostics for malformed MCP OAuth metadata URLs.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The requested published-updater compatibility proof is complete for the unchanged head 928faf4bf933e7c17d678ad27d7d2b852fc122c4. The PR body now records the published [email protected] base and legacy-operator-state cells, candidate tarball identity, successful baseline-owned authenticated Gateway restart, config/state preservation, and verified backup/restore. Both cells passed on their first test attempts; source checks and current-head CI are also green.

The evidence explicitly separates the base cell’s later synthetic restart fixture and the unavailable legacy post-core receipt. Please review the updated proof; this is a review-only request, with no merge requested.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 26, 2026
@steipete
steipete merged commit e165449 into main Sep 26, 2026
268 checks passed
@steipete
steipete deleted the deslop/l52-config2 branch September 26, 2026 02:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
Reuse canonical normalization and schema helpers, remove redundant forwarding and compatibility paths, and preserve generated config artifacts. Return structured validation diagnostics for malformed MCP OAuth metadata URLs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed 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