Repository navigation
✨ OpenRouter: current defaults, live-filtered suggestions, searchable grouped model picker - #18449
Conversation
- SuggestedModels/DefaultModel current (default deepseek/deepseek-v4.1-flash), pinned by a test against a recorded catalog fixture - Retired suggestions are hidden by the spoke and hub handlers - Fix OpenRouter model discovery: endpoints ending in /v1 probed /v1/v1/models - Cached, priced public catalog (crux/openrouter) served as model_info - Searchable, provider-grouped combobox for large gateway catalogs with price per 1M tokens and context length; per-agent selects use optgroups Signed-off-by: Andy Anderson <andy@clubanderson.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Mutation testinggremlins found 2 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
4 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
Summary
Items 1 and 3 of the gateway model-discovery work: current OpenRouter defaults, and a searchable, grouped picker for large gateway catalogs.
OpenRouter defaults (
crux/openrouter)DefaultModel=deepseek/deepseek-v4.1-flash(wasdeepseek/deepseek-chat).SuggestedModelsis now a short list with honest labels: DeepSeek V4.1 Flash (default, cheapest with caching), GLM-5.3 (strong, cheap), GLM-5.3 Flash (cheapest), Claude Sonnet 5.5 (premium), Gemini 3.8 Flash (fast, mid-price).testdata/models.jsonis a trimmed recording of the live public/modelscatalog (id, name, context_length, pricing; 469 models, recorded 2026-11-16).TestSuggestedModelsExistInCatalogFixturefails if any suggested id or the default is missing from it. The refresh command is in the test comment.catalog.goadds a cached public catalog (CachedPublicModels, 15 min TTL, keeps the last good copy if a refresh fails) with pricing parsed per token."-1"(variable) and missing prices count as unknown. The spoke (/api/openrouter/models) and hub handlers hide suggestions the live catalog no longer lists, and move the default to the first remaining suggestion if needed. If the catalog can't be read, the full curated list is served.Discovery fix
fetchModelsWithHeadersandprobeModelsWithHeadersalways appended/v1/models. OpenRouter's stored endpoint ishttps://openrouter.ai/api/v1, so the request went to/api/v1/v1/modelsand got a 404. The OpenRouter gateway form and agent dropdowns then fell back silently to unrelated static aliases, and the spoke's funding picker never had a live list. The newopenAIModelsURLmirrors how the proxy builds/chat/completions: an endpoint that ends in/v1gets/models.Searchable, grouped picker (
static-src/js/model-picker.js)input[role=combobox]owningul[role=listbox]). Typing filters on id and display name, with every term required. Options are grouped by provider prefix, and the curated suggestions are pinned in a "Suggested" group. Each option shows price per 1M input/output (and cached input) plus context length, or "price unknown". Keys: ArrowUp/ArrowDown, Enter, Escape. The typed text is the value, so "Custom…" (orUse "<id>" as a custom model id) is always available.<select>./api/config/governor/gateways/discover) and/api/inference/models/{backend}returnmodel_infoand the livesuggestedlist for OpenRouter gateways, matched by kind or byopenrouter.aihost.<select>s, because other code drives them by value and auto-heal. They now group large multi-provider lists into provider<optgroup>s, and the config dialog appends the price per 1M.config-dialog.css. The new markup has no inlinestyle=.Tests
openAIModelsURL,isOpenRouterGateway, and skippingattachOpenRouterModelInfofor other kinds.model_picker.test.js): filtering, grouping, the custom entry, price display, ARIA markup, and optgroup grouping. The 9945 harness now injectsmodelOptionPriceSuffix.🤖 Generated with Claude Code