Skip to content

fix(gateway): filter auto/custom pseudo-model IDs - #1643

Merged
steebchen merged 2 commits into
mainfrom
fix/filter-auto-pseudo-model-in-stats
Feb 11, 2026
Merged

steebchen merged 2 commits into
mainfrom
fix/filter-auto-pseudo-model-in-stats

Conversation

@steebchen

@steebchen steebchen commented Feb 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Filter "auto" and "custom" pseudo-model IDs from finalModelInfo.id when resolving baseModelName in the chat handler
  • Previously only modelInfo.id was checked, but finalModelInfo.id could still pass through these routing placeholders, causing stats entries like "bytedance/auto"

Test plan

  • Verify auto-routed requests log the correct canonical model name (e.g., bytedance/gpt-oss-120b) instead of bytedance/auto
  • Verify non-auto requests are unaffected

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Simplified model selection so the reported model name now reflects the final routing decision, improving accuracy of model identification and related logs without changing external behavior.

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>
Copilot AI review requested due to automatic review settings February 11, 2026 08:03
@coderabbitai

coderabbitai Bot commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Replace a multi-step baseModelName fallback with a simpler lookup: use finalModelInfo.id when present, otherwise fall back to usedModel. Removes previous checks against modelInfo.id and pseudo-ID exclusions, aligning baseModelName with post-routing finalModelInfo.

Changes

Cohort / File(s) Summary
Model routing / baseModelName
apps/gateway/src/chat/chat.ts
Simplifies baseModelName derivation to prefer finalModelInfo.id over usedModel; removes earlier multi-step fallback that inspected modelInfo.id and excluded pseudo-IDs. Minor comment adjustments only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • smakosh
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: filtering pseudo-model IDs (auto/custom) from the baseModelName derivation logic in the gateway chat handler.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/filter-auto-pseudo-model-in-stats

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.id to also include finalModelInfo.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>
@steebchen
steebchen enabled auto-merge February 11, 2026 08:25
@steebchen
steebchen added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit feac4ad Feb 11, 2026
13 of 14 checks passed
@steebchen
steebchen deleted the fix/filter-auto-pseudo-model-in-stats branch February 11, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants