Outline all scenarios where a tool call returns a ...
# ask-ai
c
Outline all scenarios where a tool call returns a new Agent, but that Agent doesn't become active
t
Thanks for reaching out, Matthew. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking for all scenarios where a tool call returns a new Agent but that Agent does not become active. I’m responding about the Agents handoff behavior. Short answer: • There are no documented or intended scenarios where a function tool returns a new Agent and that returned Agent fails to become active. Returning an Agent triggers an automatic handoff: the returned Agent becomes active and its on_enter() runs. Why: • The framework’s design performs the handoff when a
function_tool
returns an
Agent
, making the returned Agent the active agent and invoking its entry logic. This handoff is the expected, reliable behavior. When a returned Agent might not become active: • The docs do not list any valid or supported cases where this happens. If a returned Agent does not become active in your system, it indicates an unexpected failure (for example, an undocumented runtime error, session failure, or resource issue), not normal behavior. If you’re encountering this in practice, I can help troubleshoot. Can you share: • a minimal reproducible example (code of the tool and returned Agent), • any error logs or messages, • and the session/room context where it happens? Sources: TTS Comparison | LiveKit docs | Agents and handoffs | LiveKit docs