{"record":{"id":"20b1b69704aeb7e5","repo":"microsoft/autogen","slug":"description-not-initialized","errorCode":null,"errorMessage":"Description not initialized","messagePattern":"Description not initialized","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py","lineNumber":377,"sourceCode":"        \"\"\"The types of messages that the assistant agent produces.\"\"\"\n        return (TextMessage,)\n\n    @property\n    def thread_id(self) -> str:\n        if self._thread is None:\n            raise ValueError(\"Thread not initialized\")\n        return self._thread.id\n\n    @property\n    def _get_agent_id(self) -> str:\n        if self._agent is None:\n            raise ValueError(\"Agent not initialized\")\n        return self._agent.id\n\n    @property\n    def description(self) -> str:\n        if not self._description:\n            raise ValueError(\"Description not initialized\")\n        return self._description\n\n    @property\n    def agent_id(self) -> str:\n        if not self._agent_id:\n            raise ValueError(\"Agent not initialized\")\n        return self._agent_id\n\n    @property\n    def deployment_name(self) -> str:\n        if not self._deployment_name:\n            raise ValueError(\"Deployment name not initialized\")\n        return self._deployment_name\n\n    @property\n    def instructions(self) -> str:\n        if not self._instructions:\n            raise ValueError(\"Instructions not initialized\")","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py#L359-L395","documentation":"AzureAIAgent.description raises ValueError when _description is falsy. The property has no setter fallback and is expected to be populated from the constructor's description argument; an empty string or omitted description triggers the error on read.","triggerScenarios":"Constructing AzureAIAgent without a description (or with description=\"\"), then reading agent.description.","commonSituations":"Agents created with only name/model args; code that iterates agents and prints .description for logging.","solutions":["Pass a non-empty description when constructing the agent.","Read it defensively: getattr-style access or try/except ValueError with a default.","Update code to not require description if it's optional in your flow — persist your own metadata instead."],"exampleFix":"# before\nagent = AzureAIAgent(client, name=\"a\", instructions=\"...\")\nprint(agent.description)  # ValueError\n# after\nagent = AzureAIAgent(client, name=\"a\", description=\"helper agent\", instructions=\"...\")\nprint(agent.description)","handlingStrategy":"validation","validationCode":"kwargs = {\"name\": \"a\"}\nif description:\n    kwargs[\"description\"] = description\nagent = AzureAIAgent(client, **kwargs)\n# only read .description if you set it\nok = bool(description)","typeGuard":null,"tryCatchPattern":"try:\n    desc = agent.description\nexcept ValueError:\n    desc = \"\"","preventionTips":["Always pass a non-empty description at construction.","Keep your own agent metadata instead of relying on .description.","Guard property reads on optional constructor args."],"tags":["azure","configuration","azure-ai-agent"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}