I am getting a new error today. The agent was work...
# ask-ai
b
I am getting a new error today. The agent was working fine until a few minutes ago, now it throws this error 154454.238 DEBUG livekit.agents received assignment {"agent_name": "", "room_id": "RM_6hGJTUL6ThMB", "room": "room-rx8kt1ea", "job_id": "AJ_4HUZq2xBC96u", "dispatch_id": "AD_QCJ56Qw2ujSc", "enable_recording": false} 154454.241 INFO livekit.agents initializing job runner {"tid": 57832} 154454.242 DEBUG asyncio Using proactor: IocpProactor 154454.243 INFO livekit.agents job runner initialized {"tid": 57832, "elapsed_time": 0.0} 154504.243 WARNI… livekit.agents The room connection was not established within 10 seconds after calling job_entry. This might mean that job_ctx.connect() was never invoked, or that no AgentSession with an active RoomIO has been started. 154516.852 INFO livekit.agents shutting down worker {"id": "AW_4DUxwrBqAUfC"} 154516.854 DEBUG livekit.agents shutting down job task {"reason": "", "user_initiated": false} 154516.856 DEBUG livekit.agents http_session(): closing the httpclient ctx 154516.857 DEBUG livekit.agents http_session(): creating a new httpclient ctx 154516.858 DEBUG livekit.agents job exiting {"reason": "", "tid": 57832, "job_id": "AJ_4HUZq2xBC96u", "room_id": "RM_6hGJTUL6ThMB"} what could be causing it? I checked, there is only 1 deployed agent on the livekit dashboard. Its a self hosted agent.
✅ 1
t
Thanks for reaching out, Aryan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking into the “room connection was not established within 10 seconds” message you pasted. I’ll help narrow this down. Quick summary of what that log means: • The job started but a Room connection wasn’t established within 10s after job_entry. That usually means either
job_ctx.connect()
(or the AgentSession/RoomIO startup) never ran, the agent couldn’t open the RoomIO, or the agent process was too slow/unresponsive to connect in time. What to check next (please share results): • Any recent code or config changes to the agent (entrypoint,
job_entry
, or session startup)? • Agent logs from just before and during the job start (especially any errors/exceptions inside your
entrypoint
or around
session.start()
/
job_ctx.connect()
). • Resource/host state when this happened (CPU, memory, network). Are there other processes on the host? Is the instance a burstable type? • Network reachability to your LiveKit server from the agent host (try a quick ping/tcp check to the LiveKit host/port). • Confirm the agent actually invoked
job_ctx.connect()
/ started an
AgentSession
in your code path for this job. Immediate mitigations: • Restart the agent process to rule out transient hang. • If possible, run 3+ agent workers for the same
agent_name
for redundancy (single replica is a single point of failure). • Add brief debug logs inside your `job_entry`/session startup to confirm
connect()
is reached and whether RoomIO starts successfully. If you can paste the agent log lines immediately before 154454 and any error traces from the entrypoint/session startup, I can point to the most likely root cause and next steps. Sources: Understand and Improve Agent Latency | LiveKit, with interactive elements
b
This is the complete log. uv run bot.py dev 154437.371 DEBUG asyncio Using proactor: IocpProactor DEV livekit.agents Watching C:\Aryan\Work\Chatbot\Testing\livekit-voice-agent 154442.675 DEBUG asyncio Using proactor: IocpProactor 154442.682 INFO livekit.agents starting worker {"version": "1.3.11", "rtc-version": "1.0.23"} 154442.684 INFO livekit.agents HTTP server listening on :61998 154443.264 INFO livekit.agents registered worker {"agent_name": "", "id": "AW_4DUxwrBqAUfC", "url": "wss://hermes-a760ooum.livekit.cloud", "region": "India South", "protocol": 17} 154454.201 INFO livekit.agents received job request {"job_id": "AJ_4HUZq2xBC96u", "dispatch_id": "AD_QCJ56Qw2ujSc", "room": "room-rx8kt1ea", "room_id": "RM_6hGJTUL6ThMB", "agent_name": "", "resuming": false, "enable_recording": false} 154454.238 DEBUG livekit.agents received assignment {"agent_name": "", "room_id": "RM_6hGJTUL6ThMB", "room": "room-rx8kt1ea", "job_id": "AJ_4HUZq2xBC96u", "dispatch_id": "AD_QCJ56Qw2ujSc", "enable_recording": false} 154454.241 INFO livekit.agents initializing job runner {"tid": 57832} 154454.242 DEBUG asyncio Using proactor: IocpProactor 154454.243 INFO livekit.agents job runner initialized {"tid": 57832, "elapsed_time": 0.0} 154504.243 WARNI… livekit.agents The room connection was not established within 10 seconds after calling job_entry. This might mean that job_ctx.connect() was never invoked, or that no AgentSession with an active RoomIO has been started. 154516.852 INFO livekit.agents shutting down worker {"id": "AW_4DUxwrBqAUfC"} 154516.854 DEBUG livekit.agents shutting down job task {"reason": "", "user_initiated": false} 154516.856 DEBUG livekit.agents http_session(): closing the httpclient ctx 154516.857 DEBUG livekit.agents http_session(): creating a new httpclient ctx 154516.858 DEBUG livekit.agents job exiting {"reason": "", "tid": 57832, "job_id": "AJ_4HUZq2xBC96u", "room_id": "RM_6hGJTUL6ThMB"} there were no changes to the entrypoint besides disabling a couple of tools.
t
Thanks — I reviewed the full log and your note that only a couple of tools were disabled in the entrypoint. What this log shows (brief): the worker registered fine, received and initialized the job runner, but no Room connection became active within 10s of job start — meaning either
job_ctx.connect()
/ `AgentSession`/`RoomIO` never started, or the agent was blocked/unresponsive during startup. Please check these next items and share results: 1. Add a couple of short debug prints inside your `job_entry`/entrypoint: ◦ Log immediately when
job_entry
starts. ◦ Log right before and after you call
job_ctx.connect()
(or
session.start()
). ◦ This confirms whether connect is reached and whether it completes. 1. Inspect agent stdout/stderr for any hidden exceptions during those first 10s (exceptions can be swallowed in some setups). If you find a traceback, paste it. 2. Since you said you disabled tools, confirm that disabling them didn’t introduce a synchronous/blocking call in startup (e.g., a blocking I/O call, long init, or waiting on a network service). If any init can block, make it async or move it after
job_ctx.connect()
. 3. Check host resource and network at the moment of the job: ◦ CPU/memory usage, and whether other processes spiked. ◦ Network reachability to the LiveKit server (quick TCP connect to the LiveKit host/port from the agent host). 1. Try a quick repro: ◦ Restart the agent process and trigger a job. Capture full logs from agent start through 30s after the job assignment. ◦ If it succeeds after restart, that suggests a transient hang or resource exhaustion. 1. If still failing, paste: ◦ The small snippet around your `job_entry`/session startup (the few lines that call
connect()
/ start AgentSession). ◦ Any logs you add from step 1. If you share the added debug logs or the
job_entry
snippet, I’ll point to the exact cause and next fix. , with interactive elements
b
This is the only error i see. 155732.055 ERROR livekit livekit_ffi:serverroom149livekit ffiserver:room - audio filter cannot be enabled: LiveKit Cloud is required This is the entrypoint async def entrypoint(ctx: JobContext): await ctx.connect() # ================= PARTICIPANT PROBE (Playground identity/name/etc.) ================= def _safe(obj, attr, default=None): try: return getattr(obj, attr, default) except Exception: return default def _dump_participant(p, prefix="PARTICIPANT"): try: identity = _safe(p, "identity", None) name = _safe(p, "name", None) metadata = _safe(p, "metadata", None) attributes = _safe(p, "attributes", None) print(f"\n[{prefix}]") print(f"identity : {identity!r}") print(f"name : {name!r}") print(f"metadata : {metadata!r}") print(f"attributes : {attributes!r}") except Exception as e: print(f"[{prefix}] Error dumping participant: {e}") room = ctx.room # 1) Dump any participants that already exist (sometimes they connect very fast) try: remote = _safe(room, "remote_participants", None) if isinstance(remote, dict): print("\n================ REMOTE PARTICIPANTS (INITIAL) ================\n") for _, p in remote.items(): _dump_participant(p, prefix="REMOTE_PARTICIPANT_INITIAL") print("\n================ END REMOTE PARTICIPANTS (INITIAL) =============\n") else: print("\n[PARTICIPANT_PROBE] room.remote_participants not a dict or not available:", remote) except Exception as e: print("\n[PARTICIPANT_PROBE] Error reading room.remote_participants:", e) # 2) Also listen for connect/disconnect events (so you always see identity) try: @room.on("participant_connected") def _on_participant_connected(p): _dump_participant(p, prefix="REMOTE_PARTICIPANT_CONNECTED") @room.on("participant_disconnected") def _on_participant_disconnected(p): _dump_participant(p, prefix="REMOTE_PARTICIPANT_DISCONNECTED") except Exception as e: print("\n[PARTICIPANT_PROBE] Could not register participant event handlers:", e) # ================= END PARTICIPANT PROBE ================= session_id = getattr(ctx.room, "name", None) or getattr(ctx.room, "sid", None) if not session_id: session_id = f"session-{int(datetime.now(timezone.utc).timestamp())}" #defining date and time strings now_ist = datetime.now(ZoneInfo("Asia/Kolkata")) date_str = now_ist.strftime("%d-%m-%Y") # DD-MM-YYYY time_str = now_ist.strftime("%H:%M") # HH:MM (24h) #define tools from functions tools=[ # contact-capture save_name, save_phone_number, get_phone_number, save_guest_email, get_guest_email, validate_guest_info_complete, # availability & pricing get_room_list, specific_room_function, calculate_pricing_for_booking, # notification & payment _# send_whatsapp_message,_ try_send_whatsapp, _# send_rates_template,_ send_whatsapp_image, _# send_advance_qr_code,_ _# retrieve_advance,_ # final bookkeeping _# save_booking,_ _# save_final_price,_ _# save_advance,_ complete_booking, # discount save_discount, get_discount, apply_discount, apply_direct_booking_discount, apply_manager_discount, apply_pricing_with_discount, # call handling transfer_call, end_call, ] # Extracting caller ID from the identity field of the remote participant, from the livekit agents playground. caller_identity = "unknown" try: rp = getattr(ctx.room, "remote_participants", None) if isinstance(rp, dict) and len(rp) > 0: # pick the first remote participant p = next(iter(rp.values())) caller_identity = getattr(p, "identity", None) or "unknown" except Exception: caller_identity = "unknown" # #to save the call details in supabase as soon as the call starts, so we have a record of all calls and customers, even if the call gets disconnected before the agent can summarize and store the transcript # try: _# sb_boot = SupabaseBootstrap()_ _# boot = sb_boot.bootstrap_call(session_id=session_id, caller_identity=caller_identity)_ # print(f"[supabase] bootstrapped call: {boot}") # except Exception as e: # print(f"[supabase] bootstrap failed: {e}") try: sb = SupabaseManager() boot = sb.bootstrap_call( session_id=session_id, caller_identity=caller_identity, ensure_booking=False, # set False if you don't want bookings created yet ) print(f"[supabase] bootstrapped call: {boot}") # (optional) store it in session.userdata so tools can use it later _# session.userdata.supabase_boot = boot # only if HermesUserData supports it_ except Exception as e: print(f"[supabase] bootstrap failed: {e}") #to query database for previous call summary for this caller, to provide more context in instructions previous_call_summary = "" try: sb = SupabaseManager() previous_summary = sb.get_latest_previous_summary_by_caller_identity( caller_identity=caller_identity, exclude_session_id=session_id, ) if previous_summary: previous_call_summary = previous_summary print("[supabase] found previous call summary for caller") else: print("[supabase] no previous call summary found") except Exception as e: print(f"[supabase] previous summary lookup failed: {e}") session = build_session(ctx, session_id) print_session_info(session) print("LLM type:", type(session.llm)) print("LLM attrs:", [a for a in dir(session.llm) if "chat" in a or "gen" in a or "complete" in a]) print(f"[debug] caller_identity={caller_identity!r}") print(f"[debug] previous_summary_found={bool(previous_call_summary)}") print(f"[debug] previous_call_summary={previous_call_summary!r}") instructions = load_instructions("orchestra",date_str=date_str,time_str=time_str,session_id=session_id,caller_phone=caller_identity,previous_call_summary=previous_call_summary) register_transcript_shutdown_callback( ctx=ctx, session=session, session_id=session_id, ttl_seconds=30 * 24 * 60 * 60, # setting ttl to 30 days, adjust as needed caller_identity=caller_identity, ) agent = HermesAgent(instructions=instructions, tools=tools)
t
Thanks — this is helpful. Two things stand out from your logs and entrypoint: 1) The ERROR: "audio filter cannot be enabled: LiveKit Cloud is required" • That error means some code (or default Room options) is asking LiveKit to enable an audio filter feature that is only available on LiveKit Cloud. On a self‑hosted server that request is rejected, which can interrupt Room setup. This can cause the Room connection to never become active and trigger the 10s timeout. Action: • Search your code and any libraries/config for references to "audio filter", "enable_audio_filter", or Room publish/subscribe options that enable server-side audio processing and disable them for self‑hosted. • If you use any helper that sets RoomOptions or TrackPublication with audio processing flags by default, remove or set them false when self‑hosting. 2) The job connection timeout / entrypoint startup • Your entrypoint does call
await ctx.connect()
right away (good). The likely chain is: connect attempt => server rejects audio filter => RoomIO fails to become active => 10s timeout. Also confirm nothing in the rest of your startup blocks the event loop. Immediate checks to run and share results: • Grep your repo for audio-filter related flags or any LiveKit RoomOptions defaults and paste the lines (or tell me what you find). • Add temporary debug prints immediately before and after
await ctx.connect()
to confirm whether
connect()
returns or raises: ◦ print("before connect") ◦ await ctx.connect() ◦ print("after connect") • If
connect()
raises, paste the traceback. If it returns but you still get the 10s warning, paste the new logs including any errors between connect and the warning. Quick mitigation: • Disable audio-filter/processing flags so the agent doesn’t request LiveKit‑Cloud‑only features. Restart the agent and repro the job. If you’d like, paste the results of the grep for audio filter flags or the small snippet where you build Room/Track options and I’ll point exactly what to change. , with interactive elements
b
now that livekit has changed how to call LLMs, how should i make the priority high?
Copy code
from livekit.agents import AgentSession, inference

