Agent observability partial setting not working

Description

The record configuration passed to session.start() is not respecting partial observability settings. When enabling/disabling individual observability options (audio, traces, logs, transcript), the behaviour does not match the configured values. Currently i have just enabled audio as i have ran out of inclusive credits of others.

Current implementation

await session.start(
    agent=starting_agent,
    room=ctx.room,
    room_options=room_io.RoomOptions(
        audio_input=room_io.AudioInputOptions(
            noise_cancellation=(
                lambda params: (
                    (
                        None
                        if params.participant.kind
                        == rtc.ParticipantKind.PARTICIPANT_KIND_AGENT
                        else ctx.proc.userdata[ProcessKey.ENHANCER]
                    )
                    if settings.LIVEKIT_NOISE_CANCELLATION_ENABLED
                    else None
                )
            ),
        ),
        close_on_disconnect=False,
        delete_room_on_close=True,
    ),
    capture_run=True,
    record={
        "audio": settings.LIVEKIT_OBSERVABILITY_AUDIO,  // its true
        "traces": settings.LIVEKIT_OBSERVABILITY_TRACES,
        "logs": settings.LIVEKIT_OBSERVABILITY_LOGS,
        "transcript": settings.LIVEKIT_OBSERVABILITY_TRANSCRIPT,
    },
)

Expected behaviour

The observability configuration should support partial enabling:

Example:

{
    "audio": True,
    "traces": False,
    "logs": False,
    "transcript": False
}

Expected:

  • Audio recording should be enabled
  • Logs should not be captured
  • Traces should not be captured
  • Transcript should not be captured

Actual behaviour

Changing individual flags does not correctly affect captured observability data. The agent session appears to either:

  • Ignore enabled fields in the record configuration.

Environment

  • LiveKit Agents SDK with version

“livekit-agents>=1.6.4”,
“livekit-api>=1.1.1”,

  • session.start() with capture_run=True
  • Custom record observability configuration

Impact

Cannot selectively control observability collection. This prevents disabling specific data types (for example transcript/audio) while keeping required debugging data such as traces and logs.

Expected fix

record options should be applied independently and respect each boolean configuration value.

EDIT: Agent obeservability setting is enabled in livekit dashboard. Agent is deployed in livekit cloud

So when you do that, are you still seeing all the items in Agent Insights?

And… can you try hard coding the true/false. I am pretty sure this works. Do somethig like this to verify it is no an env variable issue.

 await session.start(
        agent=MyAgent(),
        room=ctx.room,
        # ENABLE AUDIO RECORDING
        record={"audio": True, "logs": False, "traces": False, "transcript": False},
        room_options=room_io.RoomOptions(
            audio_input=room_io.AudioInputOptions(
                # uncomment to enable the Krisp BVC noise cancellation
                # noise_cancellation=noise_cancellation.BVC(),
            ),
        ),
    )

So i can see nothing in Agent Insights, it says
No observability data available
No data is available, agent recording is either disabled or data has not yet been uploaded.

this was session data on session end

"room_id": "RM_GeVZUax7y2N8",
"timestamp": 1782499202.8076413"
"sdk_version": "1.6.4",
"audio_recording_path": "/tmp/tmp1087amaf/audio.ogg",
"audio_recording_started_at": 1782498610.4057655

i am storing whole session report.

Sure, i will hardcode it and check if that works

So after hardcoded without env, i am still facing same isssue

Room id = RM_YMDFvsK9TmQc, RM_NsDTEhhDmuJN created after that has still no observability audio in it.

Current month billing has still observability audio minues left which i can’t use as i cannot fully enabled because other observability section would get charged and not able to partially use aduio only which is still not reached in inclusive threshold.

Code Ref was from this link: Agent insights in LiveKit Cloud | LiveKit Documentation

 await session.start(
            agent=starting_agent,
            room=ctx.room,
            room_options=room_io.RoomOptions(
                audio_input=room_io.AudioInputOptions(
                    noise_cancellation=(
                        lambda params: (
                            (
                                None
                                if params.participant.kind
                                == rtc.ParticipantKind.PARTICIPANT_KIND_AGENT
                                else ctx.proc.userdata[ProcessKey.ENHANCER]
                            )
                            if settings.LIVEKIT_NOISE_CANCELLATION_ENABLED
                            else None
                        )
                    ),
                ),
                close_on_disconnect=False,
                delete_room_on_close=True,
            ),
            capture_run=True,
            record=(
                {
                    "audio": True,
                    "traces": settings.LIVEKIT_OBSERVABILITY_TRACES,
                    "logs": settings.LIVEKIT_OBSERVABILITY_LOGS,
                    "transcript": settings.LIVEKIT_OBSERVABILITY_TRANSCRIPT,
                }
            ),
        )

I still see the variables there instead of hard code.

What matters to me is audio, so even if other are var, i need atleast audio to be working which is not (even when harcoded). i am pretty sure all env are working as i am using them at multiple places

Raised as github issue: Agent observability partial setting not working · Issue #6264 · livekit/agents · GitHub

As its very annoying that agent recording cost is high and i cannot even use the inclusive credits left for this month