{"record":{"id":"124aab5ec1cefac5","repo":"CoplayDev/unity-mcp","slug":"fal-submit-returned-no-request-id-truncated-resp","errorCode":null,"errorMessage":"fal submit returned no request_id: {truncated_response}","messagePattern":"fal submit returned no request_id: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Services/AssetGen/Providers/FalAdapter.cs","lineNumber":77,"sourceCode":"            var spec = new HttpRequestSpec\n            {\n                Method = \"POST\",\n                Url = url,\n                ContentType = \"application/json\",\n                Body = Encoding.UTF8.GetBytes(body.ToString(Formatting.None))\n            };\n            spec.Headers[\"Authorization\"] = \"Key \" + apiKey;\n\n            HttpResult res = await http.SendAsync(spec, ct);\n            JObject json = ParseOk(res, apiKey, \"submit\");\n\n            // Prefer response_url; fall back to building it from request_id.\n            string responseUrl = json[\"response_url\"]?.ToString();\n            if (string.IsNullOrEmpty(responseUrl))\n            {\n                string requestId = json[\"request_id\"]?.ToString();\n                if (string.IsNullOrEmpty(requestId))\n                    throw new Exception(SecretRedactor.Scrub(\"fal submit returned no request_id: \" + ProviderHttp.Truncate(res?.Text), apiKey));\n                // Queue request URLs are namespaced by owner/app without the action sub-path,\n                // so build from the base model id (not `url`, which may end in /edit).\n                responseUrl = QueueBase + model + \"/requests/\" + requestId;\n            }\n            // The response_url is provider-controlled; refuse to later attach the key to any host\n            // other than the fal queue.\n            ProviderHttp.RequireHost(responseUrl, QueueHost, apiKey, \"fal submit response_url\");\n            return responseUrl;\n        }\n\n        public async Task<ProviderPollResult> PollAsync(string providerJobId, string apiKey, IHttpTransport http, CancellationToken ct)\n        {\n            if (string.IsNullOrEmpty(providerJobId)) throw new ArgumentNullException(nameof(providerJobId));\n            string responseUrl = providerJobId;\n            // providerJobId is provider-supplied (the submit-time response_url). Re-validate before\n            // attaching the key so a poisoned URL can never exfiltrate it.\n            ProviderHttp.RequireHost(responseUrl, QueueHost, apiKey, \"fal poll\");\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Services/AssetGen/Providers/FalAdapter.cs#L59-L95","documentation":"After submitting to fal, the image adapter expects either a 'response_url' or a 'request_id' field in the JSON response. If both are missing/empty, it throws a generic Exception whose message is the truncated response text, scrubbed of the apiKey via SecretRedactor. This signals an unexpected or empty fal response.","triggerScenarios":"fal returned an HTTP success but the body contained neither 'response_url' nor 'request_id'; the response shape changed; a redirect or HTML error page was parsed as a 2xx body.","commonSituations":"fal API version/shape change; wrong endpoint or model id returning an unexpected body; quota/auth edge returning an empty body; a proxy mangling the response.","solutions":["Inspect the truncated response text in the message (the apiKey is scrubbed) to see what fal actually returned.","Verify the model id and submit endpoint are current per fal's docs.","Check fal status pages for response-shape or outage notices.","Confirm the API key is valid and has not been rotated or revoked."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// You cannot validate provider response shape before the call, but you can guard the submit inputs.\nif (string.IsNullOrEmpty(modelId)) throw new ArgumentException(\"modelId required\");\nif (string.IsNullOrEmpty(apiKey)) throw new ArgumentException(\"apiKey required\");","typeGuard":null,"tryCatchPattern":"for (int attempt = 0; attempt < 3; attempt++)\n{\n    try { return await fal.SubmitAsync(model, req, apiKey, http, ct); }\n    catch (Exception ex) when (attempt < 2 && ex.Message.Contains(\"no request_id\"))\n    {\n        await Task.Delay(500 * (attempt + 1), ct); // transient empty response; retry\n    }\n}","preventionTips":["Inspect the truncated, key-scrubbed response text in the message to diagnose shape changes.","Keep model ids and endpoints aligned with fal's current docs.","Confirm the API key is valid; an auth edge can return an unexpected body."],"tags":["assetgen","fal","network","api","image"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}