[GH-ISSUE #51] Cursor接入deepseek v4-pro会有问题 #17

Open
opened 2026-10-26 09:43:35 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @pfchu on GitHub (May 2, 2026).
Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/51

Cursor接入deepseek v4-pro使用的时候会提示 Provider returned error: {"error":{"message":"The reasoning_content in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}},

Originally created by @pfchu on GitHub (May 2, 2026). Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/51 Cursor接入deepseek v4-pro使用的时候会提示 Provider returned error: {"error":{"message":"The reasoning_content in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}},
Author
Owner

@FloaJa commented on GitHub (May 6, 2026):

遇到了同样问题

<!-- gh-comment-id:4384964548 --> @FloaJa commented on GitHub (May 6, 2026): 遇到了同样问题
Author
Owner

@Angela459 commented on GitHub (May 6, 2026):

可以看看这个项目,亲测能用
https://github.com/yxlao/deepseek-cursor-proxy

<!-- gh-comment-id:4385126066 --> @Angela459 commented on GitHub (May 6, 2026): 可以看看这个项目,亲测能用 https://github.com/yxlao/deepseek-cursor-proxy
Author
Owner

@tianhao8687 commented on GitHub (Aug 17, 2026):

这个报错的根因可以确定为“客户端丢失了推理状态”,不是模型名或余额问题。DeepSeek 当前的思考模式文档明确要求:只要某轮发生了工具调用,该轮 assistant 返回的 reasoning_content 就必须在后续请求中完整回传;否则服务端会返回这个 400。

Cursor 的通用 OpenAI-compatible 接入如果只保留 content、丢弃 reasoning_content,仅修改 Base URL 或模型名无法修好。可行方案有三种:

  1. 暂时关闭 thinking,先验证错误是否消失;
  2. 在 Cursor 与 DeepSeek 之间使用能原样保存并回传 reasoning_content 的适配层;
  3. 换用明确支持 DeepSeek reasoning 格式的客户端/Provider。

适配层需要保留完整的 assistant 消息(reasoning_content、content、tool_calls),再接上对应的 tool result。不要翻译、摘要或拼接改写 reasoning_content,必须原样回传。若关闭 thinking 后不再报错,基本就能确认是这一兼容问题。

<!-- gh-comment-id:5317545376 --> @tianhao8687 commented on GitHub (Aug 17, 2026): 这个报错的根因可以确定为“客户端丢失了推理状态”,不是模型名或余额问题。DeepSeek 当前的[思考模式文档](https://api-docs.deepseek.com/zh-cn/guides/thinking_mode)明确要求:只要某轮发生了工具调用,该轮 assistant 返回的 `reasoning_content` 就必须在后续请求中完整回传;否则服务端会返回这个 400。 Cursor 的通用 OpenAI-compatible 接入如果只保留 `content`、丢弃 `reasoning_content`,仅修改 Base URL 或模型名无法修好。可行方案有三种: 1. 暂时关闭 thinking,先验证错误是否消失; 2. 在 Cursor 与 DeepSeek 之间使用能原样保存并回传 `reasoning_content` 的适配层; 3. 换用明确支持 DeepSeek reasoning 格式的客户端/Provider。 适配层需要保留完整的 assistant 消息(`reasoning_content`、`content`、`tool_calls`),再接上对应的 tool result。不要翻译、摘要或拼接改写 `reasoning_content`,必须原样回传。若关闭 thinking 后不再报错,基本就能确认是这一兼容问题。
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/awesome-deepseek-agent#17
No description provided.