Sometimes Transcripts and audio recording not available for the session (Audio waveforms not available)

https://cloud.livekit.io/projects/p_frphml972oz/sessions/RM_WFxyc3zb8aX3/observability?mode=transcript

At times, the session is returning no data. We need the session to consistently return data in all cases. Please help identify what might be going wrong, as this is making it very difficult for us to debug and understand the root cause.

I don’t see any issues on our side for the data upload for your project.

Observability data is uploaded from your agent at the conclusion of the session, do you see any clues in your agent logs during shutdown? Successful uploads should show something like this in your agent logs:

09:03:59.759 DEBUG… livekit.agents uploading session report to LiveKit Cloud {“room”: “playground-bB1d-8Edm”, “pid”: 2700, “job_id”: “AJ_jGv2C45gNC5P”, “room_id”: “RM_Wn6Ze9R7uELF”}

Presumably, because you say “At times, the session is returning no data.“ this is not consistent.

No, I’m referring to the issue where we couldn’t find any recording or transcript for that session — not even in LiveKit Cloud. This seems to be happening frequently. Additionally, our report upload logic did not execute for that session.

We are talking about the same thing :slight_smile: By “Observability data” I meant the Agent insights data, Observability overview | LiveKit Documentation.

Additionally, our report upload logic did not execute for that session.

That does lead me to suspect that something is going wrong during agent shutdown (when the data is uploaded from your agent to LiveKit cloud). That was my reason for asking whether you saw anything suspicious in your agent logs, for example some issue that prevented a normal shutdown.

The other consideration is are you using the latest version of LiveKit Agents? Since the introduction of the feature in 1.3 the team have added incremental improvements to the reliability of data upload

My project has livekit agents version 1.3.9.

I didn’t find any suspicious logs. However, I noticed that the functions responsible for saving the recording and transcript from LiveKit were not triggered.

In this specific session, the user mentioned that the agent suddenly went silent and stopped interacting. Due to insufficient logs, we weren’t able to determine what actually happened during the session.

I hope this provides more clarity on the issue.

I’ve also noticed that in some cases, even after the session is shut down and the room is deleted, the LiveKit Cloud console still shows the agent as active for a while before it eventually closes.

Is this expected behavior, or could there be an issue in my implementation? Or this could be related to the observability issue ?

I’ve uploaded the entrypoint code as well — could you please review it?

main.py (15.1 KB)

1.3.9 was back in mid-December, so I do recommend upgrading to a more recent version unless you have a reason not to.

I didn’t find any suspicious logs. However, I noticed that the functions responsible for saving the recording and transcript from LiveKit were not triggered.

Looking at your main.py file you shared, you are sending voice recordings and voice transcripts to an external S3 bucket in the shutdown callback. The docs say to do this on_session_end, Data hooks | LiveKit Documentation, so I suggest making that change. Also, it is not recommended to upload the audio recordings in this way, and I wouldn’t be surprised if there were timeout issues when shutting down the session (I see there’s a hard timeout of 60s in your code for this) - you should instead use Egress for this: Data hooks | LiveKit Documentation

I do strongly recommend using our MCP server: LiveKit Docs MCP Server | LiveKit Documentation, along with an Agents.md file similar to agent-starter-python/AGENTS.md at main · livekit-examples/agent-starter-python · GitHub. The absense of this is the only way I can imagine you ended up with this untrue comment: “# NOTE: preemptive_generation has known bug causing duplicate LLM requests“

In this specific session, the user mentioned that the agent suddenly went silent and stopped interacting. Due to insufficient logs, we weren’t able to determine what actually happened during the session.

I strongly recommend using external logging rather than relying on Agent Observability for your logs for this exact reason. Please see this guide for more information: Where to find your Agent Logs | LiveKit

I passed your main.py into Claude with our MCP and asked it to review, it gave a few other important suggestions that I missed, but I also recommend you do that yourself (it doesn’t have to be Claude, any AI would do)

  • You could have used the user_away_timeout rather than a custom away handler based on user state
  • You specify turn detection as vad rather than use the Flux built-in
  • It’s saying that “Session report uses old callback pattern”, which explains why your AI missed on_session_end, if it was basing its implementation on old info.