aloof-scooter-47164
12/07/2025, 4:52 PMtall-airline-16756
12/07/2025, 4:52 PMtall-airline-16756
12/07/2025, 4:53 PMCMD ["python", "agent.py", "start", "--log-level=DEBUG"]
1. View logs & traces in the dashboard
• Open your Project → Sessions → select a session → Agent insights.
• Use the Logs timeline to view chronological debug/info/warn/error logs across agent code, media server, and client events.
• Use the Trace view to inspect turn-by-turn model behavior (LLM timing, token usage, end-of-utterance events) to correlate model actions with logs.
1. CLI option (limited)
• You can stream the latest agent instance logs with:
lk agent logs
Note: CLI shows only the most recent agent instance.
1. Retention & persistence
• Observability data is retained for 30 days.
• For longer retention or external analysis, configure log forwarding (e.g., Datadog/Sentry) by adding the appropriate secrets like DATADOG_TOKEN.
If you want, tell me:
• which SDK (Python or Node) and version you’re running, and
• whether you need help enabling log forwarding to Datadog or downloading a session’s logs—I’ll give the exact steps. Sources: Agent insights in LiveKit Cloud | LiveKit docs | Log collection | LiveKit Docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal/signup|aloof-scooter-47164
12/07/2025, 4:54 PMtall-airline-16756
12/07/2025, 4:55 PMuv run agent.py dev --log-level=DEBUG
and configure Python logging with logging.basicConfig(level=logging.DEBUG).
• Node dev example:
pnpm run dev --log-level=debug
• If you need true internal generation traces (per-token internals, step-by-step generation), run an OpenAI-compatible local model (Ollama, LiteLLM, vLLM, etc.) and point the OpenAI plugin to that local endpoint. That gives full visibility into model inputs, outputs, and generation logs.
If you want, tell me:
• which SDK (Python or Node) and version you’re using, and
• whether you’d like step-by-step help switching to a local model (I can provide exact setup and config for Ollama or another shim). Sources: OpenAI LLM plugin guide | LiveKit Docs | Ollama LLM plugin guide | LiveKit Docs | Agent server options | LiveKit docsaloof-scooter-47164
12/07/2025, 5:02 PMLK_OPENAI_DEBUG=1 it no longer workstall-airline-16756
12/07/2025, 5:03 PMLK_OPENAI_DEBUG=1 was removed and no longer works. Quick summary and next steps tailored to local dev:
• LK_OPENAI_DEBUG is no longer supported.
• You cannot access internal debug logs from OpenAI’s hosted models themselves — those internals are not exposed.
• To get verbose local traces of the agent’s interactions with OpenAI, run your agent with debug log level:
◦ Python dev:
uv run agent.py dev --log-level=DEBUG
• Node dev:
pnpm run dev --log-level=debug
This will log full API requests/responses, timings, and helpful lifecycle events.
• If you need deeper, per-token/generation internals, switch to a local OpenAI-compatible model (Ollama, vLLM, LiteLLM) and point the OpenAI plugin at that local endpoint — that allows full generation logs you can inspect.
Tell me which SDK (Python or Node) and version you’re using and whether you want steps to:
• enable --log-level=DEBUG in your current setup, or
• configure Ollama (or another local shim) for full model internals — I’ll give exact commands and config. Sources: OpenAI and LiveKit | LiveKit docs | OpenAI Realtime API plugin guide | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API | Agent server options | LiveKit docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal/signup|aloof-scooter-47164
12/07/2025, 5:06 PM13:51:36.461 DEBUG livekit.agents pre-connect audio received
{"duration": 3.800000000000002, "track_id": "TR_AMoBW9oaRytDew", "participant":
"", "channels": 1, "sample_rate": 48000, "room": "", "agent":
"ato-lk-agent-dev", "pid": 33409, "job_id": "AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
13:51:36.466 DEBUG livekit.agents pre-connect audio buffer pushed
{"duration": 3.7999999999999985, "track_id": "TR_AMoBW9oaRytDew", "participant":
"", "room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409,
"job_id": "AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
DEBUG livekit.agents start reading stream
{"participant": "", "source": "SOURCE_MICROPHONE", "room":
"492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id": "AJ_fTWmAFwLo4zx", "room_id":
"RM_2Ku6pbEKCBQG"}
13:51:36.836 INFO events User state changed from: listening to speaking
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
13:51:36.986 INFO events Connection quality changed: 2 for participant: agent-AJ_fTWmAFwLo4zx
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
INFO events Connection quality changed: 2 for participant: device-492b0ce9-97d8-44cc-8d0b-a07d7a20214f
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
13:51:37.008 INFO events User state changed from: speaking to listening
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
DEBUG livekit.agents input stream detached
{"participant": "device-492b0ce9-97d8-44cc-8d0b-a07d7a20214f", "source": "SOURCE_MICROPHONE",
"accepted_sources": ["SOURCE_MICROPHONE"], "room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409,
"job_id": "AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
13:51:37.017 INFO main_agent Setting conversation ID: conv_CkCGuC4qCmG2ZaDudlJvt
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}
13:51:37.148 INFO livekit.agents RealtimeModel metrics
{"model_name": "gpt-realtime-2025-08-28", "model_provider": "api.openai.com", "ttft": -1.0,
"input_tokens": 0, "cached_input_tokens": 0, "input_text_tokens": 0, "input_cached_text_tokens": 0, "input_image_tokens": 0,
"input_cached_image_tokens": 0, "input_audio_tokens": 0, "input_cached_audio_tokens": 0, "output_tokens": 0, "output_text_tokens": 0,
"output_audio_tokens": 0, "output_image_tokens": 0, "total_tokens": 0, "tokens_per_second": 0.0, "room":
"492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id": "AJ_fTWmAFwLo4zx", "room_id":
"RM_2Ku6pbEKCBQG"}
13:51:37.318 INFO events Conversation item added from user: Hola, ¿todo cómo va?. interrupted: False
{"room": "492b0ce9-97d8-44cc-8d0b-a07d7a20214f_Kyifw", "agent": "ato-lk-agent-dev", "pid": 33409, "job_id":
"AJ_fTWmAFwLo4zx", "room_id": "RM_2Ku6pbEKCBQG"}tall-airline-16756
12/07/2025, 5:06 PMuv run agent.py dev --log-level=DEBUG
◦ Node: pnpm run dev --log-level=debug
• Look for log lines showing the outgoing OpenAI request (payload) and its response or websocket connect/close events. Paste those sections here.
1. Check for errors/timeouts
• Search logs for any ERROR/WARN lines around the timestamp after conversation item added (135137). If you see connection or auth errors, paste them.
1. Verify transcription → model handoff
• Confirm the agent produced a transcript before sending to LLM. In logs you should see the transcript text and then a call to the LLM. If transcript exists but no LLM call, the routing or trigger logic is failing — share the agent code that handles end-of-turn/dispatch.
1. Confirm tokens/metrics after repro
• Reproduce the interaction and share the RealtimeModel metrics block that follows; if it still shows zeros, the LLM never received input.
If you want, I can:
• Give exact log lines to look for (plugin request/response traces) for your SDK, or
• Review the relevant agent code snippet that sends transcripts to the model.
Which SDK and version are you using, and can you paste the debug logs showing the OpenAI request/connection attempts?aloof-scooter-47164
12/07/2025, 5:26 PMaloof-scooter-47164
12/07/2025, 5:26 PMtall-airline-16756
12/07/2025, 5:26 PMOPENAI_API_KEY or the var your agent uses) is present in the dev environment.
• Look for websocket connect/handshake logs to api.openai.com (connect, upgrade, 101, or explicit websocket open/close). If you see no socket/open logs, the plugin never connected.
3) Turn detection → transcript → LLM handoff
• Confirm a transcript was produced and then handed to the LLM. In DEBUG logs you should see:
◦ transcript text emitted
◦ a subsequent log showing an outgoing LLM request payload (messages/prompt) referencing that transcript
If you see transcript logs but no outgoing LLM call, the handoff/trigger logic (end-of-turn or routing) is failing.
4) Enable full debug for plugin-level traffic
• Start agent with DEBUG and ensure HTTP/ws request/response logging is shown:
◦ Python: uv run agent.py dev --log-level=DEBUG
◦ Node: pnpm run dev --log-level=debug
• Search the logs for:
◦ "POST /v1/realtime" or websocket frames to OpenAI
◦ Request payload that includes your prompt/messages
◦ Any 4xx/5xx, timeouts, or error frames
5) Inspect RealtimeModel metrics after a repro
• Reproduce the audio, then find the RealtimeModel metrics block. If it still shows zero input/output tokens, that indicates the LLM call did not occur or returned empty.
6) Look for silent plugin errors
• Search for WARN/ERROR near the timestamps. Some plugin errors may not be obvious — paste any connect/auth warnings or stack traces you find.
7) Quick local test outside Agents
• From the same machine/env, try a minimal OpenAI Realtime request (or a simple REST call to the standard completions/chat endpoint) to confirm your key and network are OK. If that fails, it's an auth/network issue not agent logic.
If you want, paste these specific logs after repro:
• Any lines showing OpenAI request/connection attempts (POST/ws frames) around 135137.
• Any WARN/ERROR lines within ±30s of the conversation item.
• The full RealtimeModel metrics block after repro.
Or paste your agent config snippet that defines the OpenAI plugin (model name, base_url, and any realtime flag). I’ll point out exactly what to change.tall-airline-16756
12/07/2025, 5:27 PMbase_url, and any realtime flag). I’ll verify it’s a realtime-capable model string.
2) Verify auth & network
• Run from the same dev host:
◦ curl the standard OpenAI REST endpoint with your key to confirm network/auth:
curl -s -o /dev/null -w "%{http_code}\n" https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"
• If you get 200, auth/network are OK. If not, paste the HTTP code or error.
3) Capture plugin-level traffic in DEBUG
• Start the agent with DEBUG and reproduce:
◦ Python: uv run agent.py dev --log-level=DEBUG
• Search the debug output for any of these after the conversation item timestamp:
◦ websocket connect/open logs to api.openai.com or POST /v1/realtime
◦ outgoing request payloads containing the transcript/messages
◦ websocket frames, responses, or error frames
• Paste the exact lines for connect/request/response (redact keys).
4) Check transcript → LLM handoff
• In DEBUG logs, do you see the transcript text printed, then immediately a log showing an LLM request payload? If you see transcript but no LLM request, paste the transcript log and the agent code that triggers LLM calls (end-of-turn handler).
5) Look for silent errors/timeouts
• Search for WARN/ERROR within ±30s of your timestamps. Paste any stack traces or error lines you find.
6) Quick local sanity test
• From the same environment, try a simple OpenAI call (chat completion or model list) to confirm the SDK can reach OpenAI. Paste results.
If you paste:
• your OpenAI plugin config, and
• the DEBUG lines showing connect/request/response (or lack thereof),
I’ll point out the exact misconfiguration or next fix (auth, model name, websocket issue, or routing bug).