{"record":{"id":"3c75676de275504d","repo":"microsoft/autogen","slug":"function-call-id-is-required","errorCode":null,"errorMessage":"Function call ID is required","messagePattern":"Function call ID is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/semantic_kernel/_sk_chat_completion_adapter.py","lineNumber":419,"sourceCode":"                self._tools_plugin.functions[tool.get(\"name\")] = kernel_function  # type: ignore\n\n        kernel.add_plugin(self._tools_plugin)\n\n    def _process_tool_calls(self, result: ChatMessageContent) -> list[FunctionCall]:\n        \"\"\"Process tool calls from SK ChatMessageContent\"\"\"\n        function_calls: list[FunctionCall] = []\n        for item in result.items:\n            if isinstance(item, FunctionCallContent):\n                # Extract plugin name and function name\n                plugin_name = item.plugin_name or \"\"\n                function_name = item.function_name\n                if plugin_name:\n                    full_name = f\"{plugin_name}-{function_name}\"\n                else:\n                    full_name = function_name\n\n                if item.id is None:\n                    raise ValueError(\"Function call ID is required\")\n\n                if isinstance(item.arguments, Mapping):\n                    arguments = json.dumps(item.arguments)\n                else:\n                    arguments = item.arguments or \"{}\"\n\n                function_calls.append(FunctionCall(id=item.id, name=full_name, arguments=arguments))\n        return function_calls\n\n    def _get_kernel(self, extra_create_args: Mapping[str, Any]) -> Kernel:\n        kernel = extra_create_args.get(\"kernel\", self._kernel)\n        if not kernel:\n            raise ValueError(\"kernel must be provided either in constructor or extra_create_args\")\n        if not isinstance(kernel, Kernel):\n            raise ValueError(\"kernel must be an instance of semantic_kernel.kernel.Kernel\")\n        return kernel\n\n    def _get_prompt_settings(self, extra_create_args: Mapping[str, Any]) -> Optional[PromptExecutionSettings]:","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/semantic_kernel/_sk_chat_completion_adapter.py#L401-L437","documentation":"Thrown by SKChatCompletionAdapter while converting a Semantic Kernel result into autogen FunctionCall objects: a FunctionCallContent item arrived from the underlying SK model without an id. autogen's FunctionCall requires an id to later match tool executions to calls, so an id-less function call content is rejected.","triggerScenarios":"The Semantic Kernel connector returns FunctionCallContent with item.id=None (some connectors/local models omit call IDs), and the adapter iterates result.items in _extract_function_calls. Any single item missing an id aborts the whole conversion.","commonSituations":"Using local/open models via SK connectors that don't populate function call IDs; older semantic-kernel connector versions with incomplete tool-call metadata; custom SK filters/middleware stripping metadata.","solutions":["Upgrade the semantic-kernel connector to a version that returns tool call ids","Use a model/endpoint that emits call IDs (OpenAI, Azure OpenAI tool calling)","If IDs are genuinely absent from the provider, disable function calling for that model so no FunctionCallContent is produced"],"exampleFix":"# before: local connector omits ids\nadapter = SKChatCompletionAdapter(kernel=kernel, model_id=\"local-model\")\nresult = await adapter.create([msg], tools=[tool])  # ValueError when tool is called\n\n# after: use a connector/model that provides call ids\nadapter = SKChatCompletionAdapter(kernel=kernel, model_id=\"gpt-4o\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = await adapter.create(messages, tools=tools)\nexcept ValueError as e:\n    if \"Function call ID is required\" in str(e):\n        raise RuntimeError(\n            \"SK connector returned tool calls without ids; upgrade the connector or use a model that emits ids\"\n        ) from e\n    raise","preventionTips":["Run a tool-call round-trip smoke test against each SK connector/model pair before adopting it","Keep semantic-kernel and its connectors updated; id-less FunctionCallContent indicates old/broken connectors","Disable tools for local models known not to emit call ids"],"tags":["semantic-kernel","function-calling","adapter","tool-call-id"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}