microsoft/autogen · error · ValueError

Description not initialized

Error message

Description not initialized

What it means

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.

Source

Thrown at python/packages/autogen-ext/src/autogen_ext/agents/azure/_azure_ai_agent.py:377

        """The types of messages that the assistant agent produces."""
        return (TextMessage,)

    @property
    def thread_id(self) -> str:
        if self._thread is None:
            raise ValueError("Thread not initialized")
        return self._thread.id

    @property
    def _get_agent_id(self) -> str:
        if self._agent is None:
            raise ValueError("Agent not initialized")
        return self._agent.id

    @property
    def description(self) -> str:
        if not self._description:
            raise ValueError("Description not initialized")
        return self._description

    @property
    def agent_id(self) -> str:
        if not self._agent_id:
            raise ValueError("Agent not initialized")
        return self._agent_id

    @property
    def deployment_name(self) -> str:
        if not self._deployment_name:
            raise ValueError("Deployment name not initialized")
        return self._deployment_name

    @property
    def instructions(self) -> str:
        if not self._instructions:
            raise ValueError("Instructions not initialized")

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Pass a non-empty description when constructing the agent.
  2. Read it defensively: getattr-style access or try/except ValueError with a default.
  3. Update code to not require description if it's optional in your flow — persist your own metadata instead.

Example fix

# before
agent = AzureAIAgent(client, name="a", instructions="...")
print(agent.description)  # ValueError
# after
agent = AzureAIAgent(client, name="a", description="helper agent", instructions="...")
print(agent.description)
Defensive patterns

Strategy: validation

Validate before calling

kwargs = {"name": "a"}
if description:
    kwargs["description"] = description
agent = AzureAIAgent(client, **kwargs)
# only read .description if you set it
ok = bool(description)

Try / catch

try:
    desc = agent.description
except ValueError:
    desc = ""

Prevention

When it happens

Trigger: Constructing AzureAIAgent without a description (or with description=""), then reading agent.description.

Common situations: Agents created with only name/model args; code that iterates agents and prints .description for logging.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/20b1b69704aeb7e5. Report an issue: GitHub.