the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix: make native windows checks reliable (#1925)
JJ Liebig6d1bedee3ee1
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex fa655578d..16fc5c2f3 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -141,33 +141,7 @@ jobs:- name: Run Windows checksif: matrix.kind == 'windows'shell: pwsh- run: |- $ErrorActionPreference = "Stop"- function Invoke-Checked {- param([string]$Command, [string[]]$Arguments)- & $Command @Arguments- if ($LASTEXITCODE -ne 0) {- throw "command failed with exit code $LASTEXITCODE`: $Command $($Arguments -join ' ')"- }- }- function Invoke-CargoWithZigCacheRecovery {- param([string[]]$Arguments)- & cargo @Arguments- if ($LASTEXITCODE -eq 0) {- return- }-- Write-Warning "cargo compile failed; clearing Zig build caches and retrying once"- Remove-Item -Recurse -Force .zig-cache -ErrorAction SilentlyContinue- Remove-Item -Recurse -Force vendor/libghostty-vt/.zig-cache -ErrorAction SilentlyContinue- Remove-Item -Recurse -Force vendor/libghostty-vt/zig-out -ErrorAction SilentlyContinue- Invoke-Checked cargo $Arguments- }- Invoke-Checked cargo @("fmt", "--check")- Invoke-CargoWithZigCacheRecovery @("clippy", "--bin", "herdr", "--locked", "--target", "x86_64-pc-windows-msvc", "--", "-D", "warnings")- Invoke-Checked cargo @("test", "--locked", "--target", "x86_64-pc-windows-msvc", "--bin", "herdr", "windows_")- Invoke-Checked cargo @("test", "--locked", "--target", "x86_64-pc-windows-msvc", "--bin", "herdr", "server::client_transport::tests")- Invoke-Checked cargo @("build", "--locked", "--target", "x86_64-pc-windows-msvc")+ run: .\scripts\windows_check.ps1 -Mode check- name: Smoke ConPTY paneif: matrix.kind == 'windows'diff --git a/justfile b/justfileindex 7bc7cc299..e4010bccb 100644--- a/justfile+++ b/justfile@@ -12,26 +12,40 @@ test-one filter:cargo nextest run --locked "{{filter}}" --status-level fail --final-status-level fail --failure-output final --success-output never# Run fast local lint checks+[unix]lint:cargo fmt --checkcargo clippy --all-targets --locked -- -D warnings+[script("powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File")]+[windows]+lint:+ & .\scripts\windows_check.ps1 -Mode lint+# Run PR CI checks+[unix]ci filter='all()': lintcargo nextest run --locked -E "{{filter}}" --status-level fail --final-status-level slow --failure-output final --success-output neverjust integration-assets-testjust plugin-marketplace-test# Run Windows target lint from Unix/macOS to catch cfg(windows) compile and clippy failures before CI+[unix]windows-lint:rustup target add x86_64-pc-windows-msvcLIBGHOSTTY_VT_SIMD=false cargo clippy --bin herdr --locked --target x86_64-pc-windows-msvc -- -D warnings# Check formatting + run unit tests + Windows target lint + maintenance script tests+[unix]check: ci windows-lintpython3 -m unittest scripts.test_agent_detection_manifest_check scripts.test_changelog scripts.test_config_reference_check scripts.test_docs_translation_parity scripts.test_hermes_integration_asset scripts.test_package_windows_conpty scripts.test_preview scripts.test_vendor_libghostty_vt scripts.test_vendor_portable_pty@echo "docs reminder: if this changes user-facing behavior, make sure the relevant release docs are updated or called out before release."+[script("powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File")]+[windows]+check:+ & .\scripts\windows_check.ps1 -Mode check+# Install repo-local git hooksinstall-hooks:git config core.hooksPath .githooksdiff --git a/scripts/windows_check.ps1 b/scripts/windows_check.ps1new file mode 100644index 000000000..7c225301a--- /dev/null+++ b/scripts/windows_check.ps1@@ -0,0 +1,68 @@+param(+ [ValidateSet("lint", "check")]+ [string]$Mode = "check"+)++$ErrorActionPreference = "Stop"++function Invoke-Checked {+ param([string]$Command, [string[]]$Arguments)++ & $Command @Arguments+ if ($LASTEXITCODE -ne 0) {+ throw "command failed with exit code $LASTEXITCODE`: $Command $($Arguments -join ' ')"+ }+}++function Invoke-CargoWithZigCacheRecovery {+ param([string[]]$Arguments)++ & cargo @Arguments+ if ($LASTEXITCODE -eq 0) {+ return+ }++ Write-Warning "cargo compile failed; clearing Zig build caches and retrying once"+ Remove-Item -Recurse -Force .zig-cache -ErrorAction SilentlyContinue+ Remove-Item -Recurse -Force vendor/libghostty-vt/.zig-cache -ErrorAction SilentlyContinue+ Remove-Item -Recurse -Force vendor/libghostty-vt/zig-out -ErrorAction SilentlyContinue+ Invoke-Checked cargo $Arguments+}++Invoke-Checked rustup @("target", "add", "x86_64-pc-windows-msvc")+Invoke-Checked cargo @("fmt", "--check")+Invoke-CargoWithZigCacheRecovery @(+ "clippy",+ "--bin",+ "herdr",+ "--locked",+ "--target",+ "x86_64-pc-windows-msvc",+ "--",+ "-D",+ "warnings"+)++if ($Mode -eq "lint") {+ return+}++Invoke-Checked cargo @(+ "test",+ "--locked",+ "--target",+ "x86_64-pc-windows-msvc",+ "--bin",+ "herdr",+ "windows_"+)+Invoke-Checked cargo @(+ "test",+ "--locked",+ "--target",+ "x86_64-pc-windows-msvc",+ "--bin",+ "herdr",+ "server::client_transport::tests"+)+Invoke-Checked cargo @("build", "--locked", "--target", "x86_64-pc-windows-msvc")diff --git a/src/platform/windows.rs b/src/platform/windows.rsindex 8a171716a..2caf116d1 100644--- a/src/platform/windows.rs+++ b/src/platform/windows.rs@@ -1156,6 +1156,7 @@ mod tests {#[test]fn windows_shells_round_trip_agent_arguments_through_a_real_command() {+ let _lock = crate::integration::integration_env_lock();let base = std::env::temp_dir().join(format!("herdr-agent-argv-{}-{}",std::process::id(),