Fix handoff workflow context management and improve AG-UI demo (#5136)

This commit is contained in:
Evan Mattson
2026-04-08 13:08:24 +09:00
committed by GitHub
Unverified
parent f94a75daa5
commit e10d448ae2
19 changed files with 601 additions and 252 deletions
@@ -194,6 +194,7 @@ def _create_af_agents(client: OpenAIChatCompletionClient):
"- handoff_to_order_status_agent for shipping/timeline questions\n"
"- handoff_to_order_return_agent for returns"
),
require_per_service_call_history_persistence=True,
)
refund = Agent(
client=client,
@@ -201,6 +202,7 @@ def _create_af_agents(client: OpenAIChatCompletionClient):
instructions=(
"Handle refunds. Ask for order id and reason. If shipping info is needed, hand off to order_status_agent."
),
require_per_service_call_history_persistence=True,
)
status = Agent(
client=client,
@@ -208,6 +210,7 @@ def _create_af_agents(client: OpenAIChatCompletionClient):
instructions=(
"Provide order status, tracking, and timelines. If billing questions appear, hand off to refund_agent."
),
require_per_service_call_history_persistence=True,
)
returns = Agent(
client=client,
@@ -215,6 +218,7 @@ def _create_af_agents(client: OpenAIChatCompletionClient):
instructions=(
"Coordinate returns, confirm addresses, and summarize next steps. Hand off to triage_agent if unsure."
),
require_per_service_call_history_persistence=True,
)
return triage, refund, status, returns