{"record":{"id":"047f139240d0afb9","repo":"FoundationAgents/OpenManus","slug":"no-response-received-from-the-llm","errorCode":null,"errorMessage":"No response received from the LLM","messagePattern":"No response received from the LLM","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"app/agent/toolcall.py","lineNumber":93,"sourceCode":"        self.tool_calls = tool_calls = (\n            response.tool_calls if response and response.tool_calls else []\n        )\n        content = response.content if response and response.content else \"\"\n\n        # Log response info\n        logger.info(f\"✨ {self.name}'s thoughts: {content}\")\n        logger.info(\n            f\"🛠️ {self.name} selected {len(tool_calls) if tool_calls else 0} tools to use\"\n        )\n        if tool_calls:\n            logger.info(\n                f\"🧰 Tools being prepared: {[call.function.name for call in tool_calls]}\"\n            )\n            logger.info(f\"🔧 Tool arguments: {tool_calls[0].function.arguments}\")\n\n        try:\n            if response is None:\n                raise RuntimeError(\"No response received from the LLM\")\n\n            # Handle different tool_choices modes\n            if self.tool_choices == ToolChoice.NONE:\n                if tool_calls:\n                    logger.warning(\n                        f\"🤔 Hmm, {self.name} tried to use tools when they weren't available!\"\n                    )\n                if content:\n                    self.memory.add_message(Message.assistant_message(content))\n                    return True\n                return False\n\n            # Create and add assistant message\n            assistant_msg = (\n                Message.from_tool_calls(content=content, tool_calls=self.tool_calls)\n                if self.tool_calls\n                else Message.assistant_message(content)\n            )","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/agent/toolcall.py#L75-L111","documentation":"Raised in ToolCallAgent.think() when the underlying LLM call returned None, meaning the provider gave no completion object at all (not just empty text). This sits after response/content/tool_calls extraction, so it indicates the ask() layer failed to produce a ChatCompletion — typically a client misconfiguration, exhausted retries swallowed upstream, or a provider returning an empty body.","triggerScenarios":"LLM client returning None from ask_with_tools (e.g. after failed retries that return None instead of raising), API base URL pointing at a service that returns 200 with an empty body, or a mock/stub returning None during tests.","commonSituations":"Wrong OPENAI_BASE_URL or model name causing a gateway to return empty responses; rate limiting handled by returning None upstream; test doubles not mimicking the response shape.","solutions":["Verify the LLM config: correct base_url, api_key, and model name in config.toml [llm] section","Reproduce with a direct await llm.ask_with_tools(...) call to inspect what the client actually returns","If it is None after retries, inspect logs just above for the swallowed API error and fix that root cause (auth, quota, network)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ok = await agent.think()\nexcept RuntimeError as e:\n    if \"No response received from the LLM\" in str(e):\n        logger.warning(\"LLM returned nothing; retrying once\")\n        ok = await agent.think()\n    else:\n        raise","preventionTips":["Health-check the LLM endpoint (one small ask()) before starting the agent loop","Verify base_url/api_key/model in config before the run","In tests, make stubs return a realistic ChatCompletion-shaped object, never None"],"tags":["llm","agent","runtime","provider"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}