From fd1dca05deb0fd4d50153b42412f716e341236c3 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 25 Aug 2026 10:19:56 -0700 Subject: [PATCH] fix(bedrock_mantle): type the codex item dispatcher without Any --- litellm/llms/bedrock_mantle/responses/transformation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/llms/bedrock_mantle/responses/transformation.py b/litellm/llms/bedrock_mantle/responses/transformation.py index 9068a641940..3e5dd4ff87d 100644 --- a/litellm/llms/bedrock_mantle/responses/transformation.py +++ b/litellm/llms/bedrock_mantle/responses/transformation.py @@ -288,7 +288,7 @@ class BedrockMantleResponsesAPIConfig(BedrockMantleAuthMixin, OpenAIResponsesAPI return rewritten @classmethod - def _normalize_codex_input_item(cls, item: object) -> "tuple[Any, str | None]": + def _normalize_codex_input_item(cls, item: object) -> "tuple[object, str | None]": """Returns (normalized item or None to drop it, original type when rewritten).""" if not isinstance(item, dict): return item, None @@ -324,7 +324,8 @@ class BedrockMantleResponsesAPIConfig(BedrockMantleAuthMixin, OpenAIResponsesAPI "Bedrock Mantle Responses API: rewrote Codex input item type(s) %s that Mantle rejects.", rewritten_types, ) - return [item for item, _ in normalized if item is not None] # mutable-ok: ResponseInputParam is a list + kept: Final = [item for item, _ in normalized if item is not None] # mutable-ok: ResponseInputParam is a list + return kept # pyright: ignore[reportReturnType] # Codex passthrough items sit outside the OpenAI input union def map_openai_params( self,