Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
moved trajectory dir fix
Dillon DuPontdb1d8a4c5dbc
diff --git a/libs/python/agent/agent/integrations/hud/__init__.py b/libs/python/agent/agent/integrations/hud/__init__.pyindex 81f829255c..787613deb4 100644--- a/libs/python/agent/agent/integrations/hud/__init__.py+++ b/libs/python/agent/agent/integrations/hud/__init__.py@@ -7,7 +7,6 @@ from hud import run_job as hud_run_jobfrom .agent import ComputerAgentfrom .adapter import ComputerAgentAdapterfrom .computer_handler import HUDComputerHandler-from agent.callbacks.trajectory_saver import TrajectorySaverCallbackasync def run_job(@@ -49,15 +48,6 @@ async def run_job(Returns:Job instance from HUD"""- # Handle trajectory_dir by adding TrajectorySaverCallback- trajectory_dir = agent_kwargs.pop("trajectory_dir", None)- callbacks = agent_kwargs.get("callbacks", [])-- if trajectory_dir:- trajectory_callback = TrajectorySaverCallback(trajectory_dir, reset_on_run=False)- callbacks = callbacks + [trajectory_callback]- agent_kwargs["callbacks"] = callbacks-# combine verbose and verbosity kwargsif "verbose" in agent_kwargs:agent_kwargs["verbosity"] = logging.INFOdiff --git a/libs/python/agent/agent/integrations/hud/agent.py b/libs/python/agent/agent/integrations/hud/agent.pyindex 580954175a..cb810b3655 100644--- a/libs/python/agent/agent/integrations/hud/agent.py+++ b/libs/python/agent/agent/integrations/hud/agent.py@@ -86,6 +86,16 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]):dimensions=(self.width, self.height))+ # Handle trajectory_dir by adding TrajectorySaverCallback+ trajectory_dir = kwargs.pop("trajectory_dir", None)+ callbacks = kwargs.get("callbacks", [])++ if trajectory_dir:+ from agent.callbacks.trajectory_saver import TrajectorySaverCallback+ trajectory_callback = TrajectorySaverCallback(trajectory_dir, reset_on_run=False)+ callbacks = callbacks + [trajectory_callback]+ kwargs["callbacks"] = callbacks+# Initialize ComputerAgent with HUD computer handlerself.computer_agent = BaseComputerAgent(model=model,@@ -212,7 +222,7 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]):# ComputerAgent.run returns an async generatorasync for result in self.computer_agent.run(self.conversation_history, stream=False):# if the result has computer_call_output, immediately exit- if result.get("output", [])[-1].get("type") == "computer_call_output":+ if result.get("output", []) and result.get("output", [])[-1].get("type") == "computer_call_output":break# otherwise add agent output to conversation historyself.conversation_history += result["output"]