From 62e4b9df8cae082afc31b35c39c6c52f74bcdcac Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 21 Jun 2026 13:00:35 +0200 Subject: [PATCH] fix(workflow): skip Manager queue ops when Manager is mid-operation --- js/nodes_stats.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/js/nodes_stats.js b/js/nodes_stats.js index d053bed..476be79 100644 --- a/js/nodes_stats.js +++ b/js/nodes_stats.js @@ -684,6 +684,20 @@ function enablePayload(dirName, info) { }; } +// Whether ComfyUI Manager is mid-operation. Used to avoid resetting its queue +// out from under an in-progress install/disable (the manual disable flow guards +// the same way before calling runManagerDisable). +async function managerIsBusy() { + try { + const r = await fetch("/manager/queue/status"); + if (!r.ok) return false; + const st = await r.json(); + return !!(st && st.is_processing); + } catch { + return false; + } +} + async function runManagerEnable(payload) { await fetch("/manager/queue/reset", { method: "POST", headers: { "Content-Type": "application/json" } }); @@ -707,6 +721,11 @@ async function handleEnable(pkg, temporary, dialog) { const info = entry && entry.info; if (!info) return; + if (await managerIsBusy()) { + notify("ComfyUI Manager is busy. Please try again in a moment.", "warn"); + return; + } + setWorkflowButtonsBusy(dialog, true); try { await runManagerEnable(enablePayload(pkg, info)); @@ -784,6 +803,10 @@ async function processExpiredTrials() { const mgr = await fetchManagerInfo(); if (!mgr) return; // Manager unavailable — leave rows for a later session + // Don't reset Manager's queue out from under an in-progress operation + // (e.g. startup install work); the expired rows persist and retry next session. + if (await managerIsBusy()) return; + const done = []; for (const t of expired) { const info = mgr[t.package];