Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

":Copilot model" fails with "Copilot: Could not retrieve completions models"

Offen Anfängerfreundlich
#305 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
82/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
vim
Bereich
tooling

Rechercherichtung

Beginne in autoload/copilot.vim bei s:FmtModel() und s:commands.model() und untersuche anschließend die Antwortstruktur der Metadatenanfrage des completions-Modells. Überprüfe, dass der Befehl Modelle erkennt, die Vervollständigungen unterstützen, und die Nachricht für ein einzelnes Modell wie erwartet formatiert. Reproduziere das Problem mit :Copilot model und bestätige, dass GPT-4.1 Copilot statt des Abruffehlers gemeldet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
Vim Script
Sterne
11.7k
Forks
821
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/copilot.vim

Alle Issues in github/copilot.vim

Ähnliche Issues

Weitere Issues zu DevTools

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.