CoplayDev/unity-mcp · error · Exception

fal submit returned no request_id: {truncated_response}

Error message

fal submit returned no request_id: {truncated_response}

What it means

The audio adapter mirrors the image adapter: after submitting to fal it expects either 'response_url' or 'request_id'. If both are missing/empty it throws a generic Exception whose message is the truncated response scrubbed of the apiKey. This indicates an unexpected or empty fal response for an audio job.

Source

Thrown at MCPForUnity/Editor/Services/AssetGen/Providers/FalAudioAdapter.cs:56

            var spec = new HttpRequestSpec
            {
                Method = "POST",
                Url = url,
                ContentType = "application/json",
                Body = Encoding.UTF8.GetBytes(BuildBody(model, req).ToString(Formatting.None))
            };
            spec.Headers["Authorization"] = "Key " + apiKey;

            HttpResult res = await http.SendAsync(spec, ct);
            JObject json = ParseOk(res, apiKey, "submit");

            string responseUrl = json["response_url"]?.ToString();
            if (string.IsNullOrEmpty(responseUrl))
            {
                string requestId = json["request_id"]?.ToString();
                if (string.IsNullOrEmpty(requestId))
                    throw new Exception(SecretRedactor.Scrub("fal submit returned no request_id: " + ProviderHttp.Truncate(res?.Text), apiKey));
                responseUrl = QueueBase + model + "/requests/" + requestId;
            }
            // The response_url is provider-controlled; refuse to later attach the key to any host
            // other than the fal queue.
            ProviderHttp.RequireHost(responseUrl, QueueHost, apiKey, "fal submit response_url");
            return responseUrl;
        }

        // Duration is catalog-driven: the model's ModelEntry names the request key (seconds_total /
        // duration) and the clamp bounds. A duration-controllable endpoint (e.g. CassetteAI Music)
        // always sends a duration >= 1 — a prompt-only body is rejected with fal 422
        // "duration Field required" — while a non-duration model (Lyria) or an unknown model stays
        // prompt-only.
        private static JObject BuildBody(string model, AudioGenRequest req)
        {
            var body = new JObject { ["prompt"] = req.Prompt ?? string.Empty };

            ModelEntry entry = AssetGenModelCatalog.Find(model);

View on GitHub (pinned to c21bf496bc)

Solutions

  1. Inspect the truncated response text in the message (apiKey scrubbed) to see fal's actual body.
  2. Verify the audio model id and submit endpoint are current and queueable per fal's docs.
  3. Check fal status and the model's request requirements (e.g. duration field).
  4. Confirm the API key is valid.
Defensive patterns

Strategy: retry

Validate before calling

// Guard submit inputs; response shape cannot be validated pre-call.
if (string.IsNullOrEmpty(modelId)) throw new ArgumentException("modelId required");
if (string.IsNullOrEmpty(apiKey)) throw new ArgumentException("apiKey required");

Try / catch

for (int attempt = 0; attempt < 3; attempt++)
{
    try { return await falAudio.SubmitAsync(model, req, apiKey, http, ct); }
    catch (Exception ex) when (attempt < 2 && ex.Message.Contains("no request_id"))
    {
        await Task.Delay(500 * (attempt + 1), ct);
    }
}

Prevention

When it happens

Trigger: fal returned HTTP success for an audio submit but the body contained neither 'response_url' nor 'request_id'; the audio model id is wrong and returned an unexpected body; a non-JSON or HTML body was parsed as a 2xx.

Common situations: fal audio API shape/version change; using a non-duration model id where the adapter expected a queueable one; auth/quota edge returning an empty body; a proxy altering the response.

Related errors


AI-assisted analysis of CoplayDev/unity-mcp@c21bf496bc (2026-08-13). Data as JSON: /api/errors/dd30008a8623409c. Report an issue: GitHub.