Fix openrouter behavior with gemini - #1154
Merged
Merged
Conversation
Previously providersForExactModelName stripped openrouter from a model's DIRECT index.ts endpoint types unless openrouter was the model's only provider. That meant a native model that is also served by OpenRouter (e.g. gemini-*, gpt-5.x) never listed openrouter in getDirectModelEndpointTypes, so it was unreachable via OpenRouter — both as a fallback and for a customer whose only configured provider is OpenRouter — even though model_list.json already carried openrouter in available_providers. Keep openrouter in the direct endpoint types, but order it LAST so native / first-class providers stay preferred (openrouter is only selected as a fallback or when it is the customer's only configured provider). vertex continues to be represented via its separate publishers/ fallback id. Regenerate the affected AvailableEndpointTypes entries (25 rewritten to append openrouter, 4 added for previously entry-less gemini-2.5 ids; 62 already carried openrouter). Update the getDirectModelEndpointTypes / providersForExactModelName tests to the new fallback behavior and add direct coverage for the ordering. NOTE: the sync's catch-all only ADDS missing mappings; a future OpenRouter union onto a model that already has an index.ts entry still needs the same one-time backfill (or a follow-up to make the mapping pass self-healing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45c5af8691
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| "Qwen/Qwen3.7-Plus": ["together"], | ||
| "qwen/qwen3.6-27b": ["groq"], | ||
| "gemini-3-pro-image": ["google"], | ||
| "qwen/qwen3.6-27b": ["groq", "openrouter"], |
Contributor
Author
There was a problem hiding this comment.
this sync-models update caught a few other cases where index.ts should've had the openrouter candidate, so added these as a driveby
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.
openrouter should be listed as a primary provider for gemini models, so that the secret list endpoint returns openrouter as a candidate provider for these gemini models.
tested with the control plane preview link: