Async function build_graph is not awaited when called recursively for the sub agents. This breaks the graph rendering in the web UI.
for sub_agent in agent.sub_agents:
await build_graph(graph, sub_agent, highlight_pairs) # add missing await
draw_edge(agent.name, sub_agent.name)