Agent handoff fails when tool returning Agent runs in parallel with reply-producing tool (pipeline path)

When the LLM returns parallel tool calls in a single generation where:

  1. One tool returns an Agent (triggering a handoff), and

  2. Another tool returns a string result (reply_required=True)

I see they both return responses correctly but the handoff never completes. The old agent stays active, on_enter() is never called on the new agent, and the conversation gets stuck in a loop.

Created this issue Agent handoff fails when tool returning Agent runs in parallel with reply-producing tool (pipeline path) · Issue #5150 · livekit/agents · GitHub

Thanks for the detailed GitHub issue, as far as I can see the behaviour in the scenario you describe is undefined, so the best place to resolve this is in the GitHub issue. If you have them handy, providing logs in that GitHub issue might save a back and forth.