AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug]deepseek總是出現400報錯

Open stanley-1028 opened this issue 6 months ago • 5 comments

What happened / 发生了什么

用 /new 后可以正常对话,但在几次工具调用后,机器人会报 400 错误且不再回复

Reproduce / 如何复现?

详细写出你的操作步骤,比如:1. 使用 /new 开始对话;2. 发送一个需要调用 MCP 工具的问题;3. 正常对话几轮后,错误出现。

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot 版本:v4.24.2 部署方式:Windows Docker Desktop 使用的提供商:deepseek 使用的消息平台适配器:discord

OS

Windows

Logs / 报错日志

[2026-05-04 19:50:33.937] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['astrbot_grep_tool', 'astrbot_grep_tool', 'astrbot_execute_shell'] [2026-05-04 19:50:33.937] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_grep_tool,参数:{'pattern': 'TODO|FIXME|HACK|XXX|todo', 'path': 'C:\Users\user\Desktop\francium-loader', 'glob': '*.java'} [2026-05-04 19:50:34.069] [Core] [INFO] [agent_sub_stages.internal:189]: Follow-up ticket already consumed, stopping processing. umo=小A:FriendMessage:1491081639491670047, seq=1 [2026-05-04 19:50:34.071] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_grep_tool Result: No matches found.

[SYSTEM NOTICE] User sent follow-up messages while tool execution was in progress. Prioritize these follow-up instructions in your next actions. In your very next action, briefly acknowledge to the user that their follow-up message(s) were received before continuing.

  1. 好的,我再來掃一下程式碼中是否有遺留的 TODO 或未完成的實作: [2026-05-04 19:50:34.071] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_grep_tool,参数:{'pattern': 'unimplemented|not implemented|stub|placeholder', 'path': 'C:\Users\user\Desktop\francium-loader', 'glob': '*.java'} [2026-05-04 19:50:34.117] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_grep_tool Result: No matches found. [2026-05-04 19:50:34.117] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && git status 2>nul || echo NOT_A_GIT_REPO', 'timeout': 10} [2026-05-04 19:50:34.296] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_execute_shell Result: {"stdout": "On branch main\nYour branch is up to date with 'origin/main'.\n\nChanges not staged for commit:\n (use "git add ..." to update what will be committed)\n (use "git restore ..." to discard changes in working directory)\n\tmodified: build.gradle\n\tmodified: francium-ai-bridge/build.gradle\n\tmodified: francium-core/build.gradle\n\tmodified: francium-manager/build.gradle\n\tmodified: francium-profiler/build.gradle\n\tmodified: francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java\n\tmodified: francium-resolver/build.gradle\n\tmodified: francium-server/build.gradle\n\nUntracked files:\n (use "git add ..." to include in what will be committed)\n\tDEVELOPER_GUIDE.md\n\tdocker/\n\tdocs/CLI_GUIDE.md\n\tdocs/DEVELOPER_GUIDE.md\n\tdocs/DEVELOPER_GUIDE_CN.md\n\tdocs/DEVELOPER_GUIDE_EN.md\n\tdocs/promo/\n\texamples/ai-bridge-demo/\n\texamples/build.gradle.template\n\tfrancium-ai-bridge/src/test/java/com/francium/AIBridgeDemo.java\n\tfrancium-mod-template/\n\tfrancium-profiler/src/main/java/com/francium/profiler/report/\n\tfrancium-profiler/src/main/java/com/francium/profiler/visualize/\n\tjitpack.yml\n\nno changes added to commit (use "git add" and/or "git commit -a")\n", "stderr": "", "exit_code": 0} [2026-05-04 19:50:38.672] [Core] [INFO] [respond.stage:183]: Prepare to send - 小A/1481157675256512614: 再來看未提交的具體改動內容: [2026-05-04 19:50:39.286] [Core] [INFO] [core.event_bus:61]: [default] [小A(discord)] 小A/1481157675256512614: 再來看未提交的具體改動內容: [2026-05-04 19:50:39.294] [Core] [INFO] [process_stage.follow_up:190]: Captured follow-up message for active agent run, umo=小A:FriendMessage:1491081639491670047, order_seq=11 [2026-05-04 19:50:39.316] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['astrbot_execute_shell', 'astrbot_execute_shell'] [2026-05-04 19:50:39.318] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && git diff --stat 2>nul', 'timeout': 10} [2026-05-04 19:50:39.414] [Core] [INFO] [agent_sub_stages.internal:189]: Follow-up ticket already consumed, stopping processing. umo=小A:FriendMessage:1491081639491670047, seq=2 [2026-05-04 19:50:39.414] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_execute_shell Result: {"stdout": " build.gradle | 55 ++++++++++++++++++++++\n francium-ai-bridge/build.gradle | 2 +\n francium-core/build.gradle | 2 +\n francium-manager/build.gradle | 2 +\n francium-profiler/build.gradle | 2 +\n .../francium/profiler/memory/MemoryManager.java | 7 +++\n francium-resolver/build.gradle | 2 +\n francium-server/build.gradle | 2 +\n 8 files changed, 74 insertions(+)\n", "stderr": "", "exit_code": 0}

