fix: clarify single-image animation montage notice

This commit is contained in:
Soulter
2026-09-17 18:17:24 +08:00
parent 4d1cec7452
commit 04265693f8
2 changed files with 11 additions and 5 deletions
@@ -127,8 +127,11 @@ async def prepare_request_images(
req.extra_user_content_parts = [
*req.extra_user_content_parts,
TextPart(
text="[Animated image] Animated inputs (e.g. GIF) have been converted "
"to frame montages. Read each montage left to right, top to bottom "
"as frames of the same animation; unused cells are blank."
text="<system_notice>\n"
"[Animated image] Each animated input (e.g. GIF) has been converted "
"into a frame montage: a single image containing a grid of frames "
"from the same animation. Read the frames left to right, then "
"top to bottom; unused cells are blank.\n"
"</system_notice>"
).mark_as_temp(),
]
+5 -2
View File
@@ -348,11 +348,14 @@ async def test_animation_montage_notice_reaches_model(harness, tmp_path):
notices = [
part
for part in harness.captured[-1].req.extra_user_content_parts
if isinstance(part, TextPart) and part.text.startswith("[Animated image]")
if isinstance(part, TextPart) and "[Animated image]" in part.text
]
assert len(notices) == int(expected)
if expected:
assert notices[0]._no_save and "frame montages" in notices[0].text
assert notices[0]._no_save
assert notices[0].text.startswith("<system_notice>\n")
assert notices[0].text.endswith("\n</system_notice>")
assert "a single image containing a grid of frames" in notices[0].text
@pytest.mark.asyncio