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.
This commit is contained in:
Brooklyn Nicholson 2026-06-22 17:59:18 -05:00
parent 2dfcead683
commit 3c1058e2e9

View file

@ -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