Skip to content
Discussion options

You must be logged in to vote

别急,这个报错组合我们已经见过 6 次了(#1337、#1633、#1665、#1677、#1697 同签名),两个错误是因果关系,不是两个独立故障:

第一次的 Cannot read properties of undefined (reading 'prepare') 是根因

  • 工具调度器 TOOL_RUNTIME_SCHEDULER 是一个 unique symbol(packages/core/tools/src/index.ts:466)——每份物理拷贝在磁盘上求值都得到不同的 Symbol 实例。
  • 当 profile 里出现第二份 @deepseek-ai/dsh-tools / @deepseek-ai/cordis 拷贝时(常见于:安装第三方插件带入了副本依赖、或 hoisted 把插件传递依赖平铺到顶层),ctx.tools 落到外来拷贝的实例上 → ctx.tools[TOOL_RUNTIME_SCHEDULER] 是 undefined → 崩溃点 agent-loop/tool-calls.ts:169 的 .prepare 就报这个错。
  • 注意:崩溃发生前,:167 已经把 tool_calls 事件提交进了会话日志。

第二次+以后的 400 是第一次崩溃的"后遗症"(会话毒化)

  • 崩溃后该会话残留一个孤儿 tool call id(有 call、永远不会有 result)。
  • 之后每一轮对话,llm-deepseek/src/serialize.ts:134 都会把这个悬挂的 id 原样重放给 DeepSeek API → API 校验历史时发现…

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MrColder666
Comment options

Comment options

You must be logged in to vote
1 reply
@MrColder666
Comment options

Answer selected by MrColder666
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants