comfyui-mcp 0.50.32 → 0.50.34

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.
@@ -26,6 +26,7 @@ import { panelRecoveryContext } from "../services/panel-recovery.js";
26
26
  import { isPanelAutoInstallDisabled } from "../services/panel-installer.js";
27
27
  import { SelfRestarter, canSelfRestart } from "../services/self-restart.js";
28
28
  import { pairUrlDurability } from "./pair-durability.js";
29
+ import { loadOrCreatePairToken } from "./pair-token-store.js";
29
30
  import { SessionStore, workflowIdentityParts } from "./session-store.js";
30
31
  import { unreachableReason, noPanelTabReason, identityReason } from "./fence-refusal.js";
31
32
  import { SHARED_SESSION_SCOPE, isScopeAddress, conversationTabs, shouldRetireSharedAgent, messageOrigin, normalizeHelloBackend, workflowOriginNote, } from "../services/session-scope.js";
@@ -912,9 +913,18 @@ export async function runPanelOrchestrator() {
912
913
  let pairToken = envPairToken;
913
914
  let pairListenerStarted = false;
914
915
  let pairTunnel = null;
916
+ // #875 — the token is PERSISTED, not per-session. It used to be minted fresh on
917
+ // every run, so a self-restart (on by default, hourly npm check) invalidated the
918
+ // URL the phone had saved. The reporter experienced that as "updating the npm
919
+ // version bricks my communication with the agent" and asked to pin the version;
920
+ // the version was never the cause. An explicit COMFYUI_MCP_PAIR_TOKEN still wins.
921
+ let pairTokenPersisted = envPairToken !== null;
915
922
  const ensurePairListener = async () => {
916
- if (!pairToken)
917
- pairToken = randomBytes(24).toString("hex");
923
+ if (!pairToken) {
924
+ const loaded = loadOrCreatePairToken();
925
+ pairToken = loaded.token;
926
+ pairTokenPersisted = loaded.persisted;
927
+ }
918
928
  if (!pairListenerStarted) {
919
929
  await bridge.addListener("0.0.0.0", pairPort, pairToken);
920
930
  pairListenerStarted = true;
@@ -3966,7 +3976,7 @@ export async function runPanelOrchestrator() {
3966
3976
  // cause, and nothing here had told them.
3967
3977
  const durability = pairUrlDurability({
3968
3978
  mode,
3969
- pinnedToken: envPairToken !== null,
3979
+ stableToken: envPairToken !== null || pairTokenPersisted,
3970
3980
  autoRestart: canSelfRestart(),
3971
3981
  });
3972
3982
  logger.info(`[panel-orchestrator] pairing URL minted (${mode}) — ` +