From f80ed87b94bd7338e7793924cd3eebd3b643f30e Mon Sep 17 00:00:00 2001 From: ethanfel Date: Sun, 28 Jun 2026 14:00:50 +0200 Subject: [PATCH] docs: note run_workflow poll is best-effort Add a comment clarifying the run_workflow history poll returns as soon as any output node appears, and that the design's upgrade path is the ComfyUI websocket `executed` event. Co-Authored-By: Claude Opus 4.8 --- src/bridge/mcp_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bridge/mcp_tools.py b/src/bridge/mcp_tools.py index c61f2d4..cd7197d 100644 --- a/src/bridge/mcp_tools.py +++ b/src/bridge/mcp_tools.py @@ -34,6 +34,9 @@ async def comfy_run_workflow(name: str, inputs: dict | None = None, import asyncio for _ in range(600): # ~60s at 0.1s res = await workflows.fetch_result(prompt_id, base_url=COMFY_BASE_URL) + # Best-effort: returns as soon as any output node appears in /history. + # The design's upgrade path is the ComfyUI websocket `executed` event + # for precise completion signalling instead of polling. if res["images"] or res["raw"]: return {"prompt_id": prompt_id, "status": "done", **res} await asyncio.sleep(0.1)