From 3c1058e2e983c45856c4417e1c47d69843e778ed Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 22 Jun 2026 17:59:18 -0500 Subject: [PATCH] fix(computer-use): set stdin=DEVNULL on cua-driver subprocess calls The subprocess-stdin guard (TUI gateway fd-inheritance protection) flagged the `permissions grant` call. None of the cua-driver probes/grant read stdin, so DEVNULL is correct; apply it to the shared `_run` helper and the grant call. --- tools/computer_use/permissions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/computer_use/permissions.py b/tools/computer_use/permissions.py index e72208b796e..ab97b60ee66 100644 --- a/tools/computer_use/permissions.py +++ b/tools/computer_use/permissions.py @@ -63,6 +63,7 @@ def _run(binary: str, *args: str, timeout: float) -> subprocess.CompletedProcess text=True, timeout=timeout, env=_child_env(), + stdin=subprocess.DEVNULL, ) @@ -174,7 +175,13 @@ def request_permissions_grant(driver_cmd: Optional[str] = None) -> int: "approve it, then return here." ) try: - return int(subprocess.run([binary, "permissions", "grant"], env=_child_env()).returncode) + return int( + subprocess.run( + [binary, "permissions", "grant"], + env=_child_env(), + stdin=subprocess.DEVNULL, + ).returncode + ) except KeyboardInterrupt: # pragma: no cover - interactive return 130 except Exception as exc: # pragma: no cover - defensive