{"record":{"id":"baf7a43397629467","repo":"microsoft/semantic-kernel","slug":"agent-self-agent-name-did-not-return-any-resp","errorCode":null,"errorMessage":"Agent \"{self._agent.name}\" did not return any response.","messagePattern":"Agent \"(.+?)\" did not return any response\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/orchestration/agent_actor_base.py","lineNumber":193,"sourceCode":"        async for response_item in self._agent.invoke_stream(\n            messages,  # type: ignore[arg-type]\n            thread=self._agent_thread,\n            on_intermediate_message=self._handle_intermediate_message,\n            **kwargs,\n        ):\n            # Buffer message chunks and stream them with correct is_final flag.\n            streaming_message_buffer.append(response_item.message)\n            if len(streaming_message_buffer) > 1:\n                await self._call_streaming_agent_response_callback(streaming_message_buffer[-2], is_final=False)\n            if self._agent_thread is None:\n                self._agent_thread = response_item.thread\n\n        if streaming_message_buffer:\n            # Call the callback for the last message chunk with is_final=True.\n            await self._call_streaming_agent_response_callback(streaming_message_buffer[-1], is_final=True)\n\n        if not streaming_message_buffer:\n            raise RuntimeError(f'Agent \"{self._agent.name}\" did not return any response.')\n\n        # Build the full response from the streaming messages\n        full_response = sum(streaming_message_buffer[1:], streaming_message_buffer[0])\n        await self._call_agent_response_callback(full_response)\n\n        return full_response\n\n    def _create_messages(self, additional_messages: DefaultTypeAlias | None = None) -> list[ChatMessageContent]:\n        \"\"\"Create a list of messages to be sent to the agent along with a potential thread.\n\n        Args:\n            additional_messages (DefaultTypeAlias | None): Additional messages to be sent to the agent.\n\n        Returns:\n            list[ChatMessageContent]: A list of messages to be sent to the agent.\n        \"\"\"\n        base_messages = self._message_cache.messages[:]\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/orchestration/agent_actor_base.py#L175-L211","documentation":"Raised as a RuntimeError in the streaming invoke path of AgentActorBase when the agent's invoke_stream async iterator yielded zero chunks (streaming_message_buffer is empty). It indicates the agent produced no streaming output at all, which is usually a symptom of an upstream error, an empty/filtered response, or a misconfigured streaming callback.","triggerScenarios":"self._agent.invoke_stream(...) completes its async iteration without yielding any response_item, so streaming_message_buffer stays empty. Happens when the agent returns an empty stream, when an exception inside the agent is swallowed, or when filtering drops everything.","commonSituations":"The underlying agent call failed silently or returned an empty completion; tool/function execution produced no text and the stream closed early; streaming callback misconfiguration; the model returned only reasoning with no output; bugs in a custom agent subclass that yields nothing.","solutions":["Check the agent's logs / on_intermediate_message handler to see why no chunks were emitted.","Verify the agent's instructions and inputs actually produce a response (test invoke directly outside the orchestration).","Ensure the model/service is reachable and not returning empty due to content filtering or token limits.","If using a custom agent, confirm invoke_stream yields at least one StreamingChatMessageContent."],"exampleFix":"# Debug by invoking the agent directly to confirm it produces output:\nasync for chunk in agent.invoke_stream(messages, thread=thread):\n    print(chunk)\n# If empty, fix the agent config (model, instructions, tools) before running the orchestration.","handlingStrategy":"validation","validationCode":"# Pre-check that the agent yields at least one chunk before running the orchestration:\nasync def agent_emits(agent, messages, thread):\n    async for _ in agent.invoke_stream(messages, thread=thread):\n        return True\n    return False","typeGuard":null,"tryCatchPattern":"try:\n    result = await orchestration.invoke([...], runtime=runtime)\nexcept RuntimeError as ex:\n    if \"did not return any response\" in str(ex):\n        # invoke the agent directly to diagnose\n        ...","preventionTips":["Test each agent's invoke_stream in isolation before plugging into an orchestration.","Ensure agent instructions/tools produce at least one output chunk.","Register on_intermediate_message to observe why the stream is empty."],"tags":["orchestration","streaming","agent","empty-response"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}