BYOK: populate the /model picker from the provider's /models endpoint
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
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).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
CLI の /models ピッカーとカスタムプロバイダーの設定を追跡し、現在の単一モデルのリストがどこで組み立てられているかを確認します。まず OpenAI および Azure プロバイダーのパスと、既存のエラーハンドリングを確認してください。/models の成功レスポンスでモデル ID が返され、404 やその他のエラーでは現在の単一モデルの動作が維持されれば完了です。オプションのメタデータと環境変数による代替手段は、引き続き設計上の選択とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- api, cli
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100