mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 08:30:22 +08:00
feat(patch): #83 host 信号杀静默退出 — 消除 crash dialog + 补齐 73-83 UI 翻译
- 新增 patch #83 DESKTOP_HOST_CLOSE_NO_FATAL: child.once(close) 收到 code===null 或任何 signal 时直接 resolve, 不走 fail → FatalRecovery.report 不触发,crash dialog + crash log 都断掉 - 之前 /purge apply 密封包重启靠 PS1 kill Electron,但 host 子进程 close event 还是会走 fail(),弹对话框. 现在从源头切 fail() 路径 - 补齐 client.js 翻译 patch.73-83 zh/en, 之前 #70/#71/#72 之后新加的补丁 UI 显示的是 raw key, 现在数量/名称都对得上
This commit is contained in:
1 parent
6262b9c453
commit
775e90f34f
2 files changed
+54
No files matched your search
+34
@@ -4501,6 +4501,40 @@ const NEW_TOOL_PATCHES = [
|
||||
],
|
||||
markers: ["[dsh-purge] guard undefined section text"],
|
||||
},
|
||||
{
|
||||
id: 83,
|
||||
name: "DESKTOP_HOST_CLOSE_NO_FATAL",
|
||||
layer: "代码",
|
||||
layer_en: "Code",
|
||||
desc: "host 被信号杀 (重启密封包) 时静默退出,不弹 crash dialog / silence host-stopped crash on signal kill",
|
||||
file: "desktop-shell",
|
||||
surfaces: ["desktop"],
|
||||
replacements: [
|
||||
{
|
||||
pattern:
|
||||
"\t\tthis.exitPromise = new Promise((resolve) => {\n" +
|
||||
"\t\t\tchild.once(\"close\", (code) => {\n" +
|
||||
"\t\t\t\tconst suffix = this.stderr.trim() === \"\" ? \"\" : `: ${this.stderr.trim()}`;\n" +
|
||||
"\t\t\t\tif (code !== 0 && code !== null) 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();\n" +
|
||||
"\t\t\t});\n" +
|
||||
"\t\t});",
|
||||
replace:
|
||||
"\t\tthis.exitPromise = new Promise((resolve) => {\n" +
|
||||
"\t\t\tchild.once(\"close\", (code, signal) => {\n" +
|
||||
"\t\t\t\tconst suffix = this.stderr.trim() === \"\" ? \"\" : `: ${this.stderr.trim()}`;\n" +
|
||||
"\t\t\t\t// [dsh-purge] signal kill (code===null, 任何 signal 杀) 静默 resolve,不走 fail → 不写 crash log 不弹对话框\n" +
|
||||
"\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();\n" +
|
||||
"\t\t\t});\n" +
|
||||
"\t\t});",
|
||||
},
|
||||
],
|
||||
markers: ["[dsh-purge] signal kill"],
|
||||
},
|
||||
{
|
||||
id: 67,
|
||||
name: "AGENT_LOOP_MESSAGES_GUARD",
|
||||
|
||||
Reference in new issue
Block a user