fix(gateway): filter auto/custom pseudo-model IDs - #1643
Conversation
Previously, only `modelInfo.id` was checked for "auto" when resolving `baseModelName`. The `finalModelInfo.id` fallback could still pass through "auto" or "custom", causing stats to show entries like "bytedance/auto". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughReplace a multi-step baseModelName fallback with a simpler lookup: use Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where routing pseudo-model IDs "auto" and "custom" could leak into stats tracking, causing entries like bytedance/auto instead of the actual model name.
Changes:
- Extended filtering of pseudo-model IDs from just
modelInfo.idto also includefinalModelInfo.id - Added "custom" to the list of filtered pseudo-model IDs alongside "auto"
- Improved code formatting and comments for clarity
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
"auto"and"custom"pseudo-model IDs fromfinalModelInfo.idwhen resolvingbaseModelNamein the chat handlermodelInfo.idwas checked, butfinalModelInfo.idcould still pass through these routing placeholders, causing stats entries like"bytedance/auto"Test plan
bytedance/gpt-oss-120b) instead ofbytedance/auto🤖 Generated with Claude Code
Summary by CodeRabbit