github / github/copilot-cli

Can´t use DeepSeek API

未关闭
#2,995 8 条评论 9 个 reaction 已指派 0 人 在 GitHub 查看
area:configuration area:models
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

When I run the following command:

```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```

When I make a question to the copilot, I get this answer back:

```
● Request failed (transient_bad_request). Retrying...
● Request failed (transient_bad_request). Retrying...
✗ 400 The `reasoning_content` in the thinking mode must be passed back to the API.
```

I confirm that the DeepSeek API needs the entire reasoning_content field to be returned back to the API every time. In my own code I had the same problem and could rapidly fix the issue by sending back the the entire conversation.

### Affected version

_No response_

### Steps to reproduce the behavior

I run the following command:

```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```

Ensure to have a valid api key for the DeepSeek endpoint

### Expected behavior

I expect the request to be fulfilled.

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

首先,使用文档中记录的 DeepSeek 环境变量,通过 `copilot` 入口复现该问题,并检查请求对话是如何组装的。当完整的 `reasoning_content` 被传回 DeepSeek API,且请求在没有 400 错误的情况下成功时,修复就完成了。

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

评估

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

把新 issue 发到你的邮箱

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