Skip to content

Agent Zero AI framework

Hide empty vision skip summaries

Alessandroa3be123c5060
diff --git a/tests/test_vision_load_image_refs.py b/tests/test_vision_load_image_refs.py
index e38ed316d..d1ef70177 100644
--- a/tests/test_vision_load_image_refs.py
+++ b/tests/test_vision_load_image_refs.py
@@ -169,6 +169,24 @@ def test_active_vision_model_route_prefers_main_native_vision(monkeypatch):
assert bool(model_config.get_vision_model_config()) is expected
+def test_vision_summary_only_shows_skipped_section_when_needed(monkeypatch):
+ _install_tool_stub(monkeypatch)
+ import tools.vision_load as vision_load_module
+
+ tool = vision_load_module.VisionLoad(agent=None)
+ tool.vision_config = {"max_embeds": 10}
+ tool.loaded_paths = ["loaded.png"]
+ tool.skipped_paths = []
+
+ assert tool._summary() == "Loaded images (1):\nloaded.png"
+
+ tool.skipped_paths = ["skipped.png"]
+ assert tool._summary() == (
+ "Loaded images (1):\nloaded.png\n\n"
+ "Skipped images (1, max 10):\nskipped.png"
+ )
+
+
@pytest.mark.anyio
async def test_vision_model_sends_multiple_images_once_and_keeps_history_text_only(
monkeypatch,
diff --git a/tools/vision_load.py b/tools/vision_load.py
index 423f61ea1..45298e4ec 100644
--- a/tools/vision_load.py
+++ b/tools/vision_load.py
@@ -187,11 +187,13 @@ class VisionLoad(Tool):
def _summary(self) -> str:
loaded = "\n".join(self.loaded_paths) if self.loaded_paths else "none"
- skipped = "\n".join(self.skipped_paths) if self.skipped_paths else "none"
- return (
- f"Loaded images ({len(self.loaded_paths)}):\n{loaded}\n\n"
- f"Skipped images ({len(self.skipped_paths)}, max {self._get_max_embeds()}):\n{skipped}"
- )
+ summary = f"Loaded images ({len(self.loaded_paths)}):\n{loaded}"
+ if self.skipped_paths:
+ summary += (
+ f"\n\nSkipped images ({len(self.skipped_paths)}, max {self._get_max_embeds()}):\n"
+ + "\n".join(self.skipped_paths)
+ )
+ return summary
@staticmethod
def _is_data_image_url(value: str) -> bool:
diff --git a/tools/vision_load.py.dox.md b/tools/vision_load.py.dox.md
index 14bf0e6ef..e672a49c4 100644
--- a/tools/vision_load.py.dox.md
+++ b/tools/vision_load.py.dox.md
@@ -28,6 +28,7 @@
- In a direct parallel worker, native image content is queued for the parent and promoted immediately after the outer `parallel` result; the disposable worker never owns the only copy of model-visible pixels.
- Direct parallel workers inherit the parent's model override generically. This tool uses their recorded parent context only to resolve ephemeral refs and durable chat media.
- `max_embeds` comes from the model that actually receives the images.
+- Native tool-result summaries omit the skipped-images section when no images were skipped; when the limit drops inputs, the section reports the skipped paths and active maximum.
- Vision Model calls use the selected model's Advanced `kwargs`; this tool does not impose a separate timeout or output-token limit.
- An empty Vision Model response is reported as an image-analysis error instead of a successful empty capsule.
- Update this file whenever tool arguments, output shape, `break_loop` behavior, intervention handling, prompt instructions, or side effects change.