[SYSTEM NOTICE] User sent follow-up messages while tool execution was in progress. Prioritize these follow-up instructions in your next actions. In your very next action, briefly acknowledge to the user that their follow-up message(s) were received before continuing.

  1. 再來看未提交的具體改動內容: [2026-05-04 19:50:39.415] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && git diff -- francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java 2>nul', 'timeout': 10} [2026-05-04 19:50:39.492] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_execute_shell Result: {"stdout": "diff --git a/francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java b/francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java\nindex 2445db2..130277d 100644\n--- a/francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java\n+++ b/francium-profiler/src/main/java/com/francium/profiler/memory/MemoryManager.java\n@@ -143,6 +143,13 @@ public class MemoryManager {\n return new ArrayList<>(perModMemory.values());\n }\n \n+ /**\n+ * 獲取洩漏報告列表。\n+ */\n+ public List getLeakReports() {\n+ return new ArrayList<>(leakReports);\n+ }\n+\n public void shutdown() {\n monitor.shutdown();\n forceGC();\n", "stderr": "", "exit_code": 0}

[SYSTEM NOTICE] By the way, you have executed the same tool astrbot_execute_shell 3 times consecutively. Double-check whether another tool, different arguments, or a summary would move the task forward better. [2026-05-04 19:51:00.555] [Core] [INFO] [meme_manager.main:1070]: [meme_manager] 去重后的最终表情列表: ['work'] [2026-05-04 19:51:00.563] [Core] [INFO] [respond.stage:183]: Prepare to send - 小A/1481157675256512614: 🤔 思考: Now I have a complete picture of the project state. Let me compile this information for the user. Here's what I've found:

Committed (已提交到 Git)

  • All 6 core submodules (francium-core, ai-bridge, resolver, manager, profiler, server)
  • Test suite (70/70 passing)
  • CI pipeline
  • Build system (Gradle + build.sh/bat)
  • Documentation (ARCHITECTURE.md, README.md, CONTRIBUTING.md)
  • FranciumDemo.java, TestRunner.java

Modified but not staged (已修改未提交)

  • build.gradle (根) - +55 lines (major build system upgrade)
  • All 6 subproject build.gradle files - +2 each (added apply plugin: 'java')
  • MemoryManager.java - +7 lines (added getLeakReports() for ProfilerReport)

Untracked (新增但未追蹤)

  • DEVELOPER_GUIDE.md (根目錄)
  • docker/ (完整 Docker 部署方案)
  • docs/CLI_GUIDE.md, DEVELOPER_GUIDE.md, DEVELOPER_GUIDE_CN.md, DEVELOPER_GUIDE_EN.md, promo/
  • examples/ai-bridge-demo/ (可運行 AI Bridge 演示)
  • examples/build.gradle.template
  • francium-ai-bridge/src/test/java/com/francium/AIBridgeDemo.java
  • francium-mod-template/ (完整模組開發模板)
  • francium-profiler/src/main/java/com/francium/profiler/report/ (ProfilerReport.java)
  • francium-profiler/src/main/java/com/francium/profiler/visualize/ (ReportViewer.java)
  • jitpack.yml

Known Issues from CHANGELOG:

  1. ASM-dependent modules (AdapterGenerator, BytecodeAnalyzer) require Gradle build
  2. SAT solver O(n²) scaling above 500 mods → OR-Tools integration pending
  3. No end-to-end Minecraft integration test yet
  4. gradle-wrapper.jar must be generated locally or via GitHub Actions

