From 9597193bd5f39fdf470a8356f093b06965a544ff Mon Sep 17 00:00:00 2001 From: alckasoc Date: Sat, 4 Oct 2025 02:40:47 +0000 Subject: [PATCH] small bug fix --- gui_agents/s3/utils/common_utils.py | 8 +++++--- osworld_setup/s3/bbon/generate_facts.py | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gui_agents/s3/utils/common_utils.py b/gui_agents/s3/utils/common_utils.py index 187e223..9762517 100644 --- a/gui_agents/s3/utils/common_utils.py +++ b/gui_agents/s3/utils/common_utils.py @@ -72,9 +72,11 @@ def call_llm_formatted(generator, format_checkers, **kwargs): max_retries = 3 # Set the maximum number of retries attempt = 0 response = "" - messages = ( - generator.messages.copy() - ) # Copy messages to avoid modifying the original + if kwargs.get("messages") is None: + messages = generator.messages.copy() # Copy messages to avoid modifying the original + else: + messages = kwargs["messages"] + del kwargs["messages"] # Remove messages from kwargs to avoid passing it twice while attempt < max_retries: response = call_llm_safe(generator, messages=messages, **kwargs) diff --git a/osworld_setup/s3/bbon/generate_facts.py b/osworld_setup/s3/bbon/generate_facts.py index 5d960fb..cfa8faf 100644 --- a/osworld_setup/s3/bbon/generate_facts.py +++ b/osworld_setup/s3/bbon/generate_facts.py @@ -45,7 +45,11 @@ async def generate_single_fact_caption( # Generate fact caption using behavior narrator result = await asyncio.to_thread( - judge.judge, before_bytes, after_bytes, pyautogui_action + judge.judge, + screenshot_num=i + 1, + before_img_bytes=before_bytes, + after_img_bytes=after_bytes, + pyautogui_action=pyautogui_action, ) result["screenshot_num"] = i + 1