comfyui-mcp 0.50.53 → 0.50.55

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.
@@ -2329,6 +2329,36 @@ async function unreadableOrHealed(ctx, before, detail) {
2329
2329
  }
2330
2330
  return { status: "unreadable", before, detail };
2331
2331
  }
2332
+ /**
2333
+ * The version-gap sentence for a fence rebind that failed on an OLD panel (#1043).
2334
+ *
2335
+ * Empty string when the panel is new enough, or when its version is unknown —
2336
+ * an unproven version must never be narrated as "yours is too old", which would
2337
+ * send someone to update a panel that is already current. That is the same
2338
+ * three-state discipline the rest of this file runs on.
2339
+ *
2340
+ * Never throws: this decorates an error path, and a decoration that fails must
2341
+ * not replace the diagnosis it was meant to improve.
2342
+ */
2343
+ function panelTooOldNote(ctx) {
2344
+ try {
2345
+ const v = ctx.bridge?.panelTooOldForReplyUuid?.(ctx.tabId);
2346
+ if (!v?.tooOld)
2347
+ return "";
2348
+ return (`
2349
+
2350
+ WHY THIS READ WAS NEEDED AT ALL: this session's panel is ${v.version}, and a ` +
2351
+ `panel only reports the new workflow's identity ON THE REPLY from ${v.needed} ` +
2352
+ `onwards. On ${v.needed}+ the command that re-pointed the canvas repairs the ` +
2353
+ `fence from its own reply and never makes this read — so UPDATING THE PANEL ` +
2354
+ `to ${v.needed} or later removes this failure rather than working around it. ` +
2355
+ `Update it with install_comfyui (action:"panel", panel_action:"sync"), then ` +
2356
+ `restart ComfyUI.`);
2357
+ }
2358
+ catch {
2359
+ return "";
2360
+ }
2361
+ }
2332
2362
  async function rebindWorkflowFence(ctx) {
2333
2363
  const tabAtStart = ctx.tabId;
2334
2364
  let before = currentWorkflowFence(ctx);
@@ -2468,7 +2498,14 @@ function describeFenceRebind(r, canMutate,
2468
2498
  * both yield `canMutate:false` but need opposite advice, and narrating the
2469
2499
  * first as the second is a bucket standing in for a cause (codex gate P1).
2470
2500
  */
2471
- refusalCause) {
2501
+ refusalCause,
2502
+ /**
2503
+ * #1043 — the version-gap sentence, when the connected panel is PROVABLY too
2504
+ * old to publish the reply uuid this rebind exists to avoid needing. Passed in
2505
+ * rather than looked up: this renderer is pure, and keeping it that way is what
2506
+ * makes its wording testable without a bridge.
2507
+ */
2508
+ panelGapNote = "") {
2472
2509
  // A panel that cannot fence a WRITE gives reads only, however good the stamp is.
2473
2510
  const mutationsRefused = canMutate === false;
2474
2511
  const mutationsUnknown = canMutate === undefined;
@@ -2619,6 +2656,19 @@ refusalCause) {
2619
2656
  binding: "not_recovered",
2620
2657
  note: ` Could NOT read the live canvas identity — the panel did not answer, so NOTHING ` +
2621
2658
  `about this session's graph binding was observed.` +
2659
+ // #1043 — NAME THE VERSION GAP when that is what this is.
2660
+ //
2661
+ // The repair that would have avoided this read entirely
2662
+ // (refreshFenceFromOwnReply, #1161) trusts a workflow_uuid the panel
2663
+ // only publishes from 0.11.45. Three reports — #1043, #1077, #1174 —
2664
+ // deadlocked here on OLDER panels: the fix is present and inert, and
2665
+ // the message said only "could not be read", which reads as a mystery
2666
+ // rather than as "update the panel".
2667
+ //
2668
+ // Only a PARSEABLE version below the minimum says this; an unknown
2669
+ // version stays quiet rather than telling someone to update a panel
2670
+ // that may already be current.
2671
+ panelGapNote +
2622
2672
  // THREE states, not two (codex gate). "We could not read the existing
2623
2673
  // fence either" must not render as "it has no fence" — that absence was
2624
2674
  // never observed, and it is the same fold one level down.
@@ -7158,7 +7208,7 @@ export function buildPanelToolDefs() {
7158
7208
  canMutateNow = undefined;
7159
7209
  refusalCause = undefined;
7160
7210
  }
7161
- const fence = describeFenceRebind(fenceRebind, canMutateNow, refusalCause);
7211
+ const fence = describeFenceRebind(fenceRebind, canMutateNow, refusalCause, panelTooOldNote(ctx));
7162
7212
  if (!fence || fence.binding === "bound")
7163
7213
  return res;
7164
7214
  return appendNote(res, `The workflow WAS saved.${fence.note}`);
@@ -7397,6 +7447,19 @@ export function buildPanelToolDefs() {
7397
7447
  canMutateNow = undefined; // a guard that can throw is not a guard
7398
7448
  refusalCause = undefined;
7399
7449
  }
7450
+ // #1043 (codex review) — NO version note on THIS path, deliberately.
7451
+ //
7452
+ // The note claims that on 0.11.45+ "the command that re-pointed the canvas
7453
+ // repairs the fence from its own reply and never makes this read". That is
7454
+ // true of panel_save_workflow and panel_new_workflow, which DO carry a
7455
+ // workflow_uuid on their reply. panel_set_workflow_target does not — it has
7456
+ // no own-reply uuid to gain, so updating the panel would NOT remove this
7457
+ // failure, and saying it would is a confident wrong remedy.
7458
+ //
7459
+ // A user may well have arrived here recovering from a save/new that hit the
7460
+ // gap — but arriving here does not establish that, and guessing which of
7461
+ // the two it was is exactly the kind of unearned claim this file exists to
7462
+ // avoid. The save/new paths say it at the moment it is provable.
7400
7463
  const fence = fenceRebind
7401
7464
  ? describeFenceRebind(fenceRebind, canMutateNow, refusalCause)
7402
7465
  : undefined;
@@ -7460,7 +7523,7 @@ export function buildPanelToolDefs() {
7460
7523
  canMutateNow = undefined; // a guard that can throw is not a guard
7461
7524
  refusalCause = undefined;
7462
7525
  }
7463
- const fence = describeFenceRebind(fenceRebind, canMutateNow, refusalCause);
7526
+ const fence = describeFenceRebind(fenceRebind, canMutateNow, refusalCause, panelTooOldNote(ctx));
7464
7527
  if (!fence || fence.binding === "bound")
7465
7528
  return res;
7466
7529
  return appendNote(res, `The blank workflow WAS created.${fence.note}`);