comfyui-mcp 0.50.99 → 0.50.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5168,15 +5168,17 @@ export function makePanelToolCtx(bridge, tabId, workflowTargets) {
5168
5168
  catch (err) {
5169
5169
  // Only a card-reply TIMEOUT is recoverable/honest-as-timeout: poll the late
5170
5170
  // buffer, then report "timeout" if still unanswered. Any other error (no
5171
- // panel, transport failure) "no" so the destructive op is SKIPPED, exactly
5172
- // as the previous catch-all did.
5171
+ // panel, transport failure) still SKIPS the destructive op — but it is reported
5172
+ // as `unreachable`, not `no` (#1332). The user did not decline; we never got to
5173
+ // ask them, and a caller that says "cancelled" on this is describing a decision
5174
+ // nobody made.
5173
5175
  if (isReplyTimeoutError(err)) {
5174
5176
  const late = await pollLateAskReply(bridge, askId, timing, budgetEnd);
5175
5177
  if (late !== undefined)
5176
5178
  return isAffirmative(late) ? "yes" : "no";
5177
5179
  return "timeout";
5178
5180
  }
5179
- return "no";
5181
+ return "unreachable";
5180
5182
  }
5181
5183
  };
5182
5184
  // EXPLICIT self-heal — see PanelToolCtx.rebindToActiveTab. Only rebinds when
@@ -6686,6 +6688,14 @@ export function buildPanelToolDefs() {
6686
6688
  return ok("Timed out waiting for your confirmation, so I left the canvas as-is. " +
6687
6689
  "Tell me to clear it again when you're ready.");
6688
6690
  }
6691
+ if (decision === "unreachable") {
6692
+ // #1332 — the canvas is still untouched, which is the part that matters, but
6693
+ // the user never saw the question. Saying "cancelled" would credit them with
6694
+ // a decision they were never offered.
6695
+ return ok("The canvas was left as-is — but NOT because it was declined: the panel could " +
6696
+ "not be reached to ask, so the question never appeared. Nothing was cleared. " +
6697
+ "Check the panel tab is connected, then ask again.");
6698
+ }
6689
6699
  if (decision !== "yes") {
6690
6700
  return ok("Cancelled — the canvas was left as-is.");
6691
6701
  }
@@ -8878,7 +8888,26 @@ export function buildPanelToolDefs() {
8878
8888
  : "Cancelled — no new restart was dispatched. ComfyUI was briefly " +
8879
8889
  "unreachable but is healthy again.");
8880
8890
  }
8881
- return ok("CancelledComfyUI was not restarted.");
8891
+ // #1332the reporter's exact string, and it was FALSE. They accepted the
8892
+ // restart, ComfyUI restarted (a fresh startup in the server log), and this
8893
+ // said it had not — because the restart dropped the socket the answer had to
8894
+ // travel back on, and a transport failure used to arrive here as "no".
8895
+ //
8896
+ // The probes above already refuse to claim "not restarted" while the server
8897
+ // is DOWN. This is the remaining case: the server is HEALTHY, which is
8898
+ // equally true of "nothing happened" and of "it restarted and came back".
8899
+ // With an explicit decline we know which; without one we do not, and the
8900
+ // sentence must stop asserting it.
8901
+ return ok(decision === "unreachable"
8902
+ ? "This call did NOT dispatch a restart. Whether ComfyUI restarted for some " +
8903
+ "other reason cannot be told from here: the panel could not be reached to " +
8904
+ "ask for confirmation — the question never appeared — so no decision was " +
8905
+ "made either way, and the server is reachable now, which looks the same " +
8906
+ "whether it never went down or went down and came back. If you asked for a " +
8907
+ "restart and one has already happened, this is that transport loss, not a " +
8908
+ "cancellation. Check the ComfyUI log for a fresh startup line before " +
8909
+ "restarting again."
8910
+ : "Cancelled — ComfyUI was not restarted.");
8882
8911
  }
8883
8912
  // Heal an orphaned session onto the live tab FIRST, then bind the reboot dispatch
8884
8913
  // to that ONE tab id (no await between capture and dispatch, so JS run-to-