Replies: 2 comments 2 replies
|
Root cause and the The remaining gap: version skew
What
|
|
thanks!but where is the path for dsh that's directly installed via npm? I don't see a packages/core/tools/src/index.ts at .dsh(windows user directory) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ctx.tools[TOOL_RUNTIME_SCHEDULER]resolves toundefinedat tool dispatch becauseTOOL_RUNTIME_SCHEDULERis a module-localSymbol; when multiple physical copies of@deepseek-ai/dsh-toolsexist in one process, the agent-loop's key and the ToolRuntime field's key are unequal Symbols. A one-lineSymbol.forfix restores the lookup while preserving the author's intent.Repro / root cause / fix / verification
@deepseek-ai/dsh-toolsas a dependency (or a peerDependency whileautoInstallPeersis on), thendsh weband ask the agent to call any tool.Cannot read properties of undefined (reading 'prepare')atdsh-agent-loopstartCall; the turn ends withcode: UNKNOWN, leaving a danglingtool_callso later turns fail withINVALID_REQUEST.packages/core/tools/src/index.ts:466exportsSymbol('@deepseek-ai/dsh-tools.scheduler');dsh-agent-loopimports the same key from a different physical copy, so the two Symbols are not===.This is the dual package hazard — the Node.js-documented case where the same package loaded twice yields two module instances whose identity checks (
Symbol,instanceof,WeakMap) no longer match. Here the second instance comes from a duplicate physical copy rather than the usual ESM/CJS dual entry, andSymbol.foris the standard remedy.Symbol.foruses the global registry, so the key is identical across all module instances. It stays a Symbol, preserving the@internal"omitted from the generated named service API" intent.dsh webinstance now completes tool calls (turn/end completed,tool/resultpresent) on 0.1.0-rc.6.leether/deepseek-harness→fix/tool-runtime-scheduler-symbol— a clean single-commit fork branch (the fork'smastertracks upstream).All reactions