fix(agents): avoid eager alias normalization for default models#86671
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 11:02 PM ET / 03:02 UTC. Summary PR surface: Tests +61. Total +61 across 1 file. Reproducibility: yes. the linked bug gives a concrete source path and timing evidence, and current source inspection shows the direct-resolution fix path. I did not run a failing current-main repro because main already contains the lazy/direct-resolution implementation. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge Security Review detailsBest possible solution: Land the focused regression tests after normal CI and maintainer review, then close the linked bug when the implementation plus coverage are on main. Do we have a high-confidence way to reproduce the issue? Yes: the linked bug gives a concrete source path and timing evidence, and current source inspection shows the direct-resolution fix path. I did not run a failing current-main repro because main already contains the lazy/direct-resolution implementation. Is this the best way to solve the issue? Yes: as a test-only follow-up, the PR checks the hot-path invariants in the existing model-selection unit file without adding new runtime behavior or config surface. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against c9d0464ed116. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Tests +61. Total +61 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Neon Patch Peep Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
7861208 to
e3802f4
Compare
e3802f4 to
c850631
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Pre-merge verification for #86671: Behavior addressed: regression coverage for provider-qualified default model resolution avoiding eager alias work across aliasless configured models.
|
Summary
Real behavior proof
Behavior addressed: provider-qualified default model resolution no longer walks and normalizes every configured model just to resolve
openai/gpt-5.5on the inbound reply hot path.Real environment tested: local OpenClaw source checkout on macOS at current PR head
c8506316c7c05748c3389b5a4c4c47344579519b, using Node v24.15.0 withtsxto execute the production model-selection source directly.Exact steps or command run after this patch:
node --import tsx - <<'EOF'executedresolveConfiguredModelRefandbuildModelAliasIndexfrom./src/agents/model-selection.tsagainst a synthetic config with 97 aliasless configured models plus two configured aliases, then asserted that the provider-qualified default resolved toopenai/gpt-5.5, the alias index contained only the two real aliases, and the slash-form alias preserved the routed model path. The proof data uses synthetic model names only.Evidence after fix: Copied console output from the real command:
Observed result after fix:
resolveConfiguredModelRefresolved the provider-qualified default directly toopenai/gpt-5.5;buildModelAliasIndexignored the 97 aliasless configured model entries and returned only the two configured aliases; the routed slash-form alias still resolved toopenrouter/xiaomi/mimo-v2-pro-mit.What was not tested: a live WhatsApp/gateway workload with the reporter's exact provider plugin normalization latency; the local proof exercises the production source hot path and regression shape from #86635 without private user data.
Verification
node --import tsx - <<'EOF'current-head production model-selection proof abovenode scripts/run-vitest.mjs src/agents/model-selection.test.tsnode scripts/run-vitest.mjs src/agents/tools/message-tool.test.ts --testNamePattern 'uses a non-webchat session key'pnpm exec oxfmt --check --threads=1 src/agents/model-selection.test.tsgit log --format='%h %an <%ae> %s' upstream/main..HEADFixes #86635
Co-authored-by: Andy Ye 35905412+TurboTheTurtle@users.noreply.github.com