Skip to content

Commit 1bf195d

Browse files
Fix 13_hierarchical_agents: restore the demo, stop blocking on serve()
The runtime.run(...) demo was commented out and runtime.serve(ceo) left uncommented, so the example printed a header and then blocked forever in the worker loop — it never demonstrated the hierarchy. Every sibling example keeps serve() commented under "Production pattern". Uncommented the run, commented serve(), and reflowed the prompt off a single 200-character line. Verified: COMPLETED in 25 tasks, both branches delegated — ceo -> engineering_lead, ceo -> marketing_lead.
1 parent 733fec7 commit 1bf195d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

examples/agents/13_hierarchical_agents.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@
110110
if __name__ == "__main__":
111111
with AgentRuntime() as runtime:
112112
print("--- Technical question (CEO -> Engineering -> Backend) ---")
113-
# result = runtime.run(ceo, "Design a REST API for a user management system with authentication "
114-
# "and then ask marketing team to come up with a marketing campaign for the system with details on how to run these campaign")
115-
# result.print_result()
113+
result = runtime.run(
114+
ceo,
115+
"Design a REST API for a user management system with authentication, "
116+
"then ask the marketing team for a campaign to promote it.",
117+
)
118+
result.print_result()
116119

117120
# Production pattern:
118121
# 1. Deploy once during CI/CD:
@@ -121,4 +124,4 @@
121124
# runtime.deploy(ceo)
122125
#
123126
# 2. In a separate long-lived worker process:
124-
runtime.serve(ceo)
127+
# runtime.serve(ceo)

0 commit comments

Comments
 (0)