mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 07:00:22 +08:00
feat(inject): 加 .hung-disabled 开关省 ~50% token
lib/index.js installHungPromptGlobal:DSH_HOME/.hung-disabled 存在 → __dshPurgeHungPrompt() 返空串,每步 model.step 不再追加 prompt-inject.md 全文(省 ~9000 token/步)。system 层由 patch #67/#68/#74 保证不被 rewind/compaction 洗掉,够兜底。 关闭开关恢复全量 inject:删 .hung-disabled + 重启 DSH。 代码回滚:git reset --hard 0661755。
This commit is contained in:
1 parent
06617553e0
commit
661eebac15
1 file changed
+11
-1
+11
-1
@@ -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() || "";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user