跳到正文

lynx-gt/dsh-subagent-cwd

30最近提交 2026年8月15日

dsh-subagent-cwd DSH 插件

该插件在dsh-subagent-tools基础上增加了每次调用的`cwd`参数,使子代理可以在特定目录下工作。它包含两个小供应商补丁,确保`cwd`参数在前台和后台子代理路径中均生效。同时改进了角色和预设的共存。

如何安装 dsh-subagent-cwd DSH 插件

dsh plugin --profile web add dsh-subagent-cwd

复制不会执行命令。安装 dsh-subagent-cwd DSH 插件前请核对仓库和版本。

dsh-subagent-cwd DSH 插件数据来源

dsh-subagent-cwd DSH 插件快照日期:2026年8月16日

discovered

dsh-subagent-cwd DSH 插件能做什么

  • 每次调用可为子代理指定工作目录
  • 每次调用可覆盖模型、供应商、角色、工具过滤器(继承自dsh-subagent-tools)
  • 支持@preset:引用和供应商/模型复合ID
  • 补丁使前台和后台子代理路径均能传递cwd
  • 补丁v2实现角色与预设共存(Windows)
  • 支持headless和web配置文件(web需预设适配器)

dsh-subagent-cwd DSH 插件适合哪些场景

  • 在无需仓库AGENTS.md注入的临时目录中运行子代理
  • 将子代理文件操作隔离到特定项目文件夹
  • 在同一会话中为不同子代理调用使用不同的工作目录
  • 结合cwd、角色和预设覆盖实现复杂工作流

dsh-subagent-cwd DSH 插件适合谁

  • 使用DeepSeek Harness并需要精细控制子代理的开发者
  • 需要子代理在隔离目录中执行文件操作的用户

dsh-subagent-cwd DSH 插件的限制

  • 补丁仅针对dsh 0.1.0-rc.6;升级dsh后需重新运行补丁
  • @preset:依赖本地预设布局
  • Web会话需要预设适配器(install-preset脚本)
  • 在路由器风格预设下,角色参数仍会丢失(即使有补丁v2)
  • POSIX的预设适配器(install-preset.sh)尚未实现补丁v2的hunks(仅Windows)

dsh-subagent-cwd DSH 插件的仓库 README 摘录

以下文字摘自 dsh-subagent-cwd DSH 插件的上游仓库 lynx-gt/dsh-subagent-cwd 的 README,版权归原作者,仅作引用。

Enhanced subagent delegation tools for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) **with per-call working-directory control**. Everything in [dsh-subagent-tools](https://github.com/lynx-gt/dsh-subagent-tools) (per-call model / provider / persona / toolFilter overrides, `@preset:` references, `provider/model` composite ids) **plus** a per-call `cwd` parameter — shipped with the two small provider patches that make `cwd` actually work. | [English](README.md) | [中文](README.zh.md) | [![awesome · DSH plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com) ## Choose one of the two packages — not both | Package | Per-call model/provider/persona/toolFilter | `@preset:` | `cwd` | Patches | |---|---|---|---|---| | **dsh-subagent-tools** | ✅ | ✅ | ❌ | **none (bundle only)** | | **dsh-subagent-cwd** (this) | ✅ | ✅ | ✅ | 2 provider patches | Install **either** one. Both expose the same tool surface (`subagent` / `subagent_fork`) and colliding installations would fight over the tool names. ## Why cwd needs patches (and the other features don't) `SubagentStartRequest` has **no cwd field**, and the in-process drive layer builds chil

阅读完整 README仓库许可: MIT

dsh-subagent-cwd DSH 插件常见问题

如何安装dsh-subagent-cwd?

运行`dsh plugin --profile web add dsh-subagent-cwd`,然后应用补丁:Windows运行`powershell -ExecutionPolicy Bypass -File patches\install.ps1`,POSIX运行`./patches/install.sh`。对于Web会话,还需运行预设适配器。重启dsh并启动新会话。

为什么cwd参数需要补丁?

因为SubagentStartRequest没有cwd字段,进程内驱动层不会传递每次调用的cwd。前台和后台两个代码路径都需要补丁来支持cwd。本插件附带了所需的补丁。

能否同时使用dsh-subagent-cwd和dsh-subagent-tools?

不能,只能选择其中一个。两者暴露相同的工具接口(subagent/subagent_fork),同时安装会导致工具名称冲突。dsh-subagent-cwd包含dsh-subagent-tools的所有功能,并增加了cwd。

升级dsh后会发生什么?

dsh升级会重写node_modules,清除两个补丁。每次升级后必须重新运行安装脚本(幂等)。插件本身保留在配置文件的node_modules中,但如果公共API发生变化,peerDependencies可能拒绝加载。

角色参数在路由器风格预设下是否有效?

即使有补丁v2,在路由器风格预设下角色参数仍会丢失,因为其system-prompt/assemble钩子会删除角色部分。解决方法包括使用非路由器风格预设、通过消息层注入角色,或接受角色参数无效。