Replies: 1 comment
|
Adding a September data point — this is still present on the latest release ( Environment: Windows 11, Node v26.8.2, npm 12.0.2, launched via After npm rewrote an existing npx install (
(the duplicated set covers the Same failure as described: Also worth noting: a clean Workaround we verified end-to-end: make every duplicated package resolve to one realpath — replaced the nested copies with directory junctions pointing at a single copy. Create + resume succeed afterwards. But it must be reapplied after every npm re-layout — which is why a |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On DSH 0.1.0-rc.6 and rc.7, in the GUI (web UI), creating a new session, resuming an existing one, or switching models can fail with:
This happens when an installation ends up with two physical copies of
@deepseek-ai/dsh-scopeloaded into one process (for example, the engine's ownnode_modulesand a separately-managed profile tree'snode_moduleseach resolve their own copy). The scope identity tag is a module-local symbol, and the two copies do not share it — a context minted through one copy is invisible to the other, so the agent is seen as unscoped.This is rooted in the engine itself and is still present in rc.6/rc.7. Below is the root cause plus a one-line fix, along with a fork containing the change.
Repro (3 steps, ~30 seconds)
Install DSH rc.6 or rc.7.
Start the web UI (
dsh web).Click "New session" (or resume an existing session / switch model) → the error appears.
The failure depends on which copy of
dsh-scopeminted the scope context versus which one reads it, so it may be intermittent across setups.Root cause
packages/core/scope/src/index.ts:Symbol()returns a new unique symbol on every call. When the host and the agent-presets plugin each resolve@deepseek-ai/dsh-scopeto a different installed copy, each copy re-executes this line and gets an unrelated symbol. The scope tag written under one copy's symbol (createScope→fiber.ctx.extend({ [kScope]: key })) cannot be read by the other copy'sscopeOf(ctx), so the context looks unscoped to the reader.The monorepo itself uses pnpm workspaces, which hoists
dsh-scopeto a single copy, so this usually does not surface internally — it shows up in installations that load two distinct copies.Fix (one line)
Symbol.forreads/writes the same global-registry entry regardless of which module copy executes it, so tags written by any copy are read back correctly by any other. Single-copy behavior is unchanged.Symbol.foris already the pattern used in this repo for cross-instance identity (e.g. Schemastery'sSymbol.for('schemastery')).We verified this: editing the installed copies (
node_modules/@deepseek-ai/dsh-scope/lib/index.js) or the source atpackages/core/scope/src/index.tsfromSymbol('dsh.scope')toSymbol.for('dsh.scope')makes session create/resume/model-switch succeed immediately, no rebuild.Fix ready on a fork
We prepared the change as a branch you can review or cherry-pick:
Fork:
kongminOS/deepseek-harnessBranch:
fix/dsh-scope-symbol-forCommit:
fix(scope): use Symbol.for so the scope tag survives duplicate package copiesDiff: one line in
packages/core/scope/src/index.tsNot just a diagnosis — a reproducible fix branch. Happy to open a PR if the issue tracker / pull-request channel reopens.
Also worth noting
While on rc.7, another engine-level item paired with this:
DeepSeek API error (HTTP 404)whenllm-deepseek.baseURLin~/.dsh/settings.yamlis set tohttps://api.deepseek.com/anthropic(Anthropic-compatible endpoint) — the OpenAI-format adapter calls/chat/completions, which the Anthropic path does not serve. Setting it tohttps://api.deepseek.com(or deleting the key) fixes it; settings.yaml hot-reloads.More details on both are in the desktop-shell's Known Issues section: https://github.com/kongminOS/kongmin-dsh-desktop-shell#known-issues--fixes-dsh-engine-010-rc6--rc7
All reactions