microsoft/semantic-kernel · error · RuntimeError
Function call required but no function steps found for agent
Error message
Function call required but no function steps found for agent `{agent.name}` thread: {thread_id}. What it means
Raised as a RuntimeError during streaming when a ThreadRun transitions to 'requires_action' with a SubmitToolOutputsAction, but _handle_streaming_requires_action returns None (no function call contents could be extracted from the run's required_action). The framework needs function steps to emit tool-call streaming content, so their absence is an internal inconsistency it cannot proceed past.
Source
Thrown at python/semantic_kernel/agents/azure_ai/agent_thread_actions.py:703
elif event_type == AgentStreamEvent.THREAD_RUN_REQUIRES_ACTION:
logger.debug(
f"Entering step type {event_type}, agent `{agent.name}` and "
f"thread `{thread_id}` with event data: {event_data}"
)
run = cast(ThreadRun, event_data)
# Check if this is a function call request
if isinstance(run.required_action, SubmitToolOutputsAction):
action_result = await cls._handle_streaming_requires_action(
agent_name=agent.name,
kernel=kernel,
run=run,
function_steps=function_steps,
arguments=arguments,
function_choice_behavior=function_choice_behavior,
)
if action_result is None:
raise RuntimeError(
f"Function call required but no function steps found for agent `{agent.name}` "
f"thread: {thread_id}."
)
for content in (
action_result.function_call_streaming_content,
action_result.function_result_streaming_content,
):
if content and output_messages is not None:
if thread_msg_id and THREAD_MESSAGE_ID not in content.metadata:
content.metadata[THREAD_MESSAGE_ID] = thread_msg_id
output_messages.append(content)
handler: BaseAsyncAgentEventHandler = AsyncAgentEventHandler()
await agent.client.agents.runs.submit_tool_outputs_stream(
run_id=run.id,
thread_id=thread_id,
tool_outputs=action_result.tool_outputs, # type: ignoreView on GitHub (pinned to c028a0c7dc)
Solutions
- Upgrade semantic-kernel and the azure-ai SDK to aligned versions so requires_action payloads are parsed correctly.
- Disable auto function calling for the call if you do not need it, avoiding the requires_action path.
- Inspect run.required_action at debug level to confirm the tool-call payload shape and report if it diverges from the wrapper's expectations.
Defensive patterns
Strategy: try-catch
Try / catch
try:
async for chunk in agent.invoke_stream(thread=thread):
...
except RuntimeError as e:
if 'no function steps found' in str(e):
logger.error('requires_action yielded no function steps; check azure-ai SDK compatibility')
# fall back to non-streaming invoke without auto function calling
raise Prevention
- Align semantic-kernel and azure-ai SDK versions so requires_action payloads parse.
- Disable auto function calling if you do not rely on it, to avoid the requires_action path.
When it happens
Trigger: Azure returns a requires_action run whose tool call payload is empty or shaped in a way get_function_call_contents cannot parse, so function_steps yields nothing and action_result is None.
Common situations: Azure SDK version producing a required_action structure the wrapper does not expect; a run that requires action but carries no tool calls (edge server behavior); partial/ malformed run object during streaming.
Related errors
- Run failed with status: `{run_failed.status}` for agent `{ag
- The AutoGenConversableAgent does not support streaming.
- Unsupported Bing tool call type: {type(bing_tool_call)}
- Run failed with status: `{run.status}` for agent `{agent.nam
- Failed to retrieve messages for thread `{thread_id}`.
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/582ed19879237ed7.
Report an issue: GitHub.