From analysis notes - Roadmap P0-P2: P0 (发布准备):

  • [x] 核心测试通过 (70/70)
  • [x] CI 就位
  • [ ] 发布到 GitHub Releases
  • [ ] Quick Start 文档 (在 salute 中使用)

P1 (功能完善):

  • [ ] SAT 依赖解析器优化 (O(n²) → 集成 OR-Tools)
  • [ ] 跨版本 AI 桥接深度学习模型替换加权特征
  • [ ] Mixin 集成 (类似 Fabric Mixin)
  • [ ] 反混淆映射完善

P2 (生态建设):

  • [ ] 示例 mod 完善
  • [ ] 开发文档
  • [ ] Maven Central / JitPack 发布
  • [ ] 与 salute 深度集成测试
  • [ ] Web mod registry
  • [ ] IDE 插件
  • [ ] 沙箱模式 + 热重载

Let me present this to the user in a clear, organized way. 好的,我已經全面掌握了專案狀況!以下是完整的狀態報告 :


📊 francium-loader 當前狀態總覽

✅ 已完成(已提交 Git)

項目 狀態
6 大核心模組(core/ai-bridge/resolver/manager/profiler/server) ✅ 全部實作
測試套件(70/70 全部通過) ✅
GitHub Actions CI(Ubuntu + Windows 雙平台) ✅
Gradle 構建系統 + build.sh/bat 獨立編譯 ✅
文件:README / CHANGELOG / ARCHITECTURE / CONTRIBUTING ✅

🔶 未提交變動(已修改或新增但未 commit)

已修改(8 個文件,+74 行):

檔案 改動
build.gradle(根) +55 行,Maven 發布配置大升級
6 個子模組的 build.gradle 各 +2 行,補上 apply plugin: 'java'
MemoryManager.java +7 行,新增 getLeakReports() 供 ProfilerReport 使用

新增未追蹤的重要檔案:

類別 內容
📘 開發者指南 DEVELOPER_GUIDE.md(中英文版)、CLI_GUIDE.md
🐳 Docker 部署 完整方案(Dockerfile + Compose + entrypoint)
🧩 模組模板 francium-mod-template/ — 可 fork 直接開發
🤖 AI Bridge 演示 examples/ai-bridge-demo/ — 獨立可執行 Demo
📊 效能報告 ProfilerReport.java + ReportViewer.java(視覺化)
📦 JitPack 配置 jitpack.yml — 一行依賴引入
📁 Promo 素材 docs/promo/(空目錄,待填充)

⚠️ 已知問題與待辦事項

P0 — 發布準備(最優先)

  • 發佈 GitHub Releases(alpha 標籤已就緒)
  • Quick Start 文件:在 salute 中使用 francium-loader 的入門指南
  • 提交所有未 commit 變動(上述 8 個已改 + 一堆新檔案)
  • gradle-wrapper.jar 需本地生成或 CI 生成

P1 — 功能完善

  • SAT 解析器優化:500+ 模組時 O 擴展問題,需整合 OR-Tools
  • AI 橋接強化:加權特徵 → 深度學習模型替換
  • Mixin 整合:類似 Fabric Mixin 的運行時程式碼注入
  • 反混淆映射完善:Mojang / Yarn / SRG 三層映射補全

P2 — 生態建設

  • 端到端 Minecraft 整合測試(目前 LaunchWrapper 整合完成但未測試)
  • 與 salute 深度整合測試
  • Maven Central / JitPack 正式發布
  • Web mod registry(模組倉庫網站)
  • IDE 插件(IntelliJ / VS Code)
  • 沙箱模式 + 熱重載

你覺得想先從哪個方向下手?比如:

  1. 🚀 先把未 commit 的檔案整理提交,準備發第一個 Release?
  2. 🔧 看看核心程式碼,確認有無需要修的 Bug?
  3. 📋 把 README 的 TODO List 補上具體行動計畫? [2026-05-04 19:51:00.564] [Core] [WARN] [v4.24.2] [discord.discord_platform_event:266]: [Discord] 消息内容超过2000字符,将被截断。 [2026-05-04 19:51:01.324] [Core] [INFO] [core.event_bus:61]: [default] [小A(discord)] 小A/1481157675256512614: 🤔 思考: Now I have a complete picture of the project state. Let me compile this information for the user. Here's what I've found:

Committed (已提交到 Git)

  • All 6 core submodules (francium-core, ai-bridge, resolver, manager, profiler, server)
  • Test suite (70/70 passing)
  • CI pipeline
  • Build system (Gradle + build.sh/bat)
  • Documentation (ARCHITECTURE.md, README.md, CONTRIBUTING.md)
  • FranciumDemo.java, TestRunner.java

Modified but not staged (已修改未提交)

  • build.gradle (根) - +55 lines (major build system upgrade)
  • All 6 subproject build.gradle files - +2 each (added apply plugin: 'java')
  • MemoryManager.java - +7 lines (added getLeakReports() for ProfilerReport)

Untracked (新增但未追蹤)

  • DEVELOPER_GUIDE.md (根目錄)
  • docker/ (完整 Docker 部署方案)
  • docs/CLI_GUIDE.md, DEVELOPER_GUIDE.md, DEVELOPER_GUIDE_CN.md, DEVELOPER_GUIDE_EN.md, promo/
  • examples/ai-bridge-demo/ (可運行 AI Bridge 演示)
  • examples/build.gradle.template
  • francium-ai-bridge/src/test/java/com/francium/AIBridgeDemo.java
  • francium-mod-template/ (完整模組開發模板)
  • francium-profiler/src/main/java/com/francium/profiler/report/ (ProfilerReport.java)
  • francium-profiler/src/main/java/com/francium/profiler/visualize/ (ReportViewer.java)
  • jitpack.yml

Known Issues from CHANGELOG:

  1. ASM-dependent modules (AdapterGenerator, BytecodeAnalyzer) require Gradle build
  2. SAT solver O(n²) scaling above 500 mods → OR-Tools integration pending
  3. No end-to-end Minecraft integration test yet
  4. gradle-wrapper.jar must be generated locally or via GitHub Actions

From analysis notes - Roadmap P0-P2: P0 (发布准备):

  • [x] 核心测试通过 (70/70)
  • [x] CI 就位
  • [ ] 发布到 GitHub Releases
  • [ ] Quick Start 文档 (在 salute 中使用)

P1 (功能完善):

  • [ ] SAT 依赖解析器优化 (O(n²) → 集成 OR-Tools)
  • [ ] 跨版本 AI 桥接深度学习模型替换加权特征
  • [ ] Mixin 集成 (类似 Fabric Mixin)
  • [ ] 反混淆映射完善

P2 (生态建设):

  • [ ] 示例 mod 完善
  • [ ] 开发文档
  • [ ] Maven Central / JitPack 发布
  • [ ] 与 salute 深度集成测试
  • [ ] Web mod registry
  • [ ] IDE 插件
  • [ ] 沙箱模式 + 热重载

Let me present this to the user in a clear, organize [2026-05-04 19:51:05.724] [Core] [INFO] [respond.stage:183]: Prepare to send - 小A/1481157675256512614: 好的,先來檢查 Gradle Wrapper 的狀況,再嘗試編譯! [2026-05-04 19:51:06.434] [Core] [INFO] [core.event_bus:61]: [default] [小A(discord)] 小A/1481157675256512614: 好的,先來檢查 Gradle Wrapper 的狀況,再嘗試編譯! [2026-05-04 19:51:06.459] [Core] [INFO] [process_stage.follow_up:190]: Captured follow-up message for active agent run, umo=小A:FriendMessage:1491081639491670047, order_seq=12 [2026-05-04 19:51:06.527] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['astrbot_execute_shell', 'astrbot_execute_shell'] [2026-05-04 19:51:06.528] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && if exist gradlew (echo GRADLEW_EXISTS) else (echo NO_GRADLEW)', 'timeout': 5} [2026-05-04 19:51:06.600] [Core] [INFO] [agent_sub_stages.internal:189]: Follow-up ticket already consumed, stopping processing. umo=小A:FriendMessage:1491081639491670047, seq=0 [2026-05-04 19:51:06.601] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_execute_shell Result: {"stdout": "GRADLEW_EXISTS\r\n", "stderr": "", "exit_code": 0}

