Reject empty Vision Model responses

This commit is contained in:
Alessandro 2026-08-25 22:01:02 +02:00
parent 540ef8d815
commit 1d922aaab2
3 changed files with 44 additions and 0 deletions

View file

@ -116,6 +116,8 @@ class VisionLoad(Tool):
response, _ = await build_vision_model(self.agent).unified_call(
messages=[HumanMessage(content=content)],
)
if not str(response or "").strip():
raise RuntimeError("Vision Model returned an empty response.")
return str(response)
def _store_ephemeral_image(self, image: ephemeral_images.EphemeralImage) -> str:

View file

@ -27,6 +27,7 @@
- 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.
- 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.
- `VisionLoad` is a `Tool`.
- `VisionLoad` defines `execute(...)`.