From 6d42c5d9392b829d8316d355b1dc2d043f4a39e2 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 8 Aug 2025 18:50:12 -0400 Subject: [PATCH] ensure screenshot / output call exists --- libs/python/agent/agent/integrations/hud/agent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/python/agent/agent/integrations/hud/agent.py b/libs/python/agent/agent/integrations/hud/agent.py index 8ade909c..7740e9c8 100644 --- a/libs/python/agent/agent/integrations/hud/agent.py +++ b/libs/python/agent/agent/integrations/hud/agent.py @@ -175,7 +175,8 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]): # Stop at the last user message break - if last_computer_calls and observation.screenshot: + if last_computer_calls: + screenshot_b64 = await self.hud_computer.screenshot() # Add computer_call_output for each unresponded computer_call for call_id in reversed(last_computer_calls): # Maintain order self.conversation_history.append({ @@ -183,7 +184,7 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]): "call_id": call_id, "output": { "type": "input_image", - "image_url": f"data:image/png;base64,{observation.screenshot}" + "image_url": f"data:image/png;base64,{screenshot_b64}" } }) else: