dsh-subagent-cwd
Enhanced subagent delegation tools for DeepSeek Harness with per-call cwd control: everything in dsh-subagent-tools plus a cwd parameter, shipped with the two in-process provider patches it requires.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lynx-gt/dsh-subagent-cwd说明文档
阅读完整 README ↗dsh-subagent-cwd
为 DeepSeek Harness(dsh)提供增强版子代理委派工具, 支持按次指定工作目录(cwd)。
包含 dsh-subagent-tools 的全部能力(按次 model / provider /
persona / toolFilter 覆盖、@preset: 引用、provider/model 复合 id)再加按次 cwd 参数——并附带
让 cwd 真正生效所需的两处进程内 provider 补丁。
两个包二选一,不要同时装
| 包 | 按次 model/provider/persona/toolFilter | @preset: | cwd | 补丁 |
|---|---|---|---|---|
| dsh-subagent-tools | ✅ | ✅ | ❌ | 无(纯 bundle) |
| dsh-subagent-cwd(本包) | ✅ | ✅ | ✅ | 2 处 provider 补丁 |
二选一安装。两者暴露相同的工具面(subagent / subagent_fork),同时装会因工具名冲突互相打架。
为什么 cwd 需要补丁(而其他功能不需要)
SubagentStartRequest 没有 cwd 字段,进程内驱动层构建子代理会话 meta 时只用
childSessionMeta(parent, ...)——按次 cwd 根本不会透传。进程内子代理有两条创建路径,两条都必须
打补丁,否则就会踩到经典陷阱:前台路径认 cwd、后台路径静默忽略:
| 路径 | 要改的包 | 文件 |
|---|---|---|
| 前台(one-shot) | @deepseek-ai/dsh-subagent-in-process-driver | lib/index.js |
| 后台(continuable) | @deepseek-ai/dsh-subagent | lib/index.js(bundle!不是 lib/types/continuation.js) |
第二处是 bundle 陷阱:该包 package.json 的 main/exports 指向 lib/index.js(内含 continuation
manager 的内联副本)。改长得像源码的 lib/types/continuation.js 不生效——必须改并验证 bundle。