[0.1.6-alpha.2] BUG: every tool call fails with "Cannot read properties of undefined (reading 'prepare')" #7106
Replies: 1 comment
|
Same mechanism as #7107, #7108 and #7117 — your repro is the most complete of the four, so I will keep this to the parts that matter. Root cause is one line. The same commit also flipped Details, the |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Every tool call on a freshly-built
0.1.6-alpha.2checkout (ddefc45fbc) fails at the dispatch stage with:The model itself responds fine; the failure is in the host-side tool-execution layer immediately after the model emits the tool call.
Reproduction
Then in the GUI send any prompt that triggers a built-in tool, e.g. "list the files in this folder". The model generates text, suggests a tool call (e.g.
Pwsh · List files in the working directory), and the turn fails before any tool body runs.Confirmed on a completely fresh tree (full delete of repo +
~/.dsh/,git checkout HEAD -- ., freshpnpm install, freshpnpm run build, new DeepSeek API key).Affected version
0.1.6-alpha.2(ddefc45fbc).0.1.5-rc.2works. The regression appears in one of these three commits between0.1.5-rc.2and0.1.6-alpha.2:8dfc6fe1ecMerge PR DSH|DeepSeek Harness Mobile|用 Kuikly 跨端框架做的 Android 原生 DSH 客户端 #4471 worktree-resolutionmodee68f5d5abafix: testd9a55c7c0dfix: revert desktopThe first one touches
resolutionModeplumbing inapps/desktop-host/src/index.ts:21andpackages/boot/app-boot/src/profile-boot.ts— most plausible culprit.Root cause (confirmed via runtime diagnostic)
Failure site:
packages/core/agent-loop/src/tool-calls.ts:170ctx.tools[TOOL_RUNTIME_SCHEDULER]isundefinedeven though theToolRuntimeinstance owns a property whose key is a Symbol with the exact same descriptionSymbol("@deepseek-ai/dsh-tools.scheduler").Diagnostic added to the failing line printed, at runtime:
Symbol("foo") !== Symbol("foo")in JavaScript — the property key and the imported symbol have matching descriptions but are different instances. This means@deepseek-ai/dsh-toolsis being loaded twice in the same process: once bycordis-plugin-loader(atvendor/loader/) to instantiateToolRuntime, and once byagent-loop's ESMimport. Both loaders resolve the package to the same physical file via pnpm symlinks, but Node's module cache keys on the resolved URL — if the two paths produce different URLs (e.g. one walks upvendor/loader/node_modules/, one walkspackages/core/agent-loop/node_modules/@deepseek-ai/dsh-toolssymlink), they get separate module instances and therefore separate Symbol instances.The Symbol
TOOL_RUNTIME_SCHEDULERis defined exactly once across the entirelib/tree —packages/core/tools/lib/index.js:2526— so a duplicate definition is not the cause.Suggested fix
Ensure the cordis-plugin-loader and the workspace packages (agent-loop in particular) resolve
@deepseek-ai/dsh-toolsto the same module URL at runtime, so Node shares the module instance and therefore the Symbol instance. Candidates:lib/is built before any consumer that imports its Symbols.cordis-plugin-loaderresolve plugin names from the same node_modules root as the consumers."type": "module"consistency, or use Node's--experimental-vm-modules/ explicitSymbol.for(...)/ shared module instances.Workaround
Pin to
0.1.5-rc.2until upstream fixes this. Boots and dispatches tool calls correctly.All reactions