From c0882093b89ba5d848844880818913eb094ae88d Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 28 Aug 2026 03:58:08 -0700 Subject: [PATCH] test(vision): truncated-image test accepts rejection at either stacked gate With both salvaged validators in place, the resolver-boundary verify() (#53307) catches a truncated PNG before the full-decode gate (#76896) runs. Either error message means the bytes stayed out of history. --- tests/tools/test_vision_native_fast_path.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/tools/test_vision_native_fast_path.py b/tests/tools/test_vision_native_fast_path.py index 673a795c42..5237ae665f 100644 --- a/tests/tools/test_vision_native_fast_path.py +++ b/tests/tools/test_vision_native_fast_path.py @@ -165,7 +165,12 @@ class TestVisionAnalyzeNative: assert isinstance(result, str), "corrupt image must not return a multimodal envelope" payload = json.loads(result) assert payload["success"] is False - assert "decode" in payload["error"].lower() + # Two stacked gates can catch this: the resolver-boundary verify() + # (salvaged #53307) reports "not a recognized image"; the full-decode + # gate (salvaged #76896) reports a decode failure. Either rejection + # keeps the truncated bytes out of history. + err = payload["error"].lower() + assert "decode" in err or "not a recognized image" in err def test_truncated_animated_gif_frame_is_rejected_before_embedding( self, tmp_path, monkeypatch