Repository navigation
refactor(agents): separate pure model references from runtime normalization - #203095
Conversation
|
🦞👀 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: needs changes before merge. What this changesThis PR moves model normalization into its existing normalization module so pure model-reference consumers avoid runtime imports. Example: A fallback skip marker constructs the key openai/gpt-5.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open: the focused separation is coherent, and source review found no actionable defect. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherModel-reference helpers serve fallback, catalog, onboarding, SDK, and runtime consumers; pure helpers format keys, while normalization combines provider IDs, manifest policies, and prepared runtime hooks. flowchart TD
A[Pure reference consumers] --> B[Model reference helpers]
B --> C[Pure catalog primitives]
D[Normalization consumers] --> E[Model selection normalization]
E --> C
E --> F[Manifest policies]
E --> G[Prepared provider hooks]
Technical reviewBest possible solution: Keep pure reference helpers runtime-free and all normalization in the existing normalization owner while preserving results, lifecycle semantics, and SDK contracts. Do we have a high-confidence way to reproduce the issue? Current-main static imports establish the dependency coupling through real pure-key consumers; no functional failure is alleged, and no target code was executed. Is this the best way to solve the issue? The existing normalization module can absorb the implementations without another module, forwarder, cache, or public API, and the inspected cutover preserves their logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb7ca3d33375. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -5, Tests +2. Total -3 across 32 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 21, 2026, 8:26 AM ET / 13:26 UTC. |
|
Merged via squash.
|
…zation (openclaw#203095) * refactor(agents): separate pure model references from runtime normalization * refactor(agents): erase type-only model reference imports
* perf(agents): prepare fallback rate-limit routes with model snapshots Reuse configured fallback models within the admitted config snapshot and share provider handles across configured normalization hooks. Preserve cold resolution for standalone or mismatched snapshots and reload route facts with their owning snapshot. * fix(agents): preserve static model selection during fallback preparation Skip projection for agents without configured fallbacks. Match the production plugin-runtime scope in fallback benchmarks and regressions so both variants use the same retained registry. (cherry picked from commit 2b58c8e) Companion audit: #201632 is selected to preserve registry and metadata ownership for the fallback hot path. #200605, #203901, #203095 and #202618 make independent TUI, custody, module separation and model listing changes; none is required by this port. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Pure model-key and formatting consumers inherit manifest and provider-runtime imports from a mixed reference module.
Fixes #203078
User Impact
No intended behavior or public contract change. Pure reference consumers lose those runtime dependency edges; no performance improvement is claimed.
Why This Change Was Made
Moves the six normalizers and private closure into the existing normalization owner, with complete caller cutover across 32 files. Preserves scalar, captured and lazy factory behavior, runtime-generation ownership, lookup semantics and SDK declaration anchors.
Moves the unchanged compaction assertion helper into its already-used owner to satisfy the existing line-cap ratchet. Every case, assertion and typed dynamic-import timing is preserved.
Evidence
import typecorrection and are reused.