FoundationAgents/OpenManus · error · RuntimeError
No response received from the LLM
Error message
No response received from the LLM
What it means
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.
Source
Thrown at app/agent/toolcall.py:93
self.tool_calls = tool_calls = (
response.tool_calls if response and response.tool_calls else []
)
content = response.content if response and response.content else ""
# Log response info
logger.info(f"✨ {self.name}'s thoughts: {content}")
logger.info(
f"🛠️ {self.name} selected {len(tool_calls) if tool_calls else 0} tools to use"
)
if tool_calls:
logger.info(
f"🧰 Tools being prepared: {[call.function.name for call in tool_calls]}"
)
logger.info(f"🔧 Tool arguments: {tool_calls[0].function.arguments}")
try:
if response is None:
raise RuntimeError("No response received from the LLM")
# Handle different tool_choices modes
if self.tool_choices == ToolChoice.NONE:
if tool_calls:
logger.warning(
f"🤔 Hmm, {self.name} tried to use tools when they weren't available!"
)
if content:
self.memory.add_message(Message.assistant_message(content))
return True
return False
# Create and add assistant message
assistant_msg = (
Message.from_tool_calls(content=content, tool_calls=self.tool_calls)
if self.tool_calls
else Message.assistant_message(content)
)View on GitHub (pinned to 52a13f2a57)
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)
Defensive patterns
Strategy: retry
Try / catch
try:
ok = await agent.think()
except RuntimeError as e:
if "No response received from the LLM" in str(e):
logger.warning("LLM returned nothing; retrying once")
ok = await agent.think()
else:
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Empty or invalid response from LLM
- Tool calls required but none provided
- No primary agent available
- Request may exceed input token limit (Current: {self.total_i
- Empty response from streaming LLM
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/047f139240d0afb9.
Report an issue: GitHub.