From 86cefc5cc541051e75c38776e5f2a02b068257b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 03:01:31 +0000 Subject: [PATCH 1/3] Initial plan From 73819edee947d61f89f7139a05d39a06d9469674 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 03:02:03 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/pullfrog.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index 6516ae2e..d5030252 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -34,22 +34,21 @@ jobs: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - GOOGLE_GENERATIVE_AI_API_KEY: - ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} + GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} XAI_API_KEY: ${{ secrets.XAI_API_KEY }} DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }} OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} - + # for Amazon Bedrock (https://docs.pullfrog.com/bedrock) # AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }} # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS_REGION: us-east-1 # BEDROCK_MODEL_ID: - + # for Google Vertex AI (https://docs.pullfrog.com/vertex) # VERTEX_SERVICE_ACCOUNT_JSON: ${{ secrets.VERTEX_SERVICE_ACCOUNT_JSON }} # GOOGLE_CLOUD_PROJECT: my-project From efa8b6ecc7016b930d13968da2a57fa2341ba6f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 03:07:40 +0000 Subject: [PATCH 3/3] fix: handle missing resolved model and restricted model_picker_enabled 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. --- lua/CopilotChat/client.lua | 9 +++++---- lua/CopilotChat/config/providers.lua | 15 +++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lua/CopilotChat/client.lua b/lua/CopilotChat/client.lua index 7bbc65d8..5a9898f3 100644 --- a/lua/CopilotChat/client.lua +++ b/lua/CopilotChat/client.lua @@ -323,10 +323,11 @@ function Client:ask(opts) local headers = self:authenticate(provider_name) local resolved_model = provider.resolve_model(headers, opts.model) opts.model = resolved_model - model_config = models[opts.model] - if not model_config then - error('Resolved model not found: ' .. opts.model) - end + -- The resolved model may not be present in the models cache when + -- model_picker_enabled is false for all API models (e.g. restricted accounts). + -- Fall back to the original config (e.g. from the 'auto' entry) so the + -- request can still be sent with the correct model id. + model_config = models[opts.model] or model_config end local options = { diff --git a/lua/CopilotChat/config/providers.lua b/lua/CopilotChat/config/providers.lua index ea5eea71..7ba89657 100644 --- a/lua/CopilotChat/config/providers.lua +++ b/lua/CopilotChat/config/providers.lua @@ -635,11 +635,18 @@ M.copilot = { error(err) end + -- Get all chat models, preferring those with model_picker_enabled. + -- Fall back to all chat models if none are picker-enabled (e.g. restricted accounts). + local all_chat_data = vim.tbl_filter(function(model) + return model.capabilities and model.capabilities.type == 'chat' + end, response.body.data) + + local picker_enabled_data = vim.tbl_filter(function(model) + return model.model_picker_enabled + end, all_chat_data) + local models = vim - .iter(response.body.data) - :filter(function(model) - return model.capabilities.type == 'chat' and model.model_picker_enabled - end) + .iter(#picker_enabled_data > 0 and picker_enabled_data or all_chat_data) :map(function(model) local supported_endpoints = model.supported_endpoints or {} -- Pre-compute whether this model uses the Responses API