Skip to content

Agent stops speaking when in tool call. #4461

@aumeshm

Description

@aumeshm

Bug Description

I'm on 1.3.6 for livekit agents sdk. My agent has stopped when it the LLM request has both context and a tool call. In livekit observability, I do not see the last LLM request, TTS, and tool call; however, I do see it in langfuse. The agent is stuck and does not say anything; however the last event if agent change from listening to speaking.

I know there were a few speech handle issues, but I am unable to consistently repro this. Here are a few more details:

To outline the flow of what happens in call:
User speaks <--- shows up in both livekit and langfuse
Agent says "sorry...." <--- This is never said, but shows up in langfuse only. Only log I see in livekit is that the agent is "speaking"
Agent triggers tool to transfer to live team <--- This does not show up in langfuse or livekit; however I can see an api call within the tool being logged in langfuse

The LLM output has content and the tool call. The content is the "Sorry..." message

My tool call psuedocode is:

@function_tool
async def dummy_tool():
context.disallow_interruptions()
get_phone_number() <---- I can see this being logged
await self.session.say('...', allow_interruptsion=False) <--- I do not hear the "Sorry..." message prior to the tool call or this message.

Expected Behavior

The expected behavior is that the agent is able to speak both the message before and during the tool call.

Reproduction Steps

Look at psuedocode

Operating System

macOs

Models Used

Flux, Gpt 4.1, Rime

Package Versions

1.3.6

Session/Room/Call IDs

No response

Proposed Solution

I have a feeling that it's an issue with speech handles/ interruptions. I recently downgraded from 1.3.10 to 1.3.6, because of speech handle issues within a tool call.

Additional Context

No response

Screenshots and Recordings

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions