feat(router): discover route-target model lists live - #1305
Merged
Conversation
Route targets whose provider exposes a model-listing endpoint (OpenAI- compatible /models incl. Grok/DeepSeek/OpenRouter, Anthropic /models, Gemini ListModels) get their picker rows fetched live through a TTL cache, refreshed on route-menu opens and warmed at router start. Discovered ids append after the declared model and curated catalog, deduped; failures cache short and degrade to curated-only. New [router] discover_models toggle (default true), hot-swappable.
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.
What
Route pickers no longer depend solely on the hand-curated model catalog: every route target whose provider exposes a listing endpoint now gets its model rows fetched live, additively.
router/discovery.rs): OpenAI-compatibleGET /models(OpenAI, Grok, DeepSeek, OpenRouter, Responses backends), AnthropicGET /models(x-api-key+ version header), GeminiListModels(filtered togenerateContent-capable,models/prefix stripped). Azure (deployment-scoped listing) and Meta (no public surface) deliberately keep curated lists; OAuth/subscription targets keep their seed/configured lists.profile_model_listorder is declared model → curated catalog → discovered ids (deduped, endpoint order — OpenRouter returns newest-first, so stealth ids surface near the top of the tail). Applies to both the route menu and the native-harness published catalogs, which share the list builder.[router] discover_models = true(default) — setfalseto suppress the listing requests entirely; hot-swappable via the config supervisor like the rest of[router].Testing
cargo test --workspace: all 57 suites green.data[].id, recency-ordered,stealth/ox-alphapresent).No recording: the visible change is extra rows in the existing scrollable model column, driven by whichever keys are present in the running daemon's env.
🤖 Generated with Claude Code