{"record":{"id":"65be31f5f7b5afdd","repo":"microsoft/autogen","slug":"unsupported-config-type-type-self-config","errorCode":null,"errorMessage":"Unsupported config type: {type(self._config)}","messagePattern":"Unsupported config type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py","lineNumber":264,"sourceCode":"                if isinstance(self._config, PersistentChromaDBVectorMemoryConfig):\n                    self._client = PersistentClient(\n                        path=self._config.persistence_path,\n                        settings=settings,\n                        tenant=self._config.tenant,\n                        database=self._config.database,\n                    )\n                elif isinstance(self._config, HttpChromaDBVectorMemoryConfig):\n                    self._client = HttpClient(\n                        host=self._config.host,\n                        port=self._config.port,\n                        ssl=self._config.ssl,\n                        headers=self._config.headers,\n                        settings=settings,\n                        tenant=self._config.tenant,\n                        database=self._config.database,\n                    )\n                else:\n                    raise ValueError(f\"Unsupported config type: {type(self._config)}\")\n            except Exception as e:\n                logger.error(f\"Failed to initialize ChromaDB client: {e}\")\n                raise\n\n        if self._collection is None:\n            try:\n                # Create embedding function\n                embedding_function = self._create_embedding_function()\n\n                # Create or get collection with embedding function\n                self._collection = self._client.get_or_create_collection(\n                    name=self._config.collection_name,\n                    metadata={\"distance_metric\": self._config.distance_metric},\n                    embedding_function=embedding_function,\n                )\n            except Exception as e:\n                logger.error(f\"Failed to get/create collection: {e}\")\n                raise","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py#L246-L282","documentation":"During lazy initialization, ChromaDBVectorMemory selects a chromadb client by isinstance-dispatch on its config: PersistentChromaDBVectorMemoryConfig gets a PersistentClient, HttpChromaDBVectorMemoryConfig gets an HttpClient, and anything else raises ValueError with the offending type. The wrapper also logs 'Failed to initialize ChromaDB client' and re-raises the original exception for genuine client-creation failures.","triggerScenarios":"Constructing ChromaDBVectorMemory with a config class other than the two supported ones (e.g. an in-memory config class from another module or a plain dict) and triggering the first query/update. Non-ValueError chromadb errors (bad path, unreachable host, bad tenant/database) surface from the same try block with the same log line.","commonSituations":"Version mismatch where the config classes were imported from a different autogen-ext version than the memory class; attempting an EphemeralClient-style config that this implementation does not support; HTTP configs pointing at a dead chroma server.","solutions":["Use PersistentChromaDBVectorMemoryConfig or HttpChromaDBVectorMemoryConfig from the same autogen_ext.memory.chromadb module.","For a server setup, verify host/port/tenant/database are correct and the chroma server is reachable.","For persistent setup, verify persistence_path is writable.","Align autogen-ext versions across imports so isinstance dispatch matches."],"exampleFix":"# before\nmemory = ChromaDBVectorMemory(config=some_custom_config)\n# after\nfrom autogen_ext.memory.chromadb import PersistentChromaDBVectorMemoryConfig\nmemory = ChromaDBVectorMemory(config=PersistentChromaDBVectorMemoryConfig(collection_name=\"docs\", persistence_path=\"./chroma\"))","handlingStrategy":"type-guard","validationCode":"from autogen_ext.memory.chromadb import (\n    PersistentChromaDBVectorMemoryConfig,\n    HttpChromaDBVectorMemoryConfig,\n)\nassert isinstance(config, (PersistentChromaDBVectorMemoryConfig, HttpChromaDBVectorMemoryConfig)), (\n    f\"unsupported config: {type(config).__name__}\"\n)","typeGuard":"def is_supported_chromadb_config(cfg) -> bool:\n    return isinstance(cfg, (PersistentChromaDBVectorMemoryConfig, HttpChromaDBVectorMemoryConfig))","tryCatchPattern":"try:\n    memory = ChromaDBVectorMemory(config=config)\n    await memory.update_context(ctx)  # triggers _ensure_initialized\nexcept ValueError as e:\n    if \"Unsupported config type\" in str(e):\n        raise SystemExit(\"Use Persistent or Http ChromaDBVectorMemoryConfig\") from e\n    raise\nexcept Exception:\n    # genuine client init failure (network/path/tenant) is logged and re-raised as-is\n    raise","preventionTips":["Import config classes and ChromaDBVectorMemory from the same package version.","For Http configs, health-check host/port before first use.","For Persistent configs, verify persistence_path is writable."],"tags":["autogen","chromadb","configuration","type-validation"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}