Draft
fix: show all chat models and handle auto-resolved model not in cache#1577
Conversation
for more information, see https://pre-commit.ci
…d accounts - client.lua: when resolve_model returns a model not in the cache (e.g. because model_picker_enabled is false for all models on a restricted account), fall back to the original model config so the request can still proceed with the correct model id. - providers.lua: when no models have model_picker_enabled=true, fall back to all chat models so the picker shows useful options instead of only showing Auto (Copilot). Fixes: Resolved model not found error when using Auto model on accounts where model_picker_enabled is false for all API models.
Copilot
AI
changed the title
[WIP] Fix models list to display all available options
fix: show all chat models and handle auto-resolved model not in cache
Jul 2, 2026
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.
On accounts where the Copilot API returns
model_picker_enabled: falsefor all models, the picker showed only "Auto (Copilot)", and selecting it crashed withResolved model not found: <model-id>.Changes
lua/CopilotChat/config/providers.lua—get_modelsPreviously filtered strictly to
model_picker_enabled = true. Now uses a two-pass approach: prefer picker-enabled models, but fall back to all chat models when none are picker-enabled. This ensures real models appear in the picker for restricted accounts.lua/CopilotChat/client.lua—Client:askWhen
resolve_modelreturns a model id not present in the cache (because it was filtered out), previously errored hard. Now falls back to the originating model's config (e.g. theautoentry) so the request proceeds with the correct model id set inoptions.model.id.