{"record":{"id":"dd2bfa2416d2d428","repo":"microsoft/autogen","slug":"multiple-system-messages-are-not-supported","errorCode":null,"errorMessage":"Multiple system messages are not supported","messagePattern":"Multiple system messages are not supported","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":595,"sourceCode":"\n            if json_output is True:\n                create_args[\"response_format\"] = {\"type\": \"json_object\"}\n            elif isinstance(json_output, type):\n                raise ValueError(\"Structured output is currently not supported for Anthropic models\")\n\n        # Process system message separately\n        system_message = None\n        anthropic_messages: List[MessageParam] = []\n\n        # Merge continuous system messages into a single message\n        messages = self._merge_system_messages(messages)\n        messages = self._rstrip_last_assistant_message(messages)\n\n        for message in messages:\n            if isinstance(message, SystemMessage):\n                if system_message is not None:\n                    # if that case, system message is must only one\n                    raise ValueError(\"Multiple system messages are not supported\")\n                system_message = to_anthropic_type(message)\n            else:\n                anthropic_message = to_anthropic_type(message)\n                if isinstance(anthropic_message, list):\n                    anthropic_messages.extend(anthropic_message)\n                elif isinstance(anthropic_message, str):\n                    msg = MessageParam(\n                        role=\"user\" if isinstance(message, UserMessage) else \"assistant\", content=anthropic_message\n                    )\n                    anthropic_messages.append(msg)\n                else:\n                    anthropic_messages.append(anthropic_message)\n\n        # Check for function calling support\n        if self.model_info[\"function_calling\"] is False and len(tools) > 0:\n            raise ValueError(\"Model does not support function calling\")\n\n        # Set up the request","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L577-L613","documentation":"Error \"Multiple system messages are not supported\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:595 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Consolidate into a single system message"],"exampleFix":"Merge all system messages into one","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}