[Bug] 第三方插件把 @deepseek-ai/dsh-tools/cordis 副本带进 profile 依赖,导致所有会话所有工具调用报 "Cannot read properties of undefined (reading 'prepare')" #1633
Replies: 1 comment
|
你的根因定位完全正确——这是一个已知家族的第二次报告(此前 #1337,taonokenshin,Windows 11 + 12 个社区插件 + pnpm hoisted,同样的 1. 机制确认(与你怀疑的一致)
2. 你踩中的恰好是设计专门要防的洞
而顶层 3. 对修复建议的评估:位置正确,但有一条局限
4. "孤儿 tool_calls → 永久 400" 是这条链的放大器,且与 #1593 家族相连 崩溃前 5. 给同样踩坑者的立即恢复 你已做的移除修复正确。另建议: |
Uh oh!
There was an error while loading. Please reload this page.
环境:npx @deepseek-ai/dsh web 安装,Windows 10,dsh 0.1.0-rc.6,deepseek-official 路由
现象:安装 dsh-find-plugin 后,任何会话(包括新会话)任何工具调用(web_search、pwsh 等)都报 Cannot read properties of undefined (reading 'prepare') + UNKNOWN,随后会话历史残留孤儿 tool_calls,之后 DeepSeek 持续返回 400 INVALID_REQUEST;纯文字对话一直正常
根因定位:profiles\web\package.json 被塞进了 @deepseek-ai/dsh-tools、@deepseek-ai/cordis 副本依赖 + dsh.profile.bundles 里的第三方 bundle;怀疑是 TOOL_RUNTIME_SCHEDULER 的 unique symbol 跨物理模块实例不同导致 ctx.tools[symbol] 为 undefined(可引用 packages/core/agent-loop/src/tool-calls.ts 的 startCall 处 ctx.tools[TOOL_RUNTIME_SCHEDULER].prepare)
修复:从 package.json 移除三个依赖和 bundle 条目、删除 profiles\web\node_modules 下对应实体后恢复
建议:dsh plugin add 的 reconcile 应阻止核心包(@deepseek-ai/dsh-tools、cordis 等)被安装/落入 profile 依赖
之前的package.json:
{
"name": "dsh-profile-web",
"private": true,
"dependencies": {
"@deepseek-ai/cordis": "4.0.1",
"@deepseek-ai/dsh-tools": "0.1.0-rc.6",
"dsh-find-plugin": "^0.3.6"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-find-plugin"
]
}
}
}
修改后的package.json:
{
"name": "dsh-profile-web",
"private": true,
"dependencies": {},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app"
]
}
}
}
报错截图:

(可能需要)删除的文件夹,我找到几个就删了几个:
dsh-find-plugin
@deepseek-ai\dsh-tools
@deepseek-ai\cordis
All reactions