microsoft / microsoft/agent-framework

Python: [Bug]: DevUI graph ignores HandoffBuilder .add_handoff() routing rules — shows all-to-all arrows

Open
#4,364 2 comments 0 reactions 1 assignee View on GitHub

@victordibia is already working on this.

Since Mar 2, 2026.

devui python
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Bug: DevUI graph visualization ignores .add_handoff() routing rules

When using HandoffBuilder with explicit .add_handoff() routing rules, the DevUI graph visualization shows arrows between all participants (fully connected) instead of only the configured handoff routes.

Image
Repro
from agent_framework.orchestrations import HandoffBuilder

workflow = (
    HandoffBuilder(
        name="customer_support_handoff",
        participants=[triage_agent, order_agent, return_agent, refund_agent],
        termination_condition=lambda conversation: (
            len(conversation) > 0 and "goodbye" in conversation[-1].text.lower()
        ),
    )
    .with_start_agent(triage_agent)
    # Triage cannot route directly to refund_agent
    .add_handoff(triage_agent, [order_agent, return_agent])
    # Only return_agent can escalate to refund_agent
    .add_handoff(return_agent, [refund_agent, triage_agent])
    # All specialists can hand back to triage
    .add_handoff(order_agent, [triage_agent])
    .add_handoff(refund_agent, [triage_agent])
    .with_autonomous_mode()
    .build()
)

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

The graph should show only the 6 configured edges:

  • triage_agentorder_agent
  • triage_agentreturn_agent
  • return_agentrefund_agent
  • return_agenttriage_agent
  • order_agenttriage_agent
  • refund_agenttriage_agent

Notably, there should be no arrow from triage_agentrefund_agent (the whole point of the routing rules).

Actual

DevUI draws arrows between all 4 agents in both directions (fully connected graph), ignoring the .add_handoff() constraints entirely.

Environment
  • Python Agent Framework 1.0.0rc1
  • OpenAIChatClient with GitHub Models
  • macOS / Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.