From 4d9bed096ea4975991bec8e1c199b341251483a2 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Feb 2026 23:59:10 +0000 Subject: [PATCH] Fix 405 error on image edit status polling The fal.ai queue status/result URLs must use only the base app ID (owner/name), not the full endpoint path. The /edit route was being included in the polling URLs, causing a 405 Method Not Allowed. Submit URL: queue.fal.run/fal-ai/nano-banana-pro/edit (correct) Status URL: queue.fal.run/fal-ai/nano-banana-pro/requests/{id}/status (was incorrectly: .../nano-banana-pro/edit/requests/{id}/status) https://claude.ai/code/session_01VtRzQMdLschx9awGyTGGH7 --- nodes.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index a15a212..8a98d8f 100644 --- a/nodes.py +++ b/nodes.py @@ -59,8 +59,14 @@ def _submit_request(endpoint, payload, timeout, api_key): if not request_id: raise RuntimeError(f"No request_id in queue response: {queue_data}") - status_url = f"https://queue.fal.run/{endpoint}/requests/{request_id}/status" - result_url = f"https://queue.fal.run/{endpoint}/requests/{request_id}" + # 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}" deadline = time.time() + timeout while time.time() < deadline: