[Bug] 工具执行崩溃后会话留下悬空 tool_call,后续所有回合报 400 insufficient tool messages following tool_calls message #1544
Replies: 1 comment
Your forensics are exact, and this is offline-detectable. It is the same The durable signal is the session log, so a static scan can catch it before any
I paired this against the real session-event schema and added it as an offline npx --yes github:boyin111-1/dsh-doctor # profile + manifest checks
npx --yes github:boyin111-1/dsh-doctor --session <your session.jsonl.zstd>It reports a hard error for an orphaned call in a completed turn (the |
Uh oh!
There was an error while loading. Please reload this page.
现象
Web GUI 中某个会话一旦在工具执行阶段崩溃,该会话从此所有后续请求(包括点"继续")都会失败,报错:
An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. (insufficient tool messages following tool_calls message)

环境
@deepseek-ai/dsh0.1.0-rc.6(npm 本地安装,Windows 11,Node 22.22)~/.dsh/sessions/)根因(已解包会话日志取证)
对会话日志(逐行 zstd 帧的 jsonl)分析后确认事件序列:
Cannot read properties of undefined (reading 'prepare')(grep、pwsh 均触发过),turn 以reason: error结束;tool/call只有 31 条tool/result,留下悬空 tool_call(call_00_xxx);复现步骤
建议
Cannot read properties of undefined (reading 'prepare')本身也应修复——疑似服务重启/热重载后工具运行时的 prepare 未初始化;All reactions