diff --git a/src/agents/realtime/session.py b/src/agents/realtime/session.py index 8b3b10936..e93b1943f 100644 --- a/src/agents/realtime/session.py +++ b/src/agents/realtime/session.py @@ -594,8 +594,8 @@ async def _check_handoff_enabled(handoff_obj: Handoff[Any, RealtimeAgent[Any]]) return attr res = attr(context_wrapper, agent) if inspect.isawaitable(res): - return await res - return res + res = await res + return bool(res) results = await asyncio.gather(*(_check_handoff_enabled(h) for h in handoffs)) enabled = [h for h, ok in zip(handoffs, results) if ok]