From 5b010f448f51ec0087a4d7e061ad095bf09bef67 Mon Sep 17 00:00:00 2001 From: f-trycua <195596869+f-trycua@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:50:41 -0500 Subject: [PATCH] fix(computer-use): verify Windows driver repair --- scripts/install.ps1 | 5 +++-- tests/test_install_scripts_computer_use.py | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 2087df1e9c..38c2012a97 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -3637,10 +3637,11 @@ function Install-CuaDriver { if (Wait-Job $job -Timeout 660) { Receive-Job $job -ErrorAction SilentlyContinue | Out-Null Remove-Job $job -Force -ErrorAction SilentlyContinue - if (Get-Command cua-driver -ErrorAction SilentlyContinue) { + $installedCuaDriver = Get-Command cua-driver -ErrorAction SilentlyContinue + if ($installedCuaDriver -and (Test-CuaDriverRuntimeContract -DriverPath $installedCuaDriver.Source)) { Write-Success "Computer Use driver installed (enable via 'hermes tools' -> Computer Use)" } else { - Write-Warn "Computer Use driver install did not complete -- it will install on demand when you enable the tool." + Write-Warn "Computer Use driver install did not produce a compatible runtime -- repair it before enabling the tool." Write-Info "Install later with: hermes computer-use install" } } else { diff --git a/tests/test_install_scripts_computer_use.py b/tests/test_install_scripts_computer_use.py index 322dab361f..e213a2653d 100644 --- a/tests/test_install_scripts_computer_use.py +++ b/tests/test_install_scripts_computer_use.py @@ -65,3 +65,12 @@ class TestInstallPs1: text = INSTALL_PS1.read_text() assert "Computer Use driver install timed out" in text assert "hermes computer-use install" in text + + def test_install_rechecks_runtime_contract_before_success(self) -> None: + text = INSTALL_PS1.read_text() + assert "$installedCuaDriver = Get-Command cua-driver" in text + assert ( + "Test-CuaDriverRuntimeContract -DriverPath $installedCuaDriver.Source" + in text + ) + assert "did not produce a compatible runtime" in text