style(gemini): use list.extend to satisfy strict ruff rules

This commit is contained in:
Charlie Freeman 2026-10-28 21:41:32 +08:00
parent 2ded7fe040
commit 3fde52bef5

View file

@ -938,13 +938,15 @@ def gemini_convert_messages_with_history(
)
## check if gemini_tool_call already exists in assistant_content before this batch
pre_existing_parts = list(assistant_content)
for gemini_tool_call_part in gemini_tool_call_parts:
assistant_content.extend(
gemini_tool_call_part
for gemini_tool_call_part in gemini_tool_call_parts
if not check_if_part_exists_in_parts(
pre_existing_parts,
gemini_tool_call_part,
excluded_keys=["thoughtSignature"],
):
assistant_content.append(gemini_tool_call_part)
)
)
# Only record this as the active tool-call message when it actually
# carries tool calls. The `if` guard above is also entered for a
# text-only assistant message (`assistant_msg.get("tool_calls", [])