Fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Deniz Şafak 2026-03-18 02:18:11 +03:00 committed by GitHub
parent b31589064a
commit 73f6058716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -247,7 +247,13 @@ def get_outputs_summary(outputs: dict) -> tuple[int, Optional[dict]]:
# Not a 3D file string — check for text preview # Not a 3D file string — check for text preview
if media_type == 'text': if media_type == 'text':
count += 1 count += 1
if preview_output is None: # Only create/store a text fallback when we don't yet
# have a primary preview or a non-text fallback.
if (
preview_output is None
and fallback_preview is None
and text_fallback_preview is None
):
if isinstance(item, tuple): if isinstance(item, tuple):
text_value = item[0] if item else '' text_value = item[0] if item else ''
else: else:
@ -258,8 +264,7 @@ def get_outputs_summary(outputs: dict) -> tuple[int, Optional[dict]]:
'nodeId': node_id, 'nodeId': node_id,
'mediaType': media_type 'mediaType': media_type
} }
if text_fallback_preview is None: text_fallback_preview = enriched
text_fallback_preview = enriched
continue continue
# normalize_output_item returned a dict (e.g. 3D file) # normalize_output_item returned a dict (e.g. 3D file)
item = normalized item = normalized
@ -282,7 +287,7 @@ def get_outputs_summary(outputs: dict) -> tuple[int, Optional[dict]]:
# Prefer non-text media (images/video/audio/3d) over text fallback. # Prefer non-text media (images/video/audio/3d) over text fallback.
if fallback_preview is None: if fallback_preview is None:
fallback_preview = enriched fallback_preview = enriched
elif text_fallback_preview is None: elif fallback_preview is None and text_fallback_preview is None:
text_fallback_preview = enriched text_fallback_preview = enriched
return count, preview_output or fallback_preview or text_fallback_preview return count, preview_output or fallback_preview or text_fallback_preview