modern-winter-66316
02/27/2026, 8:19 AMtall-airline-16756
02/27/2026, 8:19 AMtall-airline-16756
02/27/2026, 8:20 AMmodern-winter-66316
02/27/2026, 8:20 AMtall-airline-16756
02/27/2026, 8:21 AMmodern-winter-66316
02/27/2026, 8:24 AMFallbackAdapter have a timeout for hanging providers, or will it wait indefinitely?
1. Why might sub=false appear on the agent's microphone track when autoSubscribe is default (true)?tall-airline-16756
02/27/2026, 8:24 AMsub=false appear on the agent’s microphone track when autoSubscribe is default (true)?
• autoSubscribe=true enables automatic subscription by default, but sub=false means the participant is currently not subscribed to that track. That can happen even with autoSubscribe in place for several reasons:
◦ The client (or application) explicitly called setTrackSubscribed(false) for that track.
◦ The server or admin paused/unpublished the track (permissions or admin controls).
◦ A subscription attempt failed due to signaling/connectivity issues and the client did not retry successfully.
◦ The track was created with attributes that prevent subscription, or participant identities don’t match the subscription rules.
• Quick checks:
◦ Confirm the client-side code isn’t programmatically unsubscribing that track.
◦ Check room/participant state and permissions for any server-side pause/unpublish.
◦ Reproduce in a minimal test room (agent + your participant only) and watch subscription events to see if and when a subscription attempt is made or rejected.
◦ Inspect client and server logs for subscription failures or errors.
◦ If you use participant identity-based routing, ensure the agent is targeting the correct participant identity.
If you’d like, I can walk you through specific commands and log locations to inspect next — for example:
• Which exact log lines to watch when the transcript is forwarded to Inworld/OpenAI.
• What subscription events to look for in the LiveKit client SDK console.
• How to run a reproducible test (single-participant room, BVC off, full-sentence utterance).
Tell me which one you want to tackle first and paste any sample transcript lines or error-log snippets you’ve observed; I’ll give targeted steps from there.
Sources: Choosing the right noise cancellation for your agent | LiveKit | Troubleshooting STT not picking up utterances | LiveKit | client-sdk-js | livekit/livekit_composite | DeepWikimodern-winter-66316
02/27/2026, 8:25 AMtall-airline-16756
02/27/2026, 8:25 AMsub=false even with autoSubscribe=true.
How I can help next
• I can walk you step-by-step through targeted checks (BVC comparisons, subscription event tracing, adapter/provider call logs, and Inworld/OpenAI call traces).
• I can point out exact log lines and SDK events to watch during a test call.
• I can draft a minimal reproducible test plan (single room, BVC off, full sentences) you can run to isolate the problem.
If you want to continue now, please share one or more of the following (any is helpful):
• A recent STT transcript line you saw (copy/paste).
• Agent/LLM or adapter logs from the timeframe when you spoke (exact error messages or timestamps).
• Whether you’ve tried disabling BVC and what changed.
• Whether the room had multiple participants, and how your agent is configured to select which participant to listen to (specific participant identity vs “any”).
• Whether sub=false was seen on the agent’s microphone track in the LiveKit client console and any subscription events around that time.
Pick one item to start with and paste it here — I’ll give precise next steps based on what you share.modern-winter-66316
02/27/2026, 8:26 AMtall-airline-16756
02/27/2026, 8:26 AMsub=false can appear on an agent’s microphone track.
What to check now (targeted to your dependencies and components)
1. BVC / noise-cancellation
◦ BVC runs locally in the agent pipeline and will not directly block the OpenAI call. However, overly aggressive noise-cancellation can remove speech elements and produce poor transcripts, which prevents the agent from generating a response.
◦ With your stack, run a quick A/B test:
i. Start a test room with only you + the agent.
ii. Disable the noise-cancellation module in the agent pipeline (temporarily) and reproduce the utterance.
iii. Compare Deepgram transcripts and Inworld events between the two runs.
◦ Look for truncated words or missing intent words in the transcript when BVC is enabled. If transcripts degrade with BVC enabled, keep it off or tune its aggressiveness.
1. FallbackAdapter timeout behavior
◦ The behavior of FallbackAdapter timeouts is not documented in the sources I have. Treat it as unknown for now.
◦ Practical next steps:
▪︎ Inspect the adapter code or logs where provider calls are made (this is likely in the livekit-agents components you listed).
▪︎ Add or confirm a timeout on outbound provider calls (Deepgram → Inworld → OpenAI). For example, ensure your aiohttp client calls include a timeout to avoid indefinite hanging.
▪︎ If you see long waits in logs, add a short timeout (2–10s depending on your use case) and observe whether your fallback path is triggered.
1. sub=false on agent microphone track (when autoSubscribe is true)
◦ autoSubscribe=true is the default but sub=false still appears when a subscription was not established or was turned off. Possible causes:
▪︎ Your client or agent code explicitly called setTrackSubscribed(false) for that track.
▪︎ The server or an admin paused/unpublished the track.
▪︎ Subscription attempts failed (signaling connectivity issues) and weren’t retried.
▪︎ Participant identity routing mismatches: the agent is configured to listen to a specific identity that doesn’t match your client’s identity.
◦ Focused checks:
i. In a minimal room (agent + your client), observe the LiveKit SDK subscription events in the browser/agent logs. Look for subscription success/failure messages.
ii. Verify the agent’s participant target configuration matches your client identity.
iii. Confirm your client isn’t calling setTrackSubscribed(false) anywhere.
iv. Check for any server-side or admin actions that may pause/unpublish the track.
Specific log locations and what to search for
• Agent process logs (livekit-agents components):
◦ Search for receipt of Deepgram STT events, and timestamps showing forwarding to Inworld and OpenAI.
◦ Look for errors/exceptions, timeouts, or stack traces around those forwarding calls.
• aiohttp calls:
◦ Ensure outbound calls (to Inworld/OpenAI) include timeouts. Search logs for long-running requests or “timeout”/“connection refused”/“502/504” messages.
• LiveKit client logs (browser/agent SDK):
◦ Watch for subscription events and any warnings like “subscription failed,” “track unpublished,” or “participant identity mismatch.”
• Deepgram transcripts:
◦ Compare transcripts produced with BVC on vs off. Look for differences in words that carry intent.
Quick reproducible test plan (minimal steps)
1. Create a test room with only you and the agent (no other participants).
2. Turn off noise cancellation in the agent pipeline.
3. Speak a full sentence (avoid 1–3 word utterances).
4. Capture:
◦ Deepgram transcript line(s).
◦ Agent process logs for the same timestamp (look for receipt of transcript and calls to Inworld/OpenAI).
◦ LiveKit subscription events for the agent track.
1. Repeat with BVC enabled and compare results.
If you want, I can:
• Provide the exact log lines and SDK events to watch for (tell me whether your agent runs in Docker or directly on a host).
• Show how to add a timeout to aiohttp requests (a small snippet) so provider calls don’t hang indefinitely.
Which of the two would you like next?
• Exact log/event strings to watch during a test, or
• A short aiohttp timeout snippet you can drop into the agent adapter code.modern-winter-66316
02/27/2026, 8:28 AMtall-airline-16756
02/27/2026, 8:28 AMlk agent status call return errors?
• Are secrets not being applied correctly (wrong values, missing envs, or overwritten)?
• Do you see any error logs from the agent after deployment (startup exceptions, provider call failures, timeouts)?
• Is the agent deployed but still not responding to transcripts (STT ok, no LLM reply)?
If you paste the failing step’s logs or the lk agent status output, I’ll point to the exact lines/events to inspect and provide tailored fixes (timeout/sniffing suggestions, secrets handling, and deployment adjustments).modern-winter-66316
02/27/2026, 8:29 AMSTT done → LLM active → hangs indefinitely — no response, no error
Was working yesterday with OpenAI GPT-4.1-mini only (no GOOGLE_API_KEY set)
• Today GOOGLE_API_KEY was added → Gemini became primary LLM → hangs silently
FallbackAdapter never fails over to OpenAI (no timeout?)
We've now swapped priority back to OpenAI-first (PR #1022, merged) and disabled BVC (PR #1023, CI running)
• No error logs from the agent — _on_error handler never fires, no exceptions in LK Cloud logs
• lk agent status shows agent as Runningtall-airline-16756
02/27/2026, 8:29 AMGOOGLE_API_KEY. The adapter call to Gemini is hanging or returning no result, and the pipeline never triggers an error path.
• The FallbackAdapter behavior is unknown/documented as not having an explicit timeout, so a hanging provider can block the pipeline instead of failing over.
• Disabling BVC and reverting to OpenAI-first are good steps to isolate LLM vs audio issues.
Immediate actions to diagnose and mitigate (do these in order)
1. Enable detailed/debug logging for the agent process
◦ Turn on debug-level logs for the adapter components (LLM adapter, FallbackAdapter, and network/http client). This will reveal whether a request to Gemini is sent and whether any response/headers are received.
◦ Look specifically for:
▪︎ Outbound request timestamp to Gemini.
▪︎ Any connection/handshake/response events.
▪︎ Any internal adapter state transitions (call started → call finished/failed).
◦ If your agent runs under Docker, set the container env LOG_LEVEL=debug or equivalent and redeploy.
1. Trace the outbound HTTP call and add an explicit timeout
◦ Ensure aiohttp (or your HTTP client) calls to Gemini include a timeout. If calls currently use default behavior, add a short sensible timeout (e.g., 5–15s) while testing.
◦ Example approach: add per-request timeout and a client-level timeout so calls won’t hang indefinitely.
◦ When you add timeouts, confirm the FallbackAdapter triggers the fallback path (Gemini timeout → OpenAI).
1. Confirm provider priority and secret handling
◦ Re-check merged PR #1022 that reorders priority: confirm the effective priority at runtime (environment/config file used by the running agent). Sometimes CI merge doesn’t immediately change deployed runtime config.
◦ Ensure only one effective `GOOGLE_API_KEY`/`OPENAI_API_KEY` value is present in the agent’s runtime secrets file. If both keys exist, provider selection logic may prefer Gemini—verify that behavior matches your intended order.
◦ Verify secrets are present in the agent process you inspected (not just in GitHub Actions) by printing masked secret usage in debug logs (e.g., log which provider is selected, not the key itself).
1. Add a watchdog/fallback guard in the adapter
◦ If FallbackAdapter does not enforce timeouts, add a small wrapper: call the primary provider with a timeout; if it times out or errors, explicitly call the fallback provider.
◦ This can be implemented by catching timeout exceptions from aiohttp and invoking the next provider in the chain.
1. Reproduce with instrumentation
◦ Create a simple test transcript/message and run it through the agent while collecting:
▪︎ Agent debug logs (timestamps).
▪︎ Outbound HTTP logs for requests to Gemini/OpenAI (request start, headers, response, duration).
▪︎ Any Inworld event receipts if Inworld sits between STT and LLM.
◦ Compare behavior when you force OpenAI-first vs Gemini-first.
What to look for in logs (examples)
• Outbound request sent:
◦ “Calling Gemini endpoint at <url> — start timestamp”
• Long-running request:
◦ “No response after 30s for Gemini call” (if you add a timeout you’ll see the timeout exception)
• Fallback behavior:
◦ “Primary provider error/time out — switching to fallback: OpenAI”
• If you see the outbound request but no response or TLS handshake errors, that points to a networking or provider-side issue.
Short-term mitigations you can apply now
• Revert to OpenAI-first in runtime config (you already merged PR to prioritize OpenAI; confirm it’s active). This should restore the previous working path immediately.
• Keep BVC disabled while debugging.
• Add a 10s request timeout for Gemini calls so that the adapter fails fast and triggers fallback.
Longer-term recommendations
• Add explicit per-provider timeouts and robust retry/failover logic in FallbackAdapter so a single hanging provider won’t stall the pipeline.
• Add metrics for provider call latency and failure counts so you can detect silent hangs quickly.
• Add an adapter health-check endpoint that probes each LLM provider and flips priority or disables a provider if it’s unresponsive.
If you want, I can:
• Provide a small aiohttp snippet to add a timeout and fallback catch block you can drop into the agent adapter.
• Give exact log strings and locations to search for in livekit-agents 1.4 (tell me whether agent runs in Docker or on a host and I’ll tailor the commands).
• Draft a minimal reproducible test script that posts a known prompt and shows the expected debug log flow for primary → fallback.
Which of the above would you like next—(A) the aiohttp timeout + fallback snippet, (B) exact debug log lines and commands to inspect your running agent, or (C) a small reproducible test script?