Repository navigation
refactor(agents): consolidate model normalization - #112772
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
July 22, 2026 21:32
steipete
force-pushed
the
codex/loc-model-normalization
branch
from
July 22, 2026 21:39
7880a7f to
12bfc74
Compare
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 23, 2026
* refactor(agents): consolidate model normalization * docs(agents): clarify normalization boundary
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
src/agentssplit provider/model reference normalization acrossmodel-ref-shared.tsandmodel-selection-normalize.ts, forcing callers to choose between overlapping owners and making the normalization order harder to audit.Why This Change Was Made
This maintainer-commissioned, AI-assisted refactor makes
model-ref-shared.tsthe canonical owner for provider IDs, static and configured model IDs, model refs, keys, manifest policy, and runtime plugin normalization. The shipped Plugin SDK declarations forparseModelRefandfindNormalizedProviderValueremain atmodel-selection-normalize.ts, preserving the publicagent-runtimeAPI hash. The lazyprovider-model-normalization.runtime.tsboundary is unchanged, and unrelated provider-config, model-compatibility, and tool-call normalization paths remain separate.User Impact
No user-visible behavior changes. Provider/model inputs retain the same trimming, casing, aliases, manifest policies, runtime plugin hooks, and OpenRouter compatibility behavior, with one fewer internal normalization owner.
Evidence
git diff --numstat: production+116/-127(net-11), tests+3/-3(net0), total+119/-130(net-11).node scripts/run-vitest.mjs src/agents/model-ref-shared.test.ts src/agents/model-selection.test.ts src/agents/model-selection.plugin-runtime.test.ts— passed 3 files / 142 tests.node scripts/run-vitest.mjs src/agents/model*.test.ts— passed 60 files / 931 tests across 4 routed shards.node scripts/run-vitest.mjs src/gateway/chat-tool-titles.test.ts src/security/audit-extra.sync.test.ts src/security/audit-small-model-risk.test.ts src/security/audit-summary.test.ts— passed 4 files / 31 tests.node scripts/run-vitest.mjs src/agents/model— router treated the argument as a directory and reported no test files; the explicit root glob above is the equivalent complete model-root proof.node scripts/check-changed.mjs— passed on Blacksmith Testboxtbx_01ky5tg0pj8ek9mr7e2pa4bpvp: formatting, Plugin SDK API contract hash, boundary guards, production and test typechecks, core lint, database/runtime guards, and runtime import-cycle check. Run: https://github.com/openclaw/openclaw/actions/runs/29957989206autoreview --mode uncommitted --stream-engine-output— Codex review clean; no accepted/actionable findings.Rank-up moveswere published to apply or skip.