Skip to content

Liveavatar Automatically disconnects #4204

@MSameerAbbas

Description

@MSameerAbbas

Bug Description

Liveavatar automatically disconnects approximately 2-3 minutes after the initial connection. I've tested it by being idle, and by sending pings every 30 seconds (The entire time the mic was muted to ensure none of the websocket events like agent.speak were being sent). This was the traceback:

Traceback (most recent call last):
  File "C:\Users\msameer.abbas\Documents\LangTest\LiveKit\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in    
async_fn_logs
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\msameer.abbas\Documents\LangTest\LiveKit\.venv\Lib\site-packages\livekit\plugins\liveavatar\avatar.py", line  
237, in _recv_task
    raise APIConnectionError(message="LiveAvatar connection closed unexpectedly.")
livekit.agents._exceptions.APIConnectionError: LiveAvatar connection closed unexpectedly. (body=None, retryable=True)

I wasn't able to figure out whether it was an issue with the plugin or whether it was a liveavatar issue so I also opened a discussion on the forum

Expected Behavior

The websocket connection shouldn't randomly disconnect

Reproduction Steps

I'm using a super simple agent. In the on_enter method I connect to liveavatar's avatar. In on_exit I do the stop_session cleanup. I run the avatar for like 2-3 mins with the mic muted and the error shows up automatically.

Operating System

Windows 11

Models Used

Irrelevant

Package Versions

"livekit-agents[azure,deepgram,openai,silero,turn-detector]~=1.2",
"livekit-plugins-liveavatar>=1.3.6",
"livekit-plugins-noise-cancellation~=0.2"

Session/Room/Call IDs

No response

Proposed Solution

Additional Context

No response

Screenshots and Recordings

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions