Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

changed default env

Dillon DuPont30684e0e4399
diff --git a/libs/python/agent/agent/integrations/hud/agent.py b/libs/python/agent/agent/integrations/hud/agent.py
index 7740e9c8d3..74075377e5 100644
--- a/libs/python/agent/agent/integrations/hud/agent.py
+++ b/libs/python/agent/agent/integrations/hud/agent.py
@@ -20,7 +20,7 @@ BASE_SYSTEM_PROMPT = """
You are an autonomous computer-using agent. Follow these guidelines:
1. Be decisive and complete tasks without asking for confirmation unless absolutely necessary.
-2. If you need user confirmation for safety-critical actions, use the formal safety check mechanism.
+2. Use the computer tools to complete the task and do not stop until the task is complete.
3. Do NOT ask questions like "Should I proceed?" or "Would you like me to continue?" - just proceed with the task.
4. When you find what you're looking for (e.g., a file to upload), proceed with the action directly.
5. Only stop when the task is fully complete or if you encounter an error that prevents completion.
@@ -43,7 +43,7 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]):
def __init__(
self,
model: str = "anthropic/claude-3-5-sonnet-20241022",
- environment: Literal["windows", "mac", "linux", "browser"] = "browser",
+ environment: Literal["windows", "mac", "linux", "browser"] = "linux",
adapter: Optional[Adapter] = None,
name: Optional[str] = None,
**kwargs: Any,
@@ -176,6 +176,8 @@ class ComputerAgent(Agent[BaseComputerAgent, dict[str, Any]]):
break
if last_computer_calls:
+ if not observation.screenshot:
+ print("No screenshot found, taking screenshot")
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
diff --git a/libs/python/agent/agent/integrations/hud/computer_handler.py b/libs/python/agent/agent/integrations/hud/computer_handler.py
index 5bf86666d0..9fcc8245e2 100644
--- a/libs/python/agent/agent/integrations/hud/computer_handler.py
+++ b/libs/python/agent/agent/integrations/hud/computer_handler.py
@@ -13,7 +13,7 @@ class HUDComputerHandler(AsyncComputerHandler):
def __init__(
self,
- environment: Literal["windows", "mac", "linux", "browser"] = "browser",
+ environment: Literal["windows", "mac", "linux", "browser"] = "linux",
dimensions: tuple[int, int] = (1024, 768),
screenshot_callback: Optional[Callable] = None,
action_callback: Optional[Callable] = None,