Replies: 1 comment 2 replies
|
我遇到了有些相似的问题,最终我选择直接截断来修复旧的会话,只保留正常的部分 |
2 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.
下面是我通过 ai 进行解决的,但是治标不治本,后续安装某些插件还是会出现问题的
本轮运行失败Cannot read properties of undefined (reading 'prepare')
本轮运行失败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)
根因:装 dsh-codex-connect 时,pnpm 在 profile 里“克隆”了一份 dsh 核心包,导致工具系统精神分裂
今天 13:18 你安装 dsh-codex-connect / dsh-web-extras 时,pnpm(nodeLinker: hoisted 模式)把 8 个 dsh 核心运行时包提升进了 ~/.dsh/profiles/web/node_modules/@deepseek-ai/,其中就包括 dsh-tools(工具调度核心)。
于是运行时出现了两份独立的 dsh-tools 模块:
插件加载器从 profile 根解析 → 加载了 profile 副本的 ToolRuntime 服务
而 dsh-agent-loop(来自全局 dsh 安装)用的是全局副本的调度器 Symbol
我用 node 实测验证:两份的 TOOL_RUNTIME_SCHEDULER === 结果为 false(Symbol 描述一样但身份不同)。跨副本用 Symbol 取调度器 → 拿到 undefined → 崩溃。
💥 两个错误的关系
Cannot read properties of undefined (reading 'prepare') —— 根因。模型发起工具调用(bash/glob),agent-loop 调 scheduler.prepare() 时调度器是 undefined,整个回合当场崩死,工具结果没能写回会话。
tool_calls must be followed by tool messages... —— 连锁反应。上一步崩溃后,会话历史里留下了「模型说要调工具、但没有任何工具返回结果」的残缺消息。之后这个会话每次发消息,API 都因为这段残缺历史直接拒绝(400),换个新对话才能恢复。
🔧 修复内容
确认 8 个被复制的包(dsh-tools、cordis、cosmokit、schemastery 等)与全局版本完全一致(全部 0.1.0-rc.6)后,已从 profile 的 node_modules 移除
备份在 ~/.dsh/backups/core-dupes-20260817/,出问题随时可还原
起了测试实例验证:boot 无报错、68 个插件条目全部注册、codex-connect / dshmarket 服务正常
📌 你需要做的
重启 dsh web,然后新建一个对话再试工具调用(liblib-tv 那个 14:20 的旧会话历史已残缺,救不回来了)
以后用 pnpm 装完插件,如果 ~/.dsh/profiles/web/node_modules/ 里又冒出 @deepseek-ai/ 目录,把这批核心包再删一次即可(hoisted 模式每次安装都会重新提升)——这也是个上游设计缺陷
All reactions