From da94323e5d448ce889c58314589be2fd616592d2 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Feb 2026 00:16:40 +0000 Subject: [PATCH] Use fal.ai-provided status_url/response_url for queue polling The queue submission response includes `status_url` and `response_url` with the correct app path. Previously we stripped the `/edit` route from the endpoint to build these URLs ourselves, which could cause polling to target the wrong path and time out. Now we use the URLs fal.ai returns directly, falling back to full-endpoint construction if they're absent. https://claude.ai/code/session_01VtRzQMdLschx9awGyTGGH7 --- nodes.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nodes.py b/nodes.py index 226690f..bf1b2ba 100644 --- a/nodes.py +++ b/nodes.py @@ -62,14 +62,15 @@ def _submit_request(endpoint, payload, timeout, api_key): if not request_id: raise RuntimeError(f"No request_id in queue response: {queue_data}") - # fal.ai app ID is "owner/name" (first two segments); any extra segments - # (e.g. /edit) are routes within the app and must NOT appear in the - # status / result polling URLs. - parts = endpoint.split("/", 2) - app_id = f"{parts[0]}/{parts[1]}" - - status_url = f"https://queue.fal.run/{app_id}/requests/{request_id}/status" - result_url = f"https://queue.fal.run/{app_id}/requests/{request_id}" + # Use the URLs returned by fal.ai (they include the correct app path). + status_url = queue_data.get( + "status_url", + f"https://queue.fal.run/{endpoint}/requests/{request_id}/status", + ) + result_url = queue_data.get( + "response_url", + f"https://queue.fal.run/{endpoint}/requests/{request_id}", + ) deadline = time.time() + timeout while time.time() < deadline: