{"record":{"id":"760dc51a37ab4b9d","repo":"BerriAI/litellm","slug":"run-timed-out-waiting-for-completion","errorCode":null,"errorMessage":"Run timed out waiting for completion","messagePattern":"Run timed out waiting for completion","errorType":"http","errorClass":"AzureAIAgentsError","httpStatus":408,"severity":"error","filePath":"litellm/llms/azure_ai/agents/handler.py","lineNumber":422,"sourceCode":"        status_url: Final = self._build_run_status_url(api_base, thread_id, run_id, api_version)\n        for _ in range(self.config.MAX_POLL_ATTEMPTS):\n            response = make_request(\"GET\", status_url)\n            self._check_response(response, [200], \"Failed to get run status\")\n\n            status_data: _RunStatus = response.json()\n            status = status_data.get(\"status\")\n            verbose_logger.debug(\"Run status: %s\", status)\n\n            if status == \"completed\":\n                break\n            elif status in [\"failed\", \"cancelled\", \"expired\"]:\n                error_data: _RunStatus = response.json()\n                error_msg = error_data.get(\"last_error\", {}).get(\"message\", \"Unknown error\")\n                raise AzureAIAgentsError(status_code=500, message=f\"Run {status}: {error_msg}\")\n\n            time.sleep(self.config.POLL_INTERVAL_SECONDS)\n        else:\n            raise AzureAIAgentsError(status_code=408, message=\"Run timed out waiting for completion\")\n\n        # Step 5: Get messages\n        response = make_request(\"GET\", self._build_list_messages_url(api_base, thread_id, api_version))\n        self._check_response(response, [200], \"Failed to get messages\")\n\n        messages_data: Final[_AzureMessagesData] = response.json()\n        content, annotations = self._extract_content_from_messages(messages_data)\n        return thread_id, content, annotations\n\n    # -------------------------------------------------------------------------\n    # Async Completion\n    # -------------------------------------------------------------------------\n    async def acompletion(\n        self,\n        model: str,\n        messages: list[dict[str, object]],\n        api_base: str,\n        api_key: str,","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/agents/handler.py#L404-L440","documentation":"Error \"Run timed out waiting for completion\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/agents/handler.py:422 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the wait timeout or investigate the stuck run in Azure AI Foundry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}