Replies: 1 comment
|
Hi @snow-The, We investigated your report in depth and confirmed the behavior you described — Our analysis found two additional things that may be relevant:
We filed a separate report covering the full failure surface, detailed evidence chain, and fix proposals reusing
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
工具调用失败(调度器缺失)会在会话历史留下悬挂的 tool_calls,之后该会话永久卡死,每个请求都被模型 API 以 400 拒绝,且没有任何自动恢复手段。
复现、预期与验收
@deepseek-ai/dsh-tools带进 profile 依赖图的插件(如@snow-the/dsh-busyloop@0.1.6曾把 dsh-tools 声明为运行时依赖),或任何导致 profile node_modules 重链后立即重启的操作。tool/call事件落盘后,工具执行抛Cannot read properties of undefined (reading 'prepare'),没有tool/result事件;turn 以 error 结束。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)(INVALID_REQUEST,400)——会话永久卡死,无法继续。tool/result(如 isError 消息)落盘,保证"assistant 的 tool_calls 后面必有 tool messages"这一 API 不变量;会话应能继续。@deepseek-ai/dsh@0.1.1-rc.2(npm 全局),web profile。根因定位(附带证据)
崩溃发生在
dsh-agent-loop的工具调度路径:TOOL_RUNTIME_SCHEDULER是@deepseek-ai/dsh-tools导出的Symbol。当ctx.tools实例来自另一个 dsh-tools 模块实例(例如 profile 安装重链窗口期产生的第二个模块实例)时,ctx.tools[symbol]为undefined,此处直接抛Cannot read properties of undefined (reading 'prepare'),而appendToolCall已经先一步把 assistant 的 tool_calls 写进了会话事件流(tool/call事件已落盘),错误路径没有补写tool/result。会话文件中的事件序列(实测):
建议修复
在
startCall/调度路径上对ctx.tools[TOOL_RUNTIME_SCHEDULER]缺失或 prepare 抛错的情况兜底:为每个已落盘tool/call的调用补写一条错误tool/result(isError=true),再让 step 失败——保证历史满足"tool_calls 必须紧跟 tool messages"的 API 不变量,避免单次工具执行失败毒化整个会话。(附带发现:profile 安装插件后立即重启存在 dsh-tools 模块实例分裂的窗口期,建议 boot 时校验工具调度器完整性并给出明确报错,而不是让首个工具调用裸崩。触发本次问题的插件侧已修复为不把宿主包声明为运行时依赖,但宿主对"工具执行失败 → 会话永久卡死"的脆弱性仍然存在。)
All reactions