session = AgentSession(
    llm=inference.LLM(
        model="openai/gpt-5-mini", 
        provider="openai",
        extra_kwargs={
            "reasoning_effort": "low"
        }
    )
i want to use high priority so i get quicker responses, i dont mind paying the higher token price
t
Thanks — I’m responding to your question about making LLM calls “high priority” with the new LiveKit inference API. Short answer: • Set
reasoning_effort
to
"high"
in
extra_kwargs
to increase reasoning depth:
Copy code
session = AgentSession(
    llm=inference.LLM(
        model="openai/gpt-5-mini",
        provider="openai",
        extra_kwargs={"reasoning_effort": "high"}
    )
)
• LiveKit does not expose a separate explicit “priority” flag for faster routing. To reduce latency further, use a lower-latency model (e.g., a *-mini or gpt-4o-mini), enable preemptive generation, and run inference from infrastructure co‑located with LiveKit/your region. If you want, tell me: • which model/region you’re using and whether you want lower latency or deeper reasoning (they trade off), and I’ll recommend the exact model + settings. Sources: OpenAI LLM models | LiveKit Documentation | Sequential Pipeline Architecture for Voice Agents | LiveKit | Sequential Pipeline Architecture for Voice Agents | LiveKit | Introducing LiveKit Inference: A unified model interface for voice AI | Liv... | Introducing LiveKit Inference: A unified model interface for voice AI | Liv..., with interactive elements