DeepSeek V4 Flash/Pro 开了 thinking mode 后,多轮对话中 agent 调用工具时 API 返回 400:
{"error": "The `reasoning_content` in the thinking mode must be passed back to the API."}
这不是 Hermes 独有的 bug — Cursor、Continue.dev、RooCode、LangChain、OpenCode 全都有。根因是 DeepSeek 在 OpenAI 兼容协议上加了私有字段 reasoning_content,多数框架没有正确处理这个字段的 round-trip。
在消息发往 DeepSeek API 之前,自动:
reasoning_content — 所有 assistant 消息强制带上此字段(有内容保留内容,没有内容填空字符串)reasoning_content,防止泄漏reasoning 和 reasoning_content,加载时自动补全{type: "disabled"},防止 DeepSeek 默认开启 thinking#14933 — DeepSeek V4 thinking mode 初始 400 报告#15353 — tool-call 消息缺 reasoning_content#16137 — plain assistant 消息缺 reasoning_content#17400 — 间歇性丢失(同 session 某些消息有某些没有)#15213 — cron/auxiliary 路径完全没处理#16844 — 持久化字段名不一致:reasoning ≠ reasoning_content#15748 — 跨厂商切换时旧 RC 泄漏#17052 — 上一轮 stale reasoning 污染本轮#15700 — thinking:disabled 必须显式传入#17212 — direct API 缺 thinking control| 方案 | 安装复杂度 | 维护成本 | 效果 |
|---|---|---|---|
| ------ | ----------- | --------- | ------ |
| 本技能 ⭐ | 复制目录 + 改配置 | 自动,随 Hermes 升级兼容 | 覆盖全部路径 |
| 逐个合并上游 PR | 等 upstream 合入 | 每个 Hermes 版本重新检查 | 部分覆盖 |
| 手动改 run_agent.py | 改 ~50 行源码 | 每次升级重改 | 只覆盖主循环 |
| 换模型(不用 DeepSeek) | 改配置 | 无 | 但失去低成本推理 |
安装后开一个新的 Hermes 会话,使用 DeepSeek V4 Flash + thinking mode,进行至少 3 轮 tool-call 对话:
User: 查一下今天天气,然后搜索最近的新闻,最后总结一下
Agent: [调用 get_weather] → [调用 search_news] → [总结]
如果没有 400 错误,说明修复生效。
deepseek v4 flash pro thinking mode 400 reasoning_content fix hermes plugin
共 3 个版本