From c17e668a3a6406024e6bde7e02ad599ffb6a25a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AB=E6=88=91=E5=B0=8F=E6=9D=A8=E5=90=8C=E5=AD=A6?= <188421097+HunYiSage@users.noreply.github.com> Date: Fri, 9 Oct 2026 23:55:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(patch):=20#84=20host=20code=3D0=20clean=20e?= =?UTF-8?q?xit=20no-fail=20=E2=80=94=20stopped=20=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=A1=86=E6=B6=88=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #83 只覆盖了 signal kill (code===null),但 host 正常 exit(0) 仍走 else this.fail 'stopped' 弹对话框。#84 作为 upgrade patch:删掉 else-fail-stopped 行,只有真正 非 0 exit 才 fail。fresh 装走 #83 → #84 两步,已经应用 #83 的只跑 #84。 - #83 desc 措辞 '静默' → '不报错' 对齐 YG 描述 - client.js 加 patch.84 zh/en 翻译 markers: 'close no-fail v2' (与 #83 的 'signal kill' 独立) --- client.js | 6 ++++-- lib/core.js | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index 48eb666..3f8f266 100644 --- a/client.js +++ b/client.js @@ -410,7 +410,8 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => { "patch.80": "恢复官方极简工具表", "patch.81": "每一步重放完整 prompt-inject", "patch.82": "主进程兜底 DSH_PROFILE=desktop", - "patch.83": "host 信号杀静默退出不弹对话框", + "patch.83": "host 信号杀时不报错不弹对话框", + "patch.84": "host code=0 正常退出不报错 (消除 stopped 对话框)", "status.unlocated": "未定位", "status.na": "本端不需要", "metric.unlocated": "还没定位到本机 Harness", @@ -737,7 +738,8 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => { "patch.80": "Restore official minimal tool plugins", "patch.81": "Replay the full prompt-inject every step", "patch.82": "Fallback DSH_PROFILE=desktop in main process", - "patch.83": "Silence host-stopped crash on signal kill", + "patch.83": "Don't fail on signal kill (no crash dialog)", + "patch.84": "Don't fail on code=0 clean exit (no stopped dialog)", "status.na": "Not for this host", "metric.sealed": "Official client found. Apply to unpack", "metric.sealed.count": "Sealed", diff --git a/lib/core.js b/lib/core.js index b19b455..0b94b3b 100644 --- a/lib/core.js +++ b/lib/core.js @@ -4525,7 +4525,7 @@ const NEW_TOOL_PATCHES = [ name: "DESKTOP_HOST_CLOSE_NO_FATAL", layer: "代码", layer_en: "Code", - desc: "host 被信号杀 (重启密封包) 时静默退出,不弹 crash dialog / silence host-stopped crash on signal kill", + desc: "host 被信号杀 (重启密封包) 时不报错,不弹 crash dialog / don't fail on signal kill", file: "desktop-shell", surfaces: ["desktop"], replacements: [ @@ -4554,6 +4554,31 @@ const NEW_TOOL_PATCHES = [ ], markers: ["[dsh-purge] signal kill"], }, + { + id: 84, + name: "DESKTOP_HOST_CLOSE_CODE0_NO_FAIL", + layer: "代码", + layer_en: "Code", + desc: "host code=0 正常退出不报错 (消除 stopped 对话框) / don't fail on code=0 clean exit", + file: "desktop-shell", + surfaces: ["desktop"], + optional: true, + replacements: [ + { + pattern: + "\t\t\t\tif (code === null || signal) { resolve(); return; }\n" + + "\t\t\t\tif (code !== 0) this.fail(/* @__PURE__ */ new Error(`dsh desktop host exited with ${String(code)}${suffix}`));\n" + + "\t\t\t\telse this.fail(/* @__PURE__ */ new Error(`dsh desktop host stopped${suffix}`));\n" + + "\t\t\t\tresolve();", + replace: + "\t\t\t\tif (code === null || signal) { resolve(); return; }\n" + + "\t\t\t\t// [dsh-purge] close no-fail v2: code=0 正常退出不报错,只有真正非 0 exit 才弹对话框\n" + + "\t\t\t\tif (code !== 0) this.fail(/* @__PURE__ */ new Error(`dsh desktop host exited with ${String(code)}${suffix}`));\n" + + "\t\t\t\tresolve();", + }, + ], + markers: ["[dsh-purge] close no-fail v2"], + }, { id: 67, name: "AGENT_LOOP_MESSAGES_GUARD",