Repository navigation
Replies: 6 comments
|
dual dsh-tools copy(profile pnpm install 后二次 materialize)——和 #783 完全同族,都是"插件装在哪决定依赖解析"机制下的坑。 完整机制 + 规避(锁版本线/依赖兜底目录)见第 3 章:https://github.com/Electricitysheep/dsh-handbook/blob/main/docs/03-profiles.md |
|
我在 Windows + DSH 0.1.0-rc.6 + web profile 环境中复现了相同问题。 安装 dsh-effort-switch 后,新建对话并让模型调用 Read 工具,会立即报: Cannot read properties of undefined (reading 'prepare') 普通文本回复正常,但 Read、搜索、命令等工具调用都会失败。重启 DSH 和新建对话都不能解决。 我的环境中发现 profile 和 DSH 核心分别加载了两份 @deepseek-ai/dsh-tools,怀疑是重复模块实例导致 TOOL_RUNTIME_SCHEDULER 的 Symbol 不匹配。 |
|
Your root-cause analysis is precise (non-global
We hit the same family of failure after |
|
Thanks for the detailed writeup - this matches what we hit on Windows too. The non-global Symbol analysis is spot on: host bundle (rc.5) vs profile copy (rc.6) each hold their own TOOL_RUNTIME_SCHEDULER, so ctx.tools[TOOL_RUNTIME_SCHEDULER] is undefined and startCall throws at tool-calls.ts. Since external PRs aren't accepted, I implemented the boot-time version-drift check you proposed as an offline diagnostic: https://github.com/boyin111-1/dsh-doctor
The check runs before dsh boots, so it catches the drift even when the profile is already broken. Hope the Symbol.for fix lands in-tree soon - that's the real fix. |
同一机制下的另一种触发路径:源码入口(tsx + tsconfig paths),但物理副本只有一份版本: 本线程给出的排查手段(
这与"profile 内 pnpm install 生成第二份"是同一根因( 触发条件// tsconfig.base.json:484 —— 核心包被别名指向 src/
"@deepseek-ai/dsh-tools": ["./packages/core/tools/src"],服务以 TypeScript 源码入口启动时(
两个入口各自求值一次 判别方法(若你已完成本线程建议的全部检查却仍失败)# 1) 解析入口是否为源码
grep -n '^ExecStart' /etc/systemd/system/deepseek-harness.service
grep -n '"dsh"' package.json
# 2) 是否存在指向 src/ 的核心包别名
grep -rn '"@deepseek-ai/dsh-tools"' tsconfig*.json
# 3) 物理副本去重(本例这里会显示"只有一份",因此无法排除本路径)
find /root/.dsh/profiles /opt/deepseek-harness -path '*@deepseek-ai/dsh-tools' 2>/dev/null \
| while read p; do readlink -f "$p"; done | sort -u | wc -l若第 1 条走的是 验证与修复把服务入口从源码换成构建产物,工具立即恢复(本机实测,无需动 profile、无需清副本): -ExecStart=/usr/local/bin/pnpm dsh web --host 127.0.0.1 --port 3080 --no-open
+ExecStart=/usr/local/bin/node /opt/deepseek-harness/apps/cli/lib/bin.js web --host 127.0.0.1 --port 3080 --no-open即"服务入口的解析方式"本身就是一个可分裂核心闭包的变量,不只是 profile 的依赖安装方式。服务部署建议使用构建产物入口。 本例中已排除的项
顺带确认一个下游现象本线程 follow-up 提到 |
Uh oh!
There was an error while loading. Please reload this page.
Summary
On 0.1.0-rc.6, every tool call in a session fails after a profile installs plugins via
pnpm install. The turn ends with:No
tool/resultis ever produced; the failure happens right after thetool/callevent is appended.Repro
@deepseek-ai/dsh-tools@0.1.0-rc.5).cd ~/.dsh/profiles/web && pnpm install— this lifts@deepseek-ai/dsh-tools@0.1.0-rc.6(pluscordis,dsh-subprocess,dsh-commands) into~/.dsh/profiles/web/node_modules/@deepseek-ai/.bash). The turn fails immediately.Works fine before the profile install and in the
headlessprofile (no profilenode_modules).Root cause
TOOL_RUNTIME_SCHEDULERis a non-globalSymbol(packages/core/tools/src/index.ts:466).dsh-agent-loop(host copy, rc.5) imports it from its own copy, whilectx.toolsis aToolRuntimebuilt from the profile copy (rc.6).ctx.tools[TOOL_RUNTIME_SCHEDULER]is thereforeundefined, andstartCallthrows atpackages/core/agent-loop/src/tool-calls.ts:169(ctx.tools[TOOL_RUNTIME_SCHEDULER].prepare(call.exec)).cordisalready usesSymbol.for('cordis.isolate')for cross-copy isolation;dsh-toolsdoes not follow that pattern.Proposed fix (branch available)
tsonglew/deepseek-harness@fix/tool-runtime-scheduler-symbol-forchangesTOOL_RUNTIME_SCHEDULERandcreateExecutionToken()toSymbol.for(...). Since external PRs are currently not accepted, I am sharing it here for the team to pick up.Independent observation
In the same environment, profile plugins (
dsh-worktree,dsh-find-plugin, ...) fail to load withcannot get property "tools" without injectwhen they resolve@deepseek-ai/cordisfrom the profile copy. A boot-time version-drift check between host and profile@deepseek-ai/*packages would surface both failure classes with a clear message.All reactions