Skip to content

fix(config): clone catalog metadata before defaults - #126123

Merged
steipete merged 2 commits into
mainfrom
fix/frozen-catalog-defaults-20260819
Aug 19, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/frozen-catalog-defaults-20260819

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Commit #126068 made configured model overrides inherit omitted metadata from plugin manifest catalogs, but the catalog lookup returned the registry's object references. Manifest registry rows are frozen, so downstream provider normalization crashed Gateway startup when it assigned compat.supportedReasoningEfforts. All QA Smoke profiles on current main failed with Gateway exit 78 and TypeError: Cannot assign to read only property 'supportedReasoningEfforts' of object '#<Object>'.

Why This Change Was Made

The catalog lookup now returns a structured clone of the matched model metadata. This keeps manifest registry ownership immutable while giving config materialization its own mutable metadata tree for subsequent normalization. A regression test freezes the catalog model and nested compatibility metadata, then proves the materialized config can be normalized without mutating the catalog.

User Impact

Gateway startup works again for configured provider model overrides that inherit metadata from frozen plugin manifest catalogs. The change preserves authored config precedence and existing catalog-seeding behavior.

Evidence

AI-assisted: Yes. Agent transcript: not included.

No CHANGELOG edit: this is a focused broken-main repair, and changelog updates are release-only.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 19, 2026 01:52
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 19, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 10:36 PM ET / August 19, 2026, 02:36 UTC.

ClawSweeper review

What this changes

The PR clones matched plugin catalog model metadata before config defaults reuse it, preventing later normalization from mutating immutable registry data.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR remains necessary: current main still passes a frozen catalog model into mutable config materialization by reference. The head resolves the prior net-neutral review request and has no actionable diff finding.

Priority: P1
Reviewed head: d0fa9676badf421c3fd8638e5b51682091c518ef

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-boundary repair with credible regression coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body still supplies a pre-fix QA failure and focused validation evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body still supplies a pre-fix QA failure and focused validation evidence.
Evidence reviewed 6 items Current-main defect remains: Current main returns the indexed catalog model directly, while later defaulting adopts its compat object into the materialized configuration.
Immutable producer boundary: Plugin metadata snapshots recursively freeze every object value, including the manifest registry consumed by config materialization.
Correct repair boundary: The PR changes the catalog lookup to return a structured clone before omitted compat metadata is attached to the mutable model definition.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

pnpm openclaw --help
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-126123-DSMjTp/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 400.66 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 105.19 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.5s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 10 phases completed in 4355ms (slowest: built plugin control-plane loads 3573ms)

OpenClaw 2026.8.1 (d0fa967) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console
… output truncated …

Assertions:

  • PASS expect_output: Usage:

How this fits together

Plugin metadata snapshots feed model catalog data into configuration materialization at Gateway startup. Configured model overrides inherit catalog fields, then provider normalization consumes the resulting mutable runtime configuration.

flowchart LR
  A[Operator model override] --> B[Plugin metadata snapshot]
  B --> C[Frozen catalog model]
  C --> D[Config defaulting]
  D --> E[Cloned metadata]
  E --> F[Mutable runtime config]
  F --> G[Provider normalization]
  G --> H[Gateway startup]
Loading

Before merge

  • Complete next step (P2) - No repair work is queued: the previous P3 finding is resolved, and this protected maintainer PR needs routine exact-head CI and landing handling.
Agent review details

Security

None.

PR surface

Source 0, Tests +50. Total +50 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 50 0 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 51 1 +50

Review metrics

Metric Value Why it matters
Production versus regression-test delta production 0 net (1 line replaced); tests +50 The repair adds no production surface and the test protects the frozen-metadata ownership boundary.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/config/defaults.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the net-neutral clone at the immutable-metadata to mutable-runtime-config boundary after exact-head CI completes.

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

Yes—source-reproducible with high confidence: current main returns frozen catalog metadata by reference, and the focused regression captures the resulting nested compat mutation. No repository test was run during this read-only review.

Is this the best way to solve the issue?

Yes. Cloning at catalog lookup preserves immutable snapshot ownership while giving the downstream config materialization path its required mutable copy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 23da04ba8af4.

Labels

Label justifications:

  • P1: This repairs a current-main Gateway startup regression for configured model overrides inheriting frozen catalog metadata.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body still supplies a pre-fix QA failure and focused validation evidence.

Evidence

What I checked:

  • Current-main defect remains: Current main returns the indexed catalog model directly, while later defaulting adopts its compat object into the materialized configuration. (src/config/defaults.ts:209, 23da04ba8af4)
  • Immutable producer boundary: Plugin metadata snapshots recursively freeze every object value, including the manifest registry consumed by config materialization. (src/plugins/plugin-metadata-snapshot.ts:72, d0fa9676badf)
  • Correct repair boundary: The PR changes the catalog lookup to return a structured clone before omitted compat metadata is attached to the mutable model definition. (src/config/defaults.ts:209, d0fa9676badf)
  • Regression coverage: The added test freezes nested catalog compat metadata, confirms the materialized model can be changed, and confirms the catalog stays unchanged; it would throw with the current-main lookup. (src/config/defaults.test.ts:313, d0fa9676badf)
  • Runtime contract and prior-review resolution: Node v24.19.0 exposes structuredClone and returns undefined for structuredClone(undefined), so the earlier defensive undefined guard was correctly removed in the net-neutral follow-up commit. (src/config/defaults.ts:209, d0fa9676badf)
  • Feature provenance: The merged catalog-seeding predecessor predates this narrow regression repair; local shallow history cannot establish an exact blame chain for the current-main line. (src/config/defaults.ts:209, 66c7d720bd88)

Likely related people:

  • steipete: Authored merged catalog seeding and the follow-up clone correction in the affected lookup. (role: introduced catalog seeding and recent config-area contributor; confidence: high; commits: 66c7d720bd88, d0fa9676badf; files: src/config/defaults.ts, src/config/defaults.test.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-19T02:00:01.284Z sha f7fd5b0 :: found issues before merge. :: [P3] Keep the catalog clone net-neutral

@steipete

steipete commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready at d0fa9676badf421c3fd8638e5b51682091c518ef.

  • Exact-head pull_request CI: run 32208728181, completed successfully.
  • Focused node scripts/run-vitest.mjs src/config/defaults.test.ts: 11/11 passed. The changed gate, git diff --check, and fresh autoreview are clean.
  • The latest completed ClawSweeper review's sole P3/rank-up move is resolved: the final head directly returns structuredClone(index.get(...)), keeping production net 0 (tests +50). The final-head refresh now reports no findings.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 126123 passed at 2026-08-19 02:46 UTC in hosted_exact_or_recent_parent mode, verifying target head d0fa9676badf421c3fd8638e5b51682091c518ef; no separate remote lease was required.

The fix restores the ownership boundary between frozen manifest-catalog metadata and mutable materialized config, preventing the Gateway startup crash.

@steipete
steipete merged commit 3666fa6 into main Aug 19, 2026
222 checks passed
@steipete
steipete deleted the fix/frozen-catalog-defaults-20260819 branch August 19, 2026 02:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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