Bug Description
With a realtime model (tested with GPTLiveModel, same code path as RealtimeModel), the spans from livekit-agents 1.8.x are missing most of the conversation content. A GenAI backend shows every turn as an empty generation with no cost.
The cascaded pipeline path is fine. llm_request gets gen_ai.input.messages, gen_ai.output.messages and usage, and agent_turn gets lk.pii.instructions and lk.pii.user_input. The realtime path never calls the content helpers.
What's missing
| Span |
Has today |
Missing |
realtime_inference (generate_content) |
provider, model, gen_ai.output.type, conversation id |
gen_ai.input.messages, gen_ai.output.messages, gen_ai.system_instructions, usage |
agent_turn (invoke_agent) |
lk.pii.response.text, lk.pii.response.function_calls |
lk.pii.user_input, lk.pii.instructions |
The user's transcript is on no span at all. Only user_speaking debug spans, without text.
Usage: GPT-Live's backend model (gpt-5.6-luna, ~1.4k prompt / 74 completion tokens per turn) is emitted as LLMMetrics on metrics_collected but never attached to a span. The voice model's RealtimeModelMetrics reports zero tokens (billed by duration), so realtime_inference has no usage even when record_realtime_metrics matches.
Expected Behavior
Parity with the pipeline path: realtime_inference carries input/output messages, system instructions and usage; agent_turn carries lk.pii.user_input and lk.pii.instructions.
Happy to send a PR. Rough shape: reuse to_input_messages / to_output_messages from telemetry/gen_ai.py on the realtime chat context, and attach the backend LLMMetrics to the pending realtime_inference span by response.id.
Reproduction Steps
1. `AgentSession(llm=GPTLiveModel(...))` with one function tool, `set_tracer_provider(provider)` with any OTLP exporter. `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` unset (defaults on), no redaction.
2. Short conversation with one tool call.
3. Look at the spans.
Real example, the Langfuse voice demo (https://langfuse.com/docs/demo) runs exactly this setup. Public trace: https://cloud.langfuse.com/project/clkpwwm0m000gmm094odg11gi/traces/738d3c599f6071781340ebe0ead4054c?observation=ca5d2ea847dfef01
`realtime_inference` there carries only `gen_ai.operation.name=generate_content`, `gen_ai.provider.name=openai`, `gen_ai.request.model=gpt-live-1`, `gen_ai.request.stream=true`, `gen_ai.output.type=speech`, `gen_ai.conversation.id`. `agent_turn` has `lk.pii.response.text` and nothing about the user.
Operating System
MacOS
Models Used
No response
Package Versions
livekit-agents 1.8.1, livekit-plugins-openai 1.8.1, exporter is the Langfuse Python SDK. Same on `main` today.
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings

Bug Description
With a realtime model (tested with
GPTLiveModel, same code path asRealtimeModel), the spans from livekit-agents 1.8.x are missing most of the conversation content. A GenAI backend shows every turn as an empty generation with no cost.The cascaded pipeline path is fine.
llm_requestgetsgen_ai.input.messages,gen_ai.output.messagesand usage, andagent_turngetslk.pii.instructionsandlk.pii.user_input. The realtime path never calls the content helpers.What's missing
realtime_inference(generate_content)gen_ai.output.type, conversation idgen_ai.input.messages,gen_ai.output.messages,gen_ai.system_instructions, usageagent_turn(invoke_agent)lk.pii.response.text,lk.pii.response.function_callslk.pii.user_input,lk.pii.instructionsThe user's transcript is on no span at all. Only
user_speakingdebug spans, without text.Usage: GPT-Live's backend model (
gpt-5.6-luna, ~1.4k prompt / 74 completion tokens per turn) is emitted asLLMMetricsonmetrics_collectedbut never attached to a span. The voice model'sRealtimeModelMetricsreports zero tokens (billed by duration), sorealtime_inferencehas no usage even whenrecord_realtime_metricsmatches.Expected Behavior
Parity with the pipeline path:
realtime_inferencecarries input/output messages, system instructions and usage;agent_turncarrieslk.pii.user_inputandlk.pii.instructions.Happy to send a PR. Rough shape: reuse
to_input_messages/to_output_messagesfromtelemetry/gen_ai.pyon the realtime chat context, and attach the backendLLMMetricsto the pendingrealtime_inferencespan byresponse.id.Reproduction Steps
Operating System
MacOS
Models Used
No response
Package Versions
livekit-agents 1.8.1, livekit-plugins-openai 1.8.1, exporter is the Langfuse Python SDK. Same on `main` today.Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings