github / github/copilot-cli

CLI sends wrong model ID to custom OpenAI-compatible endpoint, killing the session

Ouverte
#4,680 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

triage
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

Bug Report: CLI sends wrong model ID to custom OpenAI-compatible endpoint

Describe the bug

When using a custom OpenAI-compatible endpoint with a non-OpenAI model name (e.g. mimo-v2.5), the CLI sends gpt-5.4-nano as the model in the API request body instead of the configured model name. The custom endpoint rejects the unknown model with HTTP 401, retries exhaust, and the session terminates.

Affected version

1.0.82 (output of copilot --version)

Steps to reproduce the behavior

  1. Configure a custom OpenAI-compatible endpoint with a non-OpenAI model name (e.g. mimo-v2.5) as the session model
  2. Start or resume a Copilot CLI session targeting that endpoint
  3. Send any prompt (e.g. hello)
  4. The session fails within seconds

Expected behavior

The CLI should send the configured model name (e.g. mimo-v2.5) in the model field of the API request body, without internal substitution.

Observed behavior

The session event log shows the model field is overridden to gpt-5.4-nano before the API call:

model_call_started → "model":"gpt-5.4-nano"   (expected: "mimo-v2.5")
model_call_failure → HTTP 401, body: "Model gpt-5.4-nano is not supported"
turn_retry         → reason: "transient_auth_error"
session.error      → "Failed to get response from the AI model;
                      retried 5 times (total retry wait time: 31.26 seconds)
                      Last error: 500 Internal server error"

Note: The retry log shows 3 logged retries but the session error reports 5 total — some retries may have occurred before logging began.

Additional context

  • The endpoint's GET /v1/models lists mimo-v2.5 as available
  • Direct API call with "model":"mimo-v2.5" → HTTP 200 (works)
  • Direct API call with "model":"gpt-5.4-nano" → HTTP 401 (model does not exist on this endpoint)
  • gpt-5.4-nano is an OpenAI model — it appears the CLI maps unrecognized model names to gpt-5.4-nano before sending, which breaks custom endpoints that don't host that model
  • The HTTP 401 comes from the custom endpoint; the final HTTP 500 comes from the CLI's retry layer after all attempts are exhausted
  • OS: Windows, PowerShell

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le point d’entrée de la CLI et suivez la manière dont le modèle de session configuré est sélectionné et placé dans la requête d’API pour les endpoints personnalisés. Reproduisez le problème avec un endpoint personnalisé utilisant mimo-v2.5, puis vérifiez que la requête conserve ce modèle et que la session se termine correctement sans le remplacer par gpt-5.4-nano.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
powershell, shell
Domaine
api, cli
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
65/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.