{"record":{"id":"b5a1f3a51224471e","repo":"microsoft/semantic-kernel","slug":"function-call-required-but-no-function-steps-found-b5a1f3","errorCode":null,"errorMessage":"Function call required but no function steps found for agent `{agent.name}` thread: {thread_id}.","messagePattern":"Function call required but no function steps found for agent `(.+?)` thread: (.+?)\\.","errorType":"exception","errorClass":"AgentInvokeException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/agents/open_ai/assistant_thread_actions.py","lineNumber":528,"sourceCode":"                                    tool_content = generate_streaming_code_interpreter_content(agent.name, step_details)\n                                    content_is_visible = True\n                                if tool_content:\n                                    if output_messages is not None and not content_is_visible:\n                                        output_messages.append(tool_content)\n                                    if content_is_visible:\n                                        yield tool_content\n                    elif event.event == \"thread.run.requires_action\":\n                        run = event.data\n                        action_result = await cls._handle_streaming_requires_action(\n                            agent.name,\n                            kernel,\n                            run,\n                            function_steps,\n                            arguments,\n                            function_choice_behavior=function_choice_behavior,\n                        )\n                        if action_result is None:\n                            raise AgentInvokeException(\n                                f\"Function call required but no function steps found for agent `{agent.name}` \"\n                                f\"thread: {thread_id}.\"\n                            )\n                        for content in (\n                            action_result.function_call_streaming_content,\n                            action_result.function_result_streaming_content,\n                        ):\n                            if content and output_messages is not None:\n                                output_messages.append(content)\n\n                        stream = agent.client.beta.threads.runs.submit_tool_outputs_stream(\n                            run_id=run.id,\n                            thread_id=thread_id,\n                            tool_outputs=action_result.tool_outputs,  # type: ignore\n                        )\n                        break\n                    elif event.event == \"thread.run.completed\":\n                        run = event.data","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/agents/open_ai/assistant_thread_actions.py#L510-L546","documentation":"In the streaming invoke path, a thread.run.requires_action event means the assistant wants to call tools. The code calls _handle_streaming_requires_action; if it returns None (no usable function steps/function-call contents were extracted from the run), the run cannot proceed and AgentInvokeException is raised.","triggerScenarios":"Run requires tool action but get_function_call_contents yielded nothing for the function_steps — e.g. the referenced tools are not registered on the kernel, function_choice_behavior filters exclude every function, or the run's required_action payload names a tool the agent did not advertise.","commonSituations":"Registering tool metadata on the assistant but not adding the matching kernel plugin/functions; using FunctionChoiceBehavior.Auto(filters=...) that excludes all relevant functions; version mismatch between assistant tool definitions and kernel function names/signatures.","solutions":["Ensure the kernel functions referenced by the assistant's tools are actually registered (add_plugin) before invoke.","Check function_choice_behavior filters are not excluding the functions the run is trying to call.","Verify tool_metadata / AssistantToolParam definitions match kernel function names and that get_function_call_contents can resolve them.","Reproduce with debug logging on 'requires_action' to see which tool the run expected but was missing."],"exampleFix":"// before\nassistant = OpenAIAssistantAgent(..., tools=[{...}])\nawait assistant.invoke(kernel=kernel, thread_id=tid)  # requires_action but no steps\n\n// after\nkernel.add_plugin(MathPlugin(), plugin_name=\"math\")\nawait assistant.invoke(kernel=kernel, thread_id=tid)  # functions now resolvable","handlingStrategy":"validation","validationCode":"def tools_resolvable(agent, kernel) -> bool:\n    names = {f\"{p}.{f}\" for p in kernel.plugins for f in p.functions}\n    declared = {t.get('function', {}).get('name') for t in (agent.tools or []) if isinstance(t, dict)}\n    return declared <= names","typeGuard":null,"tryCatchPattern":"from semantic_kernel.exceptions import AgentInvokeException\n\ntry:\n    async for msg in assistant.invoke_stream(kernel=kernel, thread_id=tid):\n        ...\nexcept AgentInvokeException as e:\n    if \"no function steps\" in str(e):\n        logger.error(\"register the kernel functions the assistant expects: %s\", agent.tools)","preventionTips":["Register all kernel plugins/functions referenced by the assistant's tools before invoke.","Keep function_choice_behavior filters permissive enough to include needed functions.","Mirror tool metadata names exactly to kernel function/plugin names."],"tags":["openai","assistant","function-calling","streaming","agentinvoke"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}