Skip to content

fix(windows): fix native runtime compatibility and enable workspace t… - #3378

Merged
Yeachan-Heo merged 3 commits into
ultraworkers:mainfrom
drormeir:fix/windows-tests
Nov 8, 2026
Merged

Yeachan-Heo merged 3 commits into
ultraworkers:mainfrom
drormeir:fix/windows-tests

Conversation

@drormeir

@drormeir drormeir commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Running the Rust workspace tests on native Windows exposed Unix-only test fixtures and failures in shell execution, hooks, path handling, and OAuth randomness. This PR fixes those compatibility issues and runs the complete workspace suite in the Windows CI job, alongside the existing PowerShell smoke checks.

Runtime changes:

  • Discover the shell installed by Git for Windows even when only its cmd directory is on PATH.
  • Resolve REPL and PowerShell executables directly from PATH, honoring Windows PATHEXT and launching the resolved filename without using a Unix login shell for discovery.
  • Preserve quoted Windows hook commands through cmd /D /S /C, including plugin script paths containing spaces.
  • Normalize Windows verbatim paths before glob matching and allow native Windows paths through the existing canonical workspace-containment check. Outside-workspace access remains permission-controlled.
  • Use the OS-backed getrandom API for OAuth PKCE/state randomness instead of /dev/urandom. The dependency version already exists in the workspace lockfile.
  • Return a consistent directory-path error when loading a session, and recognize Windows separators in configuration error classification.

Test changes:

  • Use portable Python or platform-native fixtures instead of Unix-only executable scripts; preserve exact MCP protocol bytes.
  • Share one environment lock across API unit-test modules, and account for case-insensitive Windows environment names in proxy tests.
  • Encode fixture paths through JSON serialization and compare paths using canonical forms or normalized separators.
  • Preserve essential Windows process variables while isolating CLI subprocess tests from credentials and proxy configuration.
  • Drive the interactive compaction regression through a Unix PTY or a private Windows console using Python's standard library.
  • Resolve the actual Python interpreter before the parity plugin runs, preventing Python launcher installation messages from contaminating its JSON output. Report the actual tool output when that assertion fails.

The Windows CI job installs Python 3 and runs cargo test --workspace --locked --no-fail-fast. No new test exclusions or ignored tests are introduced. The separate CLI output-token override, tool-alias normalization, and repeated-read guard are outside this PR.

Compatibility considerations: Windows shell and hook launch behavior changes intentionally, and cmd /D disables AutoRun processing for those hooks. Executable discovery uses the caller's PATH rather than a login shell's environment. Session-directory error classification becomes explicit. No CLI flags, JSON field names, plugin manifest fields, or provider wire formats are added or removed. Windows prerequisites are the MSVC Rust toolchain/build tools, Git for Windows, and Python 3; no pip packages or live model service are needed.

Anti-slop triage

  • Classification: actionable-fix.
  • Evidence: reproduce with cargo test --workspace --locked --no-fail-fast from rust/ on Windows. Before these fixes, failures included Unix-only fixture setup, hook quoting, native paths, environment-variable races, and plugin JSON parsing. The final native Windows run reports successful workspace tests, formatting, and strict Clippy.
  • Non-destructive review result: merge candidate for maintainer review. The patch is scoped to Windows compatibility, related test portability/isolation, and CI coverage. No remote PR or issue was merged or closed.

Verification

  • Targeted tests/docs checks ran, or the gap is explicitly recorded.
  • git diff --check passes.
  • No live secrets, tokens, private logs, or unrelated generated churn are included.

Native Windows verification reported by the contributor on 2026-11-08, all with exit code 0:

cargo fmt --all --check
cargo test --workspace --locked --no-fail-fast -- --quiet
cargo clippy --workspace --locked --all-targets -- -D warnings

Additional local verification:

  • Linux full workspace suite on the final commit (cargo test --workspace --locked --no-fail-fast): 1,826 passed, zero failures, one existing ignored live-provider test; strict workspace Clippy (--all-targets -- -D warnings) passed.
  • After the final test-only interpreter-discovery adjustment, the complete 12-scenario parity harness passed on Linux both normally and with simulated Python launcher download/extraction messages; targeted strict Clippy passed.
  • All 173 API unit tests passed ten consecutive runs with 32 test threads after the shared-lock fix.
  • Documentation source-of-truth and release-readiness checks passed during preparation. No documentation source files changed afterward.

Limits: Hosted GitHub CI has not run for this unpublished PR. No live-provider/API-credential integration run was performed.

Resolution gate

  • If this PR resolves an issue, the issue number and fix evidence are linked. Not applicable: no issue number is claimed; this addresses the reproducible Windows failures described above.
  • If this PR should not merge, the rejection/defer rationale is evidence-backed and does not rely on vibes. No rejection is proposed; hosted CI and maintainer review remain pending.
  • I did not merge/close remote PRs or issues from an automation lane without owner approval.

…ests

Fix shell discovery, hook quoting, native path handling and OAuth
randomness on Windows, make the test fixtures portable, and run the
full workspace test suite in the Windows CI job.

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Windows workspace test job will still fail in the plugins crate: plugin_registry_runs_initialize_and_shutdown_for_enabled_plugins calls write_lifecycle_plugin, which writes init.sh and shutdown.sh fixtures (rust/crates/plugins/src/lib.rs:2503-2516). On Windows, run_lifecycle_commands invokes an existing fixture path with cmd /C; cmd.exe cannot execute those .sh files, so registry.initialize() and registry.shutdown() return CommandFailed. Make the lifecycle fixtures platform-aware (for example, Windows .cmd scripts and Unix .sh scripts) while preserving the expected init\nshutdown\n log, then rerun the Windows workspace tests.

—
[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo

Copy link
Copy Markdown
Contributor

Fixed and pushed as 08bf9399 to drormeir:fix/windows-tests: write_lifecycle_plugin now creates .cmd fixtures on Windows and .sh fixtures on Unix. Log assertions normalize CRLF while retaining the expected init\nshutdown\n content. Local formatting, Clippy, and workspace tests passed; Windows-target cargo check -p plugins --all-targets passed.

—
[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo

Copy link
Copy Markdown
Contributor

Fixed and pushed as ba0e9607 to drormeir:fix/windows-tests. This addresses the remaining Windows CI failures: CLI lifecycle fixtures now use .cmd/.sh by platform with normalized log assertions; path-based CLI tests no longer assume /tmp or identical Windows long/short names; workspace containment safely recognizes 8.3 aliases via same-file identity while keeping unresolved traversal and symlink escapes fail-closed; and the mock parity test checks stable write confirmation plus the actual file contents and tool success.

Local formatter check, workspace Clippy, workspace tests, and Windows-target runtime cargo check passed.

—
[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at exact head ba0e960711447ef26b5b01f42e5e2460b2f76300. The Windows lifecycle fixtures and workspace-path handling now cover the reported failures, including short-name aliases and fail-closed traversal checks. Rust CI and Rust build checks—including Windows workspace tests and PowerShell smoke—are green at this head. Local formatting, Clippy, workspace tests, and Windows-target runtime check also passed. No blocking findings remain.

—
[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo merged commit 407a6c6 into ultraworkers:main Nov 8, 2026
6 checks passed
@Yeachan-Heo Yeachan-Heo mentioned this pull request Nov 8, 2026
@drormeir
drormeir deleted the fix/windows-tests branch November 9, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants