Replies: 3 comments
|
Confirmed on a third platform/config, with one practical addition. Environment
Reproduction Second-order effect (why re-prompting cannot recover the session) It reproduced on 3 consecutive user turns in that session, and a brand-new session hits the same Practical addition: no rebuild needed
Verification (loading two independent copies of the module and comparing the symbol, which is exactly the failing condition):
|
|
Confirmed on Linux with the released 0.1.6-alpha.2 ( Environment: Ubuntu (kernel without Landlock), x64, Node v22.23.2, pnpm 11.7.0, fresh What we observed: the dual load happens even with zero profile-local plugins. Under the documented source launch ( Runtime probe inside So in a source checkout with build outputs present (the normal dev state after Workaround that fully unblocks us: skip the tsx source launch and run the built CLI directly — The |
|
Thanks for the report. |
Uh oh!
There was an error while loading. Please reload this page.
Filing this as a bug report and a working patch, since I've hit it repeatedly and traced it to a specific Symbol identity problem in @deepseek-ai/dsh-tools.
Symptoms
Every tool call fails immediately with:
The failure happens on the first tool call after boot. Every session in that Host process is affected. Restarting DSH does not fix it. Removing plugins does not fix it. Cleaning node_modules and reinstalling does not fix it.
The session history is left with an orphaned tool_calls block and no matching tool result. After that, every subsequent message fails with 400 INVALID_REQUEST because the tool-call protocol is violated.
Root cause
packages/core/tools/src/index.ts defines the tool runtime scheduler key as a module-local Symbol:
When two physical copies of @deepseek-ai/dsh-tools exist in the same Node process — which happens whenever any profile-local plugin declares it as a regular dependency instead of a peerDependency — each copy evaluates that line separately and creates a different Symbol object. The description string is identical, but the runtime values are not equal:
The Agent loop looks up the scheduler using the host copy's Symbol. The ToolRuntime registered itself under the profile copy's Symbol. The lookup returns undefined, and calling .prepare() on it crashes.
Why Symbol.for() fixes it
Symbol.for(key) uses the global symbol registry. No matter how many copies of the module exist, they all call Symbol.for('@deepseek-ai/dsh-tools.scheduler') and receive the exact same Symbol object back. The lookup matches and .prepare() succeeds.
The patch
Then rebuild:
That's it. The patch survives until the next git checkout of the source tree, so it needs to be reapplied after each DSH upgrade.
Verified
· DSH 0.1.6-alpha.2
· Node v22.23.2
· macOS arm64
· Reproduced with a profile containing plugins that declare @deepseek-ai/dsh-tools as a regular dependency
· Patch resolves the crash immediately and permanently for the current version
Related issues
This has been reported by other users with the same prepare crash, but the Symbol mismatch has not been identified as the root cause elsewhere. Linked reports:
· Various issues in the plugin ecosystem where profile-local plugins break all tool calls
Suggested upstream fix
Change the Symbol declaration to use Symbol.for() permanently:
This is a one-line change, has no behavioral downside, and makes the key resilient to duplicate module instances. Plugins that incorrectly declare host packages as dependencies will no longer be able to break the tool runtime.
All reactions