From 16720dc45b0f22a2cefbf5f9fe16dff4432802db Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 29 Jul 2026 09:02:25 -0700 Subject: [PATCH] fix(computer-use): hide the --no-overlay help probe console too Follow-up to the #62821 salvage: the _cua_driver_supports_no_overlay --help probe is another Windows-reachable spawn; give it the same windows_hide_flags() treatment. Also adjust the status test to stub _resolve_driver_cmd (permissions.py resolves via that helper, not shutil.which). --- tests/computer_use/test_cua_spawn_env_sanitization.py | 2 +- tools/computer_use/cua_backend.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/computer_use/test_cua_spawn_env_sanitization.py b/tests/computer_use/test_cua_spawn_env_sanitization.py index 83e354ff606..8692365e574 100644 --- a/tests/computer_use/test_cua_spawn_env_sanitization.py +++ b/tests/computer_use/test_cua_spawn_env_sanitization.py @@ -163,7 +163,7 @@ def test_windows_status_hides_every_reachable_subprocess(monkeypatch): monkeypatch.setattr(permissions.sys, "platform", "win32") monkeypatch.setattr(permissions, "windows_hide_flags", lambda: CREATE_NO_WINDOW) - monkeypatch.setattr(permissions.shutil, "which", lambda command: binary) + monkeypatch.setattr(permissions, "_resolve_driver_cmd", lambda command: binary) monkeypatch.setattr(permissions.subprocess, "run", fake_run) status = permissions.computer_use_status("cua-driver") diff --git a/tools/computer_use/cua_backend.py b/tools/computer_use/cua_backend.py index 868dbeaa522..c17880537d6 100644 --- a/tools/computer_use/cua_backend.py +++ b/tools/computer_use/cua_backend.py @@ -479,6 +479,7 @@ def _cua_driver_supports_no_overlay(driver_cmd: str) -> bool: [driver_cmd, "--help"], capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=3.0, stdin=subprocess.DEVNULL, + creationflags=windows_hide_flags(), env=_sanitize_subprocess_env(cua_driver_child_env()), ) help_text = (proc.stdout or "") + (proc.stderr or "")