{"record":{"id":"0599b6d73a1fbeb5","repo":"invoke-ai/InvokeAI","slug":"dashscope-async-response-missing-results-output","errorCode":null,"errorMessage":"DashScope async response missing results: {output}","messagePattern":"DashScope async response missing results: (.+?)","errorType":"exception","errorClass":"ExternalProviderRequestError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/external_generation/providers/alibabacloud.py","lineNumber":264,"sourceCode":"            raise ExternalProviderRequestError(f\"DashScope response contained no images: {data}\")\n\n        return ExternalGenerationResult(\n            images=images,\n            seed_used=request.seed,\n            provider_request_id=request_id,\n            provider_metadata={\"model\": request.model.provider_model_id},\n        )\n\n    def _parse_async_response(\n        self,\n        output: dict[str, object],\n        request: ExternalGenerationRequest,\n        request_id: str | None,\n    ) -> ExternalGenerationResult:\n        \"\"\"Parse the async task completion response.\"\"\"\n        results = output.get(\"results\")\n        if not isinstance(results, list):\n            raise ExternalProviderRequestError(f\"DashScope async response missing results: {output}\")\n\n        images: list[ExternalGeneratedImage] = []\n        for result in results:\n            if not isinstance(result, dict):\n                continue\n            url = result.get(\"url\")\n            if isinstance(url, str) and url:\n                pil_image = self._download_image(url)\n                images.append(ExternalGeneratedImage(image=pil_image, seed=request.seed))\n                continue\n            b64_image = result.get(\"b64_image\")\n            if isinstance(b64_image, str) and b64_image:\n                pil_image = decode_image_base64(b64_image)\n                images.append(ExternalGeneratedImage(image=pil_image, seed=request.seed))\n\n        if not images:\n            raise ExternalProviderRequestError(f\"DashScope async response contained no images: {output}\")\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/external_generation/providers/alibabacloud.py#L246-L282","documentation":"_parse_async_response, invoked when a polled DashScope task reaches SUCCEEDED status, expects output.results to be a list of image results. If 'results' is missing or not a list, the provider raises ExternalProviderRequestError including the output payload, since a succeeded task without results cannot be processed.","triggerScenarios":"Task status is SUCCEEDED but output lacks 'results' — DashScope schema drift for the async image-generation endpoint, or a task completed with output fields other than results (e.g. video-style output).","commonSituations":"Custom external://alibabacloud/<model_id> models whose async responses use a different results field name; DashScope API version changes; intermediate SUCCEEDED states with partial payloads.","solutions":["Inspect the embedded output payload for the actual results field name used by your model","Check whether the model's async API uses a different key (e.g. 'output.video_url' or per-frame fields) and update the parser or move the model to _SYNC_MODELS","Pin/verify the DashScope API version implied by external_alibabacloud_base_url","Update InvokeAI to pick up provider fixes for schema changes"],"exampleFix":"// before\nresults = output.get(\"results\")\nif not isinstance(results, list):\n    raise ExternalProviderRequestError(f\"DashScope async response missing results: {output}\")\n// after\nresults = output.get(\"results\") or output.get(\"output\", {}).get(\"results\")\nif not isinstance(results, list):\n    raise ExternalProviderRequestError(f\"DashScope async response missing results: {output}\")","handlingStrategy":"type-guard","validationCode":"# Only submit async tasks for models confirmed to use the async image-generation API\nassert model_id in _ASYNC_MODELS, f\"{model_id} not validated for async API\"","typeGuard":"def has_results(output: dict) -> bool:\n    return isinstance(output.get(\"results\"), list)","tryCatchPattern":"try:\n    result = provider.generate(request)\nexcept ExternalProviderRequestError as e:\n    if \"missing results\" in str(e):\n        log.error(\"Async task SUCCEEDED without results; schema mismatch: %s\", e)\n    raise","preventionTips":["Test custom async models against the DashScope API directly before wiring them in","Keep the provider parser in sync with the DashScope API version implied by your base_url","Log the full output payload on failure","Prefer sync models that InvokeAI actively tests"],"tags":["dashscope","async-task","schema-mismatch","polling"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}