github / github/copilot-cli

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

未关闭
#4,680 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 CLI 入口点开始,跟踪如何选择配置的会话模型,并将其放入面向自定义端点的 API 请求中。使用 mimo-v2.5 的自定义端点重现该问题,然后验证请求保留该模型,且会话成功完成,而不会将其替换为 gpt-5.4-nano

由索引模型根据 Issue 内容生成。

评估

技术栈
powershell, shell
领域
api, cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。