{"record":{"id":"1245edeb8605044f","repo":"apache/beam","slug":"agent-runner-agent-name-did-not-return-a-response-final","errorCode":null,"errorMessage":"Agent {runner.agent.name} did not return a response, final event: {event}","messagePattern":"Agent (.+?) did not return a response, final event: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/inference/agent_development_kit.py","lineNumber":301,"sourceCode":"    try:\n      # Attempt to get the specific session\n      await runner.session_service.get_session(session_id)\n    except Exception as e:\n      await runner.session_service.create_session(\n          app_name=app_name,\n          user_id=user_id,\n          session_id=session_id,\n      )\n\n    async for event in runner.run_async(\n        user_id=user_id,\n        session_id=session_id,\n        new_message=message,\n    ):\n      if event.is_final_response():\n        if event.content and event.content.parts:\n          return \"\".join([p.text for p in event.content.parts])\n        raise ValueError(\n            f\"Agent {runner.agent.name} did not return a response, \"\n            f\"final event: {event}\")\n\n    raise ValueError(f\"Agent {runner.agent.name} did not return a response\")\n\n  def get_metrics_namespace(self) -> str:\n    return \"ADKAgentModelHandler\"\n","sourceCodeStart":283,"sourceCodeEnd":309,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/inference/agent_development_kit.py#L283-L309","documentation":"During inference the ADK runner emitted a final event whose content carried no text parts, so _invoke_agent has no response to return; the error includes the final event to show what the agent produced instead.","triggerScenarios":"Thrown at sdks/python/apache_beam/ml/inference/agent_development_kit.py:301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the final event in the message to see what the agent returned (e.g. tool calls or empty content)","Adjust the agent so its final response contains text parts (e.g. ensure a final LLM answer step)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}