Livekit.plugins.aws logs "unknown chunk type" warning for reasoningContent/redactedContent deltas with Bedrock reasoning models

Hi livekit team,

I’m using livekit.plugins.aws LLM with a Bedrock inference profile pointing at an OpenAI reasoning model (in.openai.gpt-5.6-luna) via converse_stream. The conversation works fine end-to-end , but I’m seeing repeated WARNING-level log spam like:

aws bedrock llm: unknown chunk type: {'contentBlockDelta': {'delta': {'reasoningContent': {'redactedContent': b'...'}}, 'contentBlockIndex': 0}}

This looks like it’s coming from the model streaming a reasoningContent block with redactedContent (encrypted CoT reasoning per the Bedrock ReasoningContentBlock docs)
which the plugin’s _parse_chunk doesn’t have a handler branch for, so it falls through to a generic “unknown chunk type” warning instead of just skipping it.

Is there a supported way to disable/suppress this warning?

@livekit @LiveKit-Community @livekitteams @darryncampbell @CWilson @Muhammad_Usman_Bashir

Not for this warning specifically, but Claude suggests a logging filter, logging — Logging facility for Python — Python 3.14.7 documentation which feels like the most sensible approach:

import logging

class DropReasoningChunkWarnings(logging.Filter):
    def filter(self, record: logging.LogRecord) -> bool:
        if record.msg != "aws bedrock llm: unknown chunk type":
            return True
        chunk = record.__dict__.get("lk.pii.chunk") or {}
        delta = chunk.get("contentBlockDelta", {}).get("delta", {})
        return "reasoningContent" not in delta  # False == suppress

logging.getLogger("livekit.plugins.aws").addFilter(DropReasoningChunkWarnings())

I agree, the correct solution would be to handle this case in the plugin, and ignore “reasoningContent”, but I know you’re just looking to get rid of that spurious warning. I would raise the PR myself, but I don’t have an AWS account set up so I wouldn’t be able to test that it works.

Darryn’s filter should work as long as those two strings match the source: the exact record.msg and the lk.pii.chunk extra key.

Worth knowing how it fails if they don’t. Both checks return True on a mismatch, so everything passes through and it looks like the filter simply did nothing. No error, no clue as to why.

If that happens, this version doesn’t depend on either string:

import logging

class DropReasoningChunkWarnings(logging.Filter):
    def filter(self, record: logging.LogRecord) -> bool:
        blob = repr(record.__dict__)
        return not ("unknown chunk type" in blob and "reasoningContent" in blob)

logging.getLogger("livekit.plugins.aws").addFilter(DropReasoningChunkWarnings())

record.__dict__ holds msg, args and any extra fields, so this catches the chunk whether it’s interpolated into the message or attached separately.

One more thing if it still doesn’t fire: filters on a Logger only apply to records logged through that logger directly. They do not see records propagating up from child loggers, since propagation calls parent handlers but not parent filters. If the plugin logs under a child name like livekit.plugins.aws.llm, attach the filter to your handler instead and it will catch everything reaching it.

On the PR, Darryn mentioned he can’t raise one without an AWS account to test against. You have both the account and a reliable reproduction, which makes you the right person for it. A branch that skips reasoningContent is a small change and fixes this for everyone rather than each person maintaining their own filter.

Worth checking one thing while you’re testing: whether dropping those blocks affects multi-turn conversations that use tools. Some reasoning models on Bedrock expect reasoning blocks to be included in subsequent requests, so discarding them can cause issues that a single-turn test won’t reveal.