Skip to content

Python: DevUI returns error with AgentOrchestration patterns #1548

Closed

Description

@jomalsan

When using the DevUI with a ConcurrentBuilder() workflow I get an error serializing ChatMessage. When this happens the UI goes blank.

[2025-10-17 10:26:04 - /mitted/agent-framework-learning/.venv/lib/python3.13/site-packages/agent_framework_devui/_server.py:544 - ERROR] Error in streaming execution: Unable to serialize unknown type: <class 'agent_framework._types.ChatMessage'>

Versions:

agent-framework 1.0.0b251016
agent-framework-a2a 1.0.0b251016
agent-framework-azure-ai 1.0.0b251016
agent-framework-copilotstudio 1.0.0b251016
agent-framework-core 1.0.0b251016
agent-framework-devui 1.0.0b251016
agent-framework-mem0 1.0.0b251016
agent-framework-purview 1.0.0b251016
agent-framework-redis 1.0.0b251016

Image

And here is an example I based on the Agent Workflow - Content Review with Quality Routing sample: https://github.com/microsoft/agent-framework/blob/main/python/samples/getting_started/devui/workflow_agents/workflow.py

# Copyright (c) Microsoft. All rights reserved.

"""Agent Workflow - Content Review with Quality Routing.

This sample demonstrates:
- Using agents directly as executors
- Conditional routing based on structured outputs
- Quality-based workflow paths with convergence

Use case: Content creation with automated review.
Writer creates content, Reviewer evaluates quality:
  - High quality (score >= 80): → Publisher → Summarizer
  - Low quality (score < 80): → Editor → Publisher → Summarizer
Both paths converge at Summarizer for final report.
"""

from agent_framework import ConcurrentBuilder
from agent_framework.azure import AzureOpenAIChatClient
from azure.identity import DefaultAzureCredential
from dotenv import load_dotenv

load_dotenv("../.env")

# Create Azure OpenAI chat client
CREDENTIAL = DefaultAzureCredential()
chat_client = AzureOpenAIChatClient(credential=CREDENTIAL)

# Create Writer agent - generates content
writer = chat_client.create_agent(
    name="Writer",
    instructions=(
        "You are an excellent content writer. "
        "Create clear, engaging content based on the user's request. "
        "Focus on clarity, accuracy, and proper structure."
    ),
)

tagline_writer = chat_client.create_agent(
    name="Tagline Writer",
    instructions=(
        "You are a creative tagline writer. "
        "Generate catchy and memorable taglines that encapsulate the essence of the content provided."
    ),
)


workflow = (
    ConcurrentBuilder().participants([writer, tagline_writer]).build()
)


def main():
    """Launch the branching workflow in DevUI."""
    import logging

    from agent_framework.devui import serve

    logging.basicConfig(level=logging.INFO, format="%(message)s")
    logger = logging.getLogger(__name__)

    logger.info("Starting Agent Workflow (Content Review with Quality Routing)")
    logger.info("Available at: http://localhost:8093")
    logger.info("\nThis workflow demonstrates:")
    logger.info("- Conditional routing based on structured outputs")
    logger.info("- Path 1 (score >= 80): Reviewer → Publisher → Summarizer")
    logger.info("- Path 2 (score < 80): Reviewer → Editor → Publisher → Summarizer")
    logger.info("- Both paths converge at Summarizer for final report")

    serve(entities=[workflow], port=8093, auto_open=True)


if __name__ == "__main__":
    main()

Activity

  1. changed the title [-]Python: DevUI returns error with AgentOrchestration[/-] [+]Python: DevUI returns error with AgentOrchestration patterns[/+] on Oct 17, 2025
  2. moonbox3 commented on Oct 20, 2025

    @moonbox3
    Contributor

    We've got a PR coming out with a fix for this soon. Victor Dibia (@victordibia)

  3. added
    workflowsUsage: [Issues, PRs], Target: Workflows
    and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: PythonworkflowsUsage: [Issues, PRs], Target: Workflows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions