fix: 可选补丁/CMD钉入不再误挡他人 Apply,并标明 #20/#21/#28/#29 所属插件

梁神与 web-fetch 的 pattern_miss 改为软通过;bin 缺失或写失败不永久卡完成。设置页文案写明 dsh-web-fetch-http / dsh-liangshen,失败提示列出具体补丁号。
This commit is contained in:
yang committed 2026-09-02 23:26:56 +08:00
1 parent 8aa7afecd3
commit a204851989
3 files changed
+99 -30

No files matched your search

+11 -10
View File
@@ -683,19 +683,20 @@ function installWebServer(ctx, cfg) {
const shim = await core.patchAllShims();
// Apply must finish the no-flash pass before offering restart.
const flash = core.silenceCmdFlash(state.ai_base);
const applied = report.filter((r) => r.status === "applied").length;
const already = report.filter((r) => r.status === "already").length;
// missing_file = optional target not installed (liangshen / web-fetch / …) — not a hard fail.
const softOk = new Set(["applied", "already", "missing_file"]);
const failed = report.filter((r) => !softOk.has(r.status));
// Restart only when required patches finished AND (on win32) bin.js hide-console pinned.
const complete = failed.length === 0 && flash.ok === true;
const summary = core.summarizeApplyReport(report);
// Restart when required patches are soft-ok AND (on win32) bin pin is ok/soft.
const complete = summary.failed.length === 0 && flash.ok === true;
sendJson(response, 200, {
ok: true,
complete,
applied,
already,
failed: failed.length,
applied: summary.applied,
already: summary.already,
failed: summary.failed.length,
failed_items: summary.failed.map((r) => ({
id: r.patch_id,
name: r.name,
status: r.status,
})),
report: report.map((r) => ({ id: r.patch_id, name: r.name, status: r.status })),
override_content: override.content,
override_path: override.path,