From 825a9753c103e9cade72554b120503b8769ecdfe Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 12 Aug 2026 21:30:42 -0700 Subject: [PATCH] fix(computer_use): resolve cua-driver at its official Windows installer path (#85038) --- tools/computer_use/cua_backend.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/computer_use/cua_backend.py b/tools/computer_use/cua_backend.py index d42a93288d92a..213c5e3e74c1e 100644 --- a/tools/computer_use/cua_backend.py +++ b/tools/computer_use/cua_backend.py @@ -711,7 +711,16 @@ def _candidate_cua_driver_commands(override: Optional[str] = None) -> List[str]: candidates = [_CUA_DRIVER_DEFAULT_CMD] home = os.path.expanduser("~") if sys.platform == "win32": + local_app_data = os.environ.get("LOCALAPPDATA") or os.path.join( + home, "AppData", "Local" + ) candidates.extend([ + # Official cua-driver installer location on Windows. Freshly + # installed sessions inherit a stale PATH, so PATH lookup alone + # misses it until every Hermes process is restarted. + os.path.join( + local_app_data, "Programs", "Cua", "cua-driver", "bin", "cua-driver.exe" + ), os.path.join(home, ".local", "bin", "cua-driver.exe"), os.path.join(home, ".local", "bin", "cua-driver"), ])