{"record":{"id":"3f62ce2b0f8f0f68","repo":"microsoft/autogen","slug":"invalid-component-class","errorCode":null,"errorMessage":"Invalid component class","messagePattern":"Invalid component class","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-core/src/autogen_core/_component_config.py","lineNumber":276,"sourceCode":"        module_name = module_path.rsplit(\".\", maxsplit=1)[-1]\n        is_test_module = module_name.startswith(\"test_\") or module_path.startswith(\"test_\")\n        if not is_test_module and not any(\n            module_path.startswith(ns) or module_path == ns.rstrip(\".\") for ns in trusted\n        ):\n            raise ValueError(\n                f\"Provider module '{module_path}' is not in a trusted namespace. \"\n                f\"Allowed namespaces by default: autogen_core, autogen_agentchat, autogen_ext, \"\n                f\"autogen_studio, autogenstudio. \"\n                f\"To allow additional namespaces, set the AUTOGEN_ALLOWED_PROVIDER_NAMESPACES \"\n                f\"environment variable to a comma-separated list \"\n                f\"(e.g. AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage).\"\n            )\n\n        module = importlib.import_module(module_path)\n        component_class = module.__getattribute__(class_name)\n\n        if not is_component_class(component_class):\n            raise TypeError(\"Invalid component class\")\n\n        # We need to check the schema is valid\n        if not hasattr(component_class, \"component_config_schema\"):\n            raise AttributeError(\"component_config_schema not defined\")\n\n        if not hasattr(component_class, \"component_type\"):\n            raise AttributeError(\"component_type not defined\")\n\n        loaded_config_version = loaded_model.component_version or component_class.component_version\n        if loaded_config_version < component_class.component_version:\n            try:\n                instance = component_class._from_config_past_version(loaded_model.config, loaded_config_version)  # type: ignore\n            except NotImplementedError as e:\n                raise NotImplementedError(\n                    f\"Tried to load component {component_class} which is on version {component_class.component_version} with a config on version {loaded_config_version} but _from_config_past_version is not implemented\"\n                ) from e\n        else:\n            schema = component_class.component_config_schema  # type: ignore","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-core/src/autogen_core/_component_config.py#L258-L294","documentation":"Error \"Invalid component class\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-core/src/autogen_core/_component_config.py:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the class inherits the expected component base and implements required methods"],"exampleFix":"Subclass the correct Component base and define component_type","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"}