[SYSTEM NOTICE] User sent follow-up messages while tool execution was in progress. Prioritize these follow-up instructions in your next actions. In your very next action, briefly acknowledge to the user that their follow-up message(s) were received before continuing.

  1. 好的,先來檢查 Gradle Wrapper 的狀況,再嘗試編譯! [2026-05-04 19:51:06.602] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && if exist gradle\wrapper\gradle-wrapper.jar (echo WRAPPER_JAR_EXISTS) else (echo NO_WRAPPER_JAR)', 'timeout': 5} [2026-05-04 19:51:06.664] [Core] [INFO] [runners.tool_loop_agent_runner:1222]: Tool astrbot_execute_shell Result: {"stdout": "WRAPPER_JAR_EXISTS\r\n", "stderr": "", "exit_code": 0} [2026-05-04 19:51:09.678] [Core] [INFO] [respond.stage:183]: Prepare to send - 小A/1481157675256512614: Gradle Wrapper 都存在!來試試編譯 [2026-05-04 19:51:10.222] [Core] [INFO] [core.event_bus:61]: [default] [小A(discord)] 小A/1481157675256512614: Gradle Wrapper 都存在!來試試編譯 [2026-05-04 19:51:10.242] [Core] [INFO] [process_stage.follow_up:190]: Captured follow-up message for active agent run, umo=小A:FriendMessage:1491081639491670047, order_seq=13 [2026-05-04 19:51:10.255] [Core] [INFO] [runners.tool_loop_agent_runner:975]: Agent 使用工具: ['astrbot_execute_shell'] [2026-05-04 19:51:10.255] [Core] [INFO] [runners.tool_loop_agent_runner:1025]: 使用工具:astrbot_execute_shell,参数:{'command': 'cd /d "C:\Users\user\Desktop\francium-loader" && gradlew.bat build -x test 2>&1', 'timeout': 300} [2026-05-04 19:51:36.725] [Core] [INFO] [runners.tool_loop_agent_runner:1350]: Agent execution was requested to stop by user. [2026-05-04 19:51:36.727] [Core] [INFO] [meme_manager.main:1070]: [meme_manager] 去重后的最终表情列表: [] [2026-05-04 19:51:36.795] [Core] [INFO] [routes.live_chat:188]: [Live Chat] WebSocket 连接关闭: stanley1028 [2026-05-04 20:43:41.615] [Core] [INFO] [core.event_bus:61]: [default] [小A(discord)] stanley1028/1417825792045351012: 你再幫我檢察francium-loader和salute launcher還有什麼東西要完善和改進,如果你發現問題,那你就直接解決吧,還有,改善完之後,記得測試它是否能用,測試完之後記得報告我.salute launcher那裡的圖標,介面,名字什麼的的風格皆要轉為現代風格的,ok?

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • [ ] Yes!

Code of Conduct

stanley-1028 avatar May 04 '26 13:05 stanley-1028

这个问题已经被多次报告并修复过,主要有两个相关原因:

  1. reasoning_content 丢失导致 400 错误:DeepSeek 推理模型要求后续请求必须回传 reasoning_content 字段,AstrBot 在上下文清洗/压缩时会丢弃该字段。此问题在 v4.23.6 中已修复 [1]。你当前使用的是 v4.24.2,应该已包含此修复。

  2. skills_like 两阶段工具下发模式兼容性问题:如果你使用的是「两阶段」工具下发模式(skills_like),DeepSeek 会因为空 tool_calls 列表而报 400 错误 [2]。建议将工具下发模式改为「Full 完整下发」,在 AstrBot 管理面板中修改即可 [1]。

另外从你的日志来看,对话中涉及大量工具调用(grep、shell 等),上下文会快速膨胀。你可以:

  • 使用 /new 清除对话历史后重新开始
  • 确认工具下发模式设置为 Full(完整下发) 而非两阶段模式

如果改为 Full 模式后仍然出现 400 错误,建议贴出具体的 400 错误信息(目前日志中没有显示具体的 error message),以便进一步排查。

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about AstrBot Share Dosu with your team

dosubot[bot] avatar May 04 '26 13:05 dosubot[bot]

建议升级到最新版本。新版本解决了 400 的问题。

Soulter avatar May 04 '26 14:05 Soulter

Image Image ......

stanley-1028 avatar May 05 '26 14:05 stanley-1028

我用的是discord,不是什麼qq......

stanley-1028 avatar May 06 '26 14:05 stanley-1028

@stanley-1028 deepseek v4不支持image输入,你可以看一下模型配置那里是不是选择了图像

Soulter avatar May 09 '26 13:05 Soulter