Versions: livekit-agents 1.6.3 (the code is unchanged on current main), livekit-plugins-openai, Python 3.12.
Setup: openai.LLM plugin pointed at an OpenAI-compatible provider (Mistral, base_url=https://api.mistral.ai/v1), wrapped in llm.FallbackAdapter.
What happens: the OpenAI-compatible streaming schema allows delta.content to be either a str or a list of typed content parts ([{"type": "text", "text": "…"}]). Mistral has started emitting the list form on some streamed chunks. llm/utils.py::strip_thinking_tokens assumes str | None and calls content.find(...), raising AttributeError: 'list' object has no attribute 'find'. The plugin wraps this as a retryable APIConnectionError; under a FallbackAdapter the failure lands mid-stream ("failed after sending chunk, skip retrying"), so the adapter silently moves the whole session to the fallback leg — a hard-to-diagnose degradation for voice agents.
Repro (no network):
import asyncio
from livekit.agents.llm.utils import strip_thinking_tokens
strip_thinking_tokens([{"type": "text", "text": "Hallo"}], asyncio.Event())
# AttributeError: 'list' object has no attribute 'find'
Suggested fix: flatten list-shaped content to its concatenated text parts before the tag scan — see the linked PR.
Versions: livekit-agents 1.6.3 (the code is unchanged on current
main), livekit-plugins-openai, Python 3.12.Setup:
openai.LLMplugin pointed at an OpenAI-compatible provider (Mistral,base_url=https://api.mistral.ai/v1), wrapped inllm.FallbackAdapter.What happens: the OpenAI-compatible streaming schema allows
delta.contentto be either astror a list of typed content parts ([{"type": "text", "text": "…"}]). Mistral has started emitting the list form on some streamed chunks.llm/utils.py::strip_thinking_tokensassumesstr | Noneand callscontent.find(...), raisingAttributeError: 'list' object has no attribute 'find'. The plugin wraps this as a retryableAPIConnectionError; under aFallbackAdapterthe failure lands mid-stream ("failed after sending chunk, skip retrying"), so the adapter silently moves the whole session to the fallback leg — a hard-to-diagnose degradation for voice agents.Repro (no network):
Suggested fix: flatten list-shaped content to its concatenated text parts before the tag scan — see the linked PR.