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
Fix remaining stale agent/core namespace references (#1325)
dduponte940238e9508
diff --git a/libs/cua-bench/cua_bench/agents/cua_agent.py b/libs/cua-bench/cua_bench/agents/cua_agent.pyindex e4a783a4a3..01b28d1c14 100644--- a/libs/cua-bench/cua_bench/agents/cua_agent.py+++ b/libs/cua-bench/cua_bench/agents/cua_agent.py@@ -202,7 +202,7 @@ class CuaAgent(BaseAgent):AgentResult with token counts and failure mode"""try:- from agent import ComputerAgent+ from cua_agent import ComputerAgentexcept ImportError as e:raise RuntimeError("cua-agent requires the `cua-agent` package to be installed. "diff --git a/libs/cua-bench/cua_bench/agents/opencua_agent.py b/libs/cua-bench/cua_bench/agents/opencua_agent.pyindex eca1e9cd00..f03a99b57a 100644--- a/libs/cua-bench/cua_bench/agents/opencua_agent.py+++ b/libs/cua-bench/cua_bench/agents/opencua_agent.py@@ -143,7 +143,7 @@ class OpenCUAAgent(BaseAgent):) -> AgentResult:"""Run the task using the OpenCUA model via the CUA Computer Agent SDK."""try:- from agent import ComputerAgent+ from cua_agent import ComputerAgentexcept ImportError as e:raise RuntimeError("opencua-agent requires the `cua-agent` package to be installed. "diff --git a/libs/python/agent/cua_agent/__init__.py b/libs/python/agent/cua_agent/__init__.pyindex 124604583b..1943219ec0 100644--- a/libs/python/agent/cua_agent/__init__.py+++ b/libs/python/agent/cua_agent/__init__.py@@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)# Initialize telemetry when the package is importedtry:# Import from core telemetry for basic functions- from core.telemetry import (+ from cua_core.telemetry import (is_telemetry_enabled,record_event,)diff --git a/libs/python/agent/cua_agent/callbacks/otel.py b/libs/python/agent/cua_agent/callbacks/otel.pyindex 2a3e0e156d..e2b53741a3 100644--- a/libs/python/agent/cua_agent/callbacks/otel.py+++ b/libs/python/agent/cua_agent/callbacks/otel.py@@ -15,7 +15,7 @@ from .base import AsyncCallbackHandler# Import OTEL functions - these are available when cua-core[telemetry] is installedtry:- from core.telemetry import (+ from cua_core.telemetry import (create_span,is_otel_enabled,record_error,diff --git a/libs/python/agent/cua_agent/callbacks/prompt_instructions.py b/libs/python/agent/cua_agent/callbacks/prompt_instructions.pyindex e7cf67fc5b..6f1ec00298 100644--- a/libs/python/agent/cua_agent/callbacks/prompt_instructions.py+++ b/libs/python/agent/cua_agent/callbacks/prompt_instructions.py@@ -6,7 +6,7 @@ instructions message to the start of the conversation before each LLM call.Usage:- from agent.callbacks import PromptInstructionsCallback+ from cua_agent.callbacks import PromptInstructionsCallbackagent = ComputerAgent(model="openai/computer-use-preview",callbacks=[PromptInstructionsCallback("Follow these rules...")]diff --git a/libs/python/agent/cua_agent/cli.py b/libs/python/agent/cua_agent/cli.pyindex 72f011ed1f..9bdc25d5a4 100644--- a/libs/python/agent/cua_agent/cli.py+++ b/libs/python/agent/cua_agent/cli.py@@ -358,7 +358,7 @@ Examples:# Import here to avoid import errors if dependencies are missingtry:- from agent import ComputerAgent+ from cua_agent import ComputerAgentfrom computer import Computerexcept ImportError as e:print_colored(f"❌ Import error: {e}", Colors.RED, bold=True)diff --git a/libs/python/agent/cua_agent/loops/gemini.py b/libs/python/agent/cua_agent/loops/gemini.pyindex 37c45dcad8..9ac5d66734 100644--- a/libs/python/agent/cua_agent/loops/gemini.py+++ b/libs/python/agent/cua_agent/loops/gemini.py@@ -126,7 +126,7 @@ def _create_gemini_client(http_options: Dict[str, Any] = {"base_url": f"{cua_base_url}/gemini"}# Include CUA version headers if availabletry:- from core.http import cua_version_headers+ from cua_core.http import cua_version_headershdrs = cua_version_headers()if hdrs:diff --git a/libs/python/agent/cua_agent/playground/server.py b/libs/python/agent/cua_agent/playground/server.pyindex dd9bd28b4f..eb24058619 100644--- a/libs/python/agent/cua_agent/playground/server.py+++ b/libs/python/agent/cua_agent/playground/server.py@@ -84,7 +84,7 @@ class PlaygroundServer:"""# Import here to avoid circular importstry:- from agent import ComputerAgent+ from cua_agent import ComputerAgentexcept ImportError:raise HTTPException(status_code=501, detail="ComputerAgent not available")diff --git a/libs/python/agent/cua_agent/ui/gradio/ui_components.py b/libs/python/agent/cua_agent/ui/gradio/ui_components.pyindex eae5e44e07..31041edcd2 100644--- a/libs/python/agent/cua_agent/ui/gradio/ui_components.py+++ b/libs/python/agent/cua_agent/ui/gradio/ui_components.py@@ -149,7 +149,7 @@ try:from computer import Computerexcept ImportError:Computer = None # type: ignore[assignment,misc]-from agent import ComputerAgent+from cua_agent import ComputerAgentasync def main():async with Computer{computer_args_str} as computer:diff --git a/libs/python/core/cua_core/telemetry/otel.py b/libs/python/core/cua_core/telemetry/otel.pyindex 2587bb458e..671e7e0f06 100644--- a/libs/python/core/cua_core/telemetry/otel.py+++ b/libs/python/core/cua_core/telemetry/otel.py@@ -226,7 +226,7 @@ def _shutdown_otel() -> None:def _get_sdk_version() -> str:"""Get the CUA SDK version."""try:- from core import __version__+ from cua_core import __version__return __version__except ImportError:diff --git a/libs/python/core/cua_core/telemetry/posthog.py b/libs/python/core/cua_core/telemetry/posthog.pyindex f560bbced3..35b509d860 100644--- a/libs/python/core/cua_core/telemetry/posthog.py+++ b/libs/python/core/cua_core/telemetry/posthog.py@@ -10,7 +10,7 @@ from pathlib import Pathfrom typing import Any, Dict, List, Optionalimport posthog-from core import __version__+from cua_core import __version__logger = logging.getLogger("core.telemetry")diff --git a/libs/python/cua-cli/cua_cli/main.py b/libs/python/cua-cli/cua_cli/main.pyindex 5aabb711c1..03938b277b 100644--- a/libs/python/cua-cli/cua_cli/main.py+++ b/libs/python/cua-cli/cua_cli/main.py@@ -62,7 +62,7 @@ def main() -> int:# Suppress noisy INFO logs from dependencies (computer, core.telemetry, etc.)# Must set on specific loggers since they configure their own handlers at import timelogging.basicConfig(level=logging.WARNING)- for name in ("computer", "core", "core.telemetry", "httpx", "httpcore", "cua_sandbox"):+ for name in ("computer", "cua_core", "cua_core.telemetry", "httpx", "httpcore", "cua_sandbox"):logging.getLogger(name).setLevel(logging.WARNING)parser = create_parser()diff --git a/libs/python/cua/cua/__init__.py b/libs/python/cua/cua/__init__.pyindex 40be5522d9..eeb35c7289 100644--- a/libs/python/cua/cua/__init__.py+++ b/libs/python/cua/cua/__init__.py@@ -92,10 +92,10 @@ _INTERFACE_NAMES: dict[str, tuple[str, str]] = {}_AGENT_NAMES: dict[str, tuple[str, str]] = {- "ComputerAgent": ("agent", "ComputerAgent"),- "AgentResponse": ("agent", "AgentResponse"),- "Messages": ("agent", "Messages"),- "register_agent": ("agent", "register_agent"),+ "ComputerAgent": ("cua_agent", "ComputerAgent"),+ "AgentResponse": ("cua_agent", "AgentResponse"),+ "Messages": ("cua_agent", "Messages"),+ "register_agent": ("cua_agent", "register_agent"),}_LAZY: dict[str, tuple[str, str]] = {**_RUNTIME_NAMES, **_INTERFACE_NAMES, **_AGENT_NAMES}diff --git a/tests/test_mcp_server_session_management.py b/tests/test_mcp_server_session_management.pyindex 5a5c9fb37d..ef0f58e6d3 100644--- a/tests/test_mcp_server_session_management.py+++ b/tests/test_mcp_server_session_management.py@@ -101,7 +101,7 @@ def server_module():_install_stub_module("computer", computer_module, stubbed_modules)# Stub agent module- agent_module = types.ModuleType("agent")+ agent_module = types.ModuleType("cua_agent")class _StubComputerAgent:def __init__(self, *args, **kwargs):@@ -121,7 +121,7 @@ def server_module():agent_module.ComputerAgent = _StubComputerAgent- _install_stub_module("agent", agent_module, stubbed_modules)+ _install_stub_module("cua_agent", agent_module, stubbed_modules)# Stub session manager modulesession_manager_module = types.ModuleType("mcp_server.session_manager")diff --git a/tests/test_mcp_server_streaming.py b/tests/test_mcp_server_streaming.pyindex 68aaa55586..cd6f05095d 100644--- a/tests/test_mcp_server_streaming.py+++ b/tests/test_mcp_server_streaming.py@@ -98,7 +98,7 @@ def server_module():_install_stub_module("computer", computer_module, stubbed_modules)# Stub agent module so server can import ComputerAgent- agent_module = types.ModuleType("agent")+ agent_module = types.ModuleType("cua_agent")class _StubComputerAgent:def __init__(self, *args, **kwargs):@@ -111,7 +111,7 @@ def server_module():agent_module.ComputerAgent = _StubComputerAgent- _install_stub_module("agent", agent_module, stubbed_modules)+ _install_stub_module("cua_agent", agent_module, stubbed_modules)module_name = "mcp_server_server_under_test"module_path = Path("libs/python/mcp-server/mcp_server/server.py").resolve()