The current implementation seems to rely on model_picker_enabled being true however it's false for the only completion mode in use: gpt-41-copilot.
What I expect to see from :Copilot model:
Copilot: Current/only completions model is GPT-4.1 Copilot (gpt-41-copilot)
What I see instead:
Copilot: Could not retrieve completions models
Here is a minimal fix which makes it work:
diff --git a/autoload/copilot.vim b/autoload/copilot.vim
index dfdc443..936e975 100644
--- a/autoload/copilot.vim
+++ b/autoload/copilot.vim
@@ -774,7 +774,7 @@ function! s:commands.panel(opts) abort
endfunction
function! s:FmtModel(model) abort
- return a:model.modelName . ' (' . a:model.id . ')'
+ return a:model.name . ' (' . a:model.id . ')'
endfunction
function! s:commands.model(opts) abort
@@ -782,11 +782,11 @@ function! s:commands.model(opts) abort
return
endif
let client = copilot#Client()
- let response = client.Request('copilot/models', {}).Wait()
+ let response = client.Request('copilot/models/getModelMetadataList', {}).Wait()
if response.status ==# 'error'
return 'echoerr ' . string('Copilot: Error retrieving completions models: ' . response.error.message)
endif
- let models = filter(response.result, { _, m -> index(m.scopes, 'completion') >= 0 })
+ let models = filter(response.result.models, { _, m -> m.capabilities.type ==# 'completion' })
if len(models) == 0
echo 'Copilot: Could not retrieve completions models'
elseif len(models) == 1
The current implementation seems to rely on
model_picker_enabledbeingtruehowever it'sfalsefor the only completion mode in use:gpt-41-copilot.What I expect to see from
:Copilot model:What I see instead:
Here is a minimal fix which makes it work: