Repository navigation
fix(config): clone catalog metadata before defaults - #126123
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 10:36 PM ET / August 19, 2026, 02:36 UTC. ClawSweeper reviewWhat this changesThe PR clones matched plugin catalog model metadata before config defaults reuse it, preventing later normalization from mutating immutable registry data. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessThis 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 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherPlugin 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +50. Total +50 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready at
The fix restores the ownership boundary between frozen manifest-catalog metadata and mutable materialized config, preventing the Gateway startup crash. |
|
Merged via squash.
|
* fix(config): clone catalog metadata before defaults * refactor(config): keep catalog clone net neutral
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 currentmainfailed with Gateway exit 78 andTypeError: 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
TypeError.node scripts/run-vitest.mjs src/config/defaults.test.ts— 11/11 passed.node scripts/check-changed.mjs -- src/config/defaults.ts src/config/defaults.test.ts— passed thecore, coreTestslanes.git diff --check— passed.AI-assisted: Yes. Agent transcript: not included.
No CHANGELOG edit: this is a focused broken-main repair, and changelog updates are release-only.