[codex] Add OpenRouter to model routing#557
Merged
Th0rgal merged 3 commits intoJun 17, 2026
Merged
Conversation
|
@adrienlacombe is attempting to deploy a commit to the LFG Labs Team on Vercel. A member of the Team first needs to authorize it. |
db10c05 to
acf31e4
Compare
Addresses the review findings on PR Th0rgal#557: - [Medium] Cap the OpenRouter catalog. fetch_openai_compatible_models had no upper bound and OpenRouter (empty prefix_filters) exposes a large, fast-growing /v1/models list, so the picker/cached catalog could be flooded. Adds max_models to FetchTarget and caps OpenRouter at MAX_CATALOG_MODELS_PER_PROVIDER (100); models are sorted by id so the truncation is deterministic. Other (prefix-filtered) providers stay uncapped. - [Low] Bound description length. The new name/description extraction applies to every OpenAI-compatible provider; OpenRouter descriptions can run several paragraphs. truncate_description trims to MAX_MODEL_DESCRIPTION_CHARS (200) on char boundaries and drops empties. - [Low] Document the deliberate page-wide includeUnverified on the routing page (it's a config surface; volume is bounded by the cap above). - [Low] Seed slugs verified against OpenRouter's public catalog on 2026-06-17 (all five exist); noted in-code that they're best-effort seeds superseded by the live catalog. Adds a unit test for truncate_description (ASCII + multibyte + ellipsis). Validated: cargo fmt --all --check; cargo test -q api::providers::tests --lib (11 passed, 1 ignored); cargo test -q openrouter --lib (2 passed); eslint on the changed dashboard files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bound the models.dev merge for open-router, fetch its public /v1/models list without a key using ?sort=most-popular, and clarify the routing page comment about server-side catalog limits. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Adds OpenRouter as a first-class provider in the Model Routing picker while keeping the existing
open-routerprovider id used by credentials and proxy routing.Changes
open-routerto the routing provider catalog with seeded vendor-prefixed model IDs.open-routerid to theopenrouterkey used by models.dev./v1/modelsdiscovery through the existing OpenAI-compatible catalog fetcher.Validation
cargo fmt --allcargo fmt --all --checkcargo test -q openrouter --libcargo test -q api::providers::tests --libcd dashboard && bun run lint -- src/app/model-routing/page.tsx src/components/ui/add-provider-modal.tsx