`dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable.
Raw Developer Origin & Technical Request
GitHub Issue
Oct 22, 2026
## 环境
- dsh-purge:1.1.71(安装在 `~/.dsh/profiles/web/node_modules/dsh-purge/`)
- DSH web 应用:新版 agent-loop(`packages/core/agent-loop`),系统提示词插件为 `@deepseek-ai/dsh-system-prompt`
- profile:web
## 报错
每次会话启动即失败,模型请求发出前抛出:
```
本轮运行失败 unknown prompt variable "{{cwd}}" in section "deployment:persona-suffix"; registered variables: provider, model
```
## 根因
新版 DSH 的 agent-loop 只注册了 `provider` / `model` 两个提示词变量,不再内置 `{{cwd}}`(见官方升级指南 `docs/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.md`:工作目录改由 working-directory 服务作为必需 user context 提供,自定义模板保留 `{{cwd}}` 会在组装时抛错)。
但 dsh-purge 的运行时身份改写仍假设 `{{cwd}}` 可用。`lib/identity.js` 中的 `overlayOfficialIdentity()`:
1. 发现 `deployment:persona-suffix` 段为空 / 是官方身份 / 是纯 cwd 句时,强制替换为 `CWD_ONLY_SUFFIX = "Your working directory is {{cwd}}."`(第 8、232-238 行);
2. 组装结果里没有 suffix 段时,还会主动新建一个塞入 `CWD_ONLY_SUFFIX`(第 244-249 行)。
因此即使用户把配置里的 `personaSuffix` 清空,插件也会在运行时把 `{{cwd}}` 写回,渲染必炸。改配置无法规避,只能改插件代码。
## 本次本地修复(3 处,均在 `lib/identity.js`)
1. `CWD_ONLY_SUFFIX` 改为不含变量的静态句:
```js
export const CWD_ONLY_SUFFIX = "Your working directory is provided in the runtime context.";
```
2. `stripHarnessPersona()` 中两条把 `…Your working directory is {{cwd}}.` 改写为 `Working directory: {{cwd}}. ` 的规则(第 154-157、162-165 行),改为直接删除该句——否则旧文本会被转换成又一种 cwd 模板:
```js
.replace(
/You are a coding agent powered by the \{\{model\}\} model, running on the DeepSeek Harness\. Your working directory is \{\{cwd\}\}\.?\s*/g,
"",
)
.replace(
/You are a coding ...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from mmparko/dsh-purge.
Frequently Asked Questions
Market intelligence mapped to `dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable..
What problem does `dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable. solve?
What is the general sentiment around `dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable.?
What architecture is tied to `dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable.?
What open-source repositories focus on `dsh-purge` plugin compatibility with new DeepSeek Harness (DSH) `agent-loop` regarding `{{cwd}}` prompt variable.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like agent-loop and dsh-purge:1.1.71 by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics