@@ -130,7 +130,7 @@ def transform_openai_content_part(
130130 is not OpenAI image_url format or transformation fails.
131131 """
132132 if not isinstance (content_part , dict ):
133- return None
133+ return None # type: ignore[unreachable] # defensive check on SDK input
134134
135135 block_type = content_part .get ("type" )
136136
@@ -203,7 +203,7 @@ def transform_anthropic_content_part(
203203 is not Anthropic format or transformation fails.
204204 """
205205 if not isinstance (content_part , dict ):
206- return None
206+ return None # type: ignore[unreachable] # defensive check on SDK input
207207
208208 block_type = content_part .get ("type" )
209209
@@ -271,7 +271,7 @@ def transform_google_content_part(
271271 is not Google format or transformation fails.
272272 """
273273 if not isinstance (content_part , dict ):
274- return None
274+ return None # type: ignore[unreachable] # defensive check on SDK input
275275
276276 # Handle Google inline_data format
277277 if "inline_data" in content_part :
@@ -330,7 +330,7 @@ def transform_generic_content_part(
330330 is not generic format or transformation fails.
331331 """
332332 if not isinstance (content_part , dict ):
333- return None
333+ return None # type: ignore[unreachable] # defensive check on SDK input
334334
335335 block_type = content_part .get ("type" )
336336
@@ -405,7 +405,7 @@ def transform_content_part(
405405 is unrecognized or transformation fails.
406406 """
407407 if not isinstance (content_part , dict ):
408- return None
408+ return None # type: ignore[unreachable] # defensive check on SDK input
409409
410410 # Try OpenAI format first (most common, clear indicator)
411411 result = transform_openai_content_part (content_part )
@@ -526,7 +526,7 @@ def normalize_message_roles(messages: "list[dict[str, Any]]") -> "list[dict[str,
526526 normalized_messages = []
527527 for message in messages :
528528 if not isinstance (message , dict ):
529- normalized_messages .append (message )
529+ normalized_messages .append (message ) # type: ignore[unreachable] # defensive check on SDK input
530530 continue
531531 normalized_message = message .copy ()
532532 if "role" in message :
@@ -661,7 +661,7 @@ def redact_blob_message_parts(
661661 has_blobs = False
662662 for message in messages :
663663 if not isinstance (message , dict ):
664- continue
664+ continue # type: ignore[unreachable] # defensive check on SDK input
665665 content = message .get ("content" )
666666 if isinstance (content , list ):
667667 for item in content :
@@ -683,7 +683,7 @@ def redact_blob_message_parts(
683683 # Second pass: redact blob content in the copy
684684 for message in messages_copy :
685685 if not isinstance (message , dict ):
686- continue
686+ continue # type: ignore[unreachable] # defensive check on SDK input
687687
688688 content = message .get ("content" )
689689 if isinstance (content , list ):
0 commit comments