GPT 切换到 DeepSeek V4 后携带不兼容的 exec 工具,AI 分析返回 400
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: suimingjun
**客户端版本**: 0.1.46
---
## 现象
在 Cindy 中使用 GPT 进行工作区 AI 分析后,切换到 DeepSeek V4,再发起分析请求会失败。问题发生在模型请求的工具参数适配阶段,不是被分析的日志、代码或 P4 内容本身导致。
## 复现步骤
1. 使用 GPT 模型进行工作区 AI 分析。
2. 切换到 DeepSeek V4。
3. 发起新的 AI 分析请求,或在切换后的会话中继续请求。
4. 请求返回 400,未生成分析结果。
当前确认该问题主要在“从 GPT 切换到 DeepSeek V4”后复现;直接使用 DeepSeek 的场景尚未单独确认。
## 期望行为
切换模型后,Cindy 应根据目标模型的能力重新构造请求,过滤不兼容的工具和输入格式,使 DeepSeek V4 至少能够完成不需要工具的纯文本分析。
## 实际行为
请求返回:
```text
litellm.BadRequestError: DeepseekException - {"error":{"message":"Unsupported custom tool: 'exec'. Only 'apply_patch' is supported.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}
```
## 复现频率
目前确认:从 GPT 切换到 DeepSeek V4 后复现。重试和新建 DeepSeek 会话后仍然失败。
## 已尝试
- 重试请求;
- 新建 DeepSeek 会话;
- 问题仍然存在。
## 脱敏诊断摘要
- 失败模型为 DeepSeek V4 Pro。
- DeepSeek 会话启动成功,但首个模型请求立即因工具参数校验失败。
- 新建会话也能复现,因此不太像旧会话上下文残留。
- 错误明确指出请求携带了 DeepSeek 当前不支持的 custom tool `exec`,并提示仅支持 `apply_patch`。
- 历史上还出现过 DeepSeek 不接受 `image_url` 的兼容性错误,可能说明模型切换时工具和输入能力没有完全隔离。
## 初步判断
GPT 与 DeepSeek 切换后,Agent 工具集合可能没有按模型重新隔离。DeepSeek V4 请求仍携带了通用的 `exec` 工具,导致 LiteLLM/DeepSeek 在请求发送阶段返回 400。
建议检查:
- 模型切换时是否重新生成工具列表;
- DeepSeek V4 是否应移除 `exec` 及不兼容的 MCP custom tools;
- 无可用工具时是否同时移除 `tools` 和 `tool_choice`;
- 是否需要过滤 DeepSeek 不支持的 `image_url` 输入;
- GPT 与 DeepSeek 是否错误复用了同一套模型能力配置。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.26200)
**界面语言**: zh-CN
Contributor guide
Research direction
Start by tracing model switching into the request tool-generation and input-adaptation paths, then reproduce a GPT-to-DeepSeek V4 transition with a pure-text analysis request. Check how tools, tool_choice, and image inputs are selected for the target model; done means DeepSeek requests no longer include unsupported exec tools or inputs and a tool-free analysis succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100