BYOK: populate the /model picker from the provider's /models endpoint
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
Problem
When the CLI runs against a custom provider (COPILOT_PROVIDER_BASE_URL), exactly one model can be configured (COPILOT_MODEL / COPILOT_PROVIDER_MODEL_ID). In-session, /models shows only that single configured model — there is no way to browse or switch models without quitting and relaunching with --model (which must be guessed, since nothing lists what the provider serves).
Request
For COPILOT_PROVIDER_TYPE=openai (and azure), populate the model picker from the provider's standard OpenAI-compatible catalog endpoint:
GET {COPILOT_PROVIDER_BASE_URL}/models
- Fall back silently to today's single-model behavior when the endpoint 404s or errors.
data[].idis enough for a useful picker; if present,capabilities.limits/supported_endpointsstyle metadata could fill the Context column the way the native picker does.
A lighter-weight alternative (or complement): a COPILOT_PROVIDER_MODELS env var accepting a comma-separated id list, for providers whose catalog endpoint can't be reached at startup.
Why it matters
Practically every OpenAI-compatible backend already serves /models — Ollama, vLLM, LiteLLM, Azure, and enterprise LLM gateways. We operate such a gateway: it fronts the Copilot API itself (billing stays on the user's Copilot seat) and serves GET /models with exactly the models the seat's plan/org policy allows — but the CLI never asks, so enrolled users see a one-entry picker and file "the CLI is broken" reports, while the native CLI right next to it shows the full list.
Observed on v1.0.77 and v1.0.78 (linux-x64 and darwin-arm64).
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Verfolge den /models-Picker der CLI und die Konfiguration benutzerdefinierter Provider, um herauszufinden, wo die aktuelle Liste mit einem einzelnen Modell zusammengestellt wird. Beginne mit der Prüfung der OpenAI- und Azure-Provider-Pfade sowie ihrer bestehenden Fehlerbehandlung. Erledigt ist dies, wenn eine erfolgreiche /models-Antwort Modell-IDs liefert, während 404s oder andere Fehler das aktuelle Verhalten mit einem einzelnen Modell beibehalten; die optionalen Metadaten und die Alternative über Umgebungsvariablen bleiben Designentscheidungen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- shell
- Bereich
- api, cli
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100