diff --git a/lib/index.js b/lib/index.js index 819acaa..77c3b31 100644 --- a/lib/index.js +++ b/lib/index.js @@ -200,7 +200,17 @@ function refreshHungOperator(dshHome = core.findDshHome()) { function installHungPromptGlobal() { const fn = () => { try { - return refreshHungOperator(core.findDshHome()).text || ""; + const home = core.findDshHome(); + // [dsh-purge-fix 2026-10-09 方案A] 开关文件 DSH_HOME/.hung-disabled 存在时, + // hung 返空串 → 每步 model.step 不再追加 prompt-inject.md 全文 (省 ~9000 token/步)。 + // system 层由 patch #67/#68/#74 保证不被 rewind/compaction 洗掉,够兜底。 + // 想关掉开关恢复全量 inject: 删掉 .hung-disabled 文件 + 重启 DSH。 + if (home) { + try { + if (fs.existsSync(`${home}/.hung-disabled`)) return ""; + } catch { /* 开关文件判断失败 → 走原逻辑,不改行为 */ } + } + return refreshHungOperator(home).text || ""; } catch { return core.hungOperatorPrompt() || ""; }