fix(agents): preserve qualified model alias targets#88237
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 12:11 PM ET / 16:11 UTC. Summary PR surface: Source +3, Tests +34. Total +37 across 2 files. Reproducibility: yes. current-main source inspection shows the resolver reverse-matches alias targets before parsing slash-form primary refs, matching the linked report. I did not execute tests because this review is read-only. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical fix that preserves already-qualified primary refs ahead of bare reverse aliases, with regression coverage and explicit maintainer acceptance of the config-resolution precedence. Do we have a high-confidence way to reproduce the issue? Yes: current-main source inspection shows the resolver reverse-matches alias targets before parsing slash-form primary refs, matching the linked report. I did not execute tests because this review is read-only. Is this the best way to solve the issue? Mostly yes: the patch is a narrow maintainable fix that preserves explicit slash-form refs while keeping slash-form alias behavior. The remaining question is maintainer selection between this PR and the sibling fix plus explicit acceptance of the precedence change. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 4155ac1c0d7c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +3, Tests +34. Total +37 across 2 files. View PR surface stats
Acceptance criteria:
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
|
Summary
agents.defaults.model.primaryvalue could be reverse-matched through a bare alias target inagents.defaults.models, causing the resolver to returnopenai/<alias-key>instead of preserving the configured provider/model ref.src/agents/model-selection-shared.tsnow preserves slash-form primary refs that match bare alias targets, with regression coverage insrc/agents/model-selection.test.ts.Fixes #88218
Real behavior proof
Behavior or issue addressed:
agents.defaults.model.primary: "nemotron-bolt/nemotron-3-super-120b"is no longer re-resolved through bare alias keynemotrontoopenai/nemotron.Real environment tested: Linux worktree at
issue-88218, Node via repository test runner, productionresolveConfiguredModelRefcalled directly with a representative config.Exact steps or command run after this patch:
Evidence after fix: Copied terminal console output from the command above:
{ "primary": "nemotron-bolt/nemotron-3-super-120b", "aliasKey": "nemotron", "aliasTarget": "nemotron-bolt/nemotron-3-super-120b", "resolved": { "provider": "nemotron-bolt", "model": "nemotron-3-super-120b" } }Observed result after fix: the resolver preserves the configured
nemotron-boltprovider andnemotron-3-super-120bmodel instead of returning the bare alias under the default provider.What was not tested: a live provider call; the bug is in local model-reference resolution before any provider request is made.
Regression Test Plan
src/agents/model-selection.test.ts.Verification
Root Cause