Skip to content

Improve Windows support for runtime execution and CI#5

Merged
WendellXY merged 15 commits intooops-rs:mainfrom
ahavili:windows-support
Mar 26, 2026
Merged

Improve Windows support for runtime execution and CI#5
WendellXY merged 15 commits intooops-rs:mainfrom
ahavili:windows-support

Conversation

@ahavili
Copy link
Copy Markdown
Contributor

@ahavili ahavili commented Mar 26, 2026

Summary

  • use platform-native shell execution in LocalRuntimeExecutor and add Windows timeout teardown
  • reclaim stale runtime leases on Windows and add platform-aware test coverage
  • add windows-latest to Rust CI and document the runtime shell/OAuth store behavior

Verification

  • cargo fmt --all
  • CARGO_TARGET_DIR=/tmp/mentra-target cargo check -p mentra
  • targeted cargo test runs for command execution, background task flows, cwd routing, snapshot updates, and path-related unit tests

Notes

  • the CI matrix now includes Windows so upstream Actions can validate the new code paths directly

ahavili and others added 15 commits March 26, 2026 23:00
path_is_allowed now canonicalizes the inspected path (candidate_path) and compares it against canonicalized default and extra roots so starts_with checks behave correctly for symlinks/relative paths. Windows test helpers in support.rs now prefix PowerShell commands with $ProgressPreference='SilentlyContinue' to suppress progress output that could interfere with test stdout/stderr. Affects mentra/src/runtime/control/policy.rs and mentra/src/agent/tests/support.rs.
Introduce a temp_store helper that constructs a unique SqliteRuntimeStore file (using timestamp + atomic counter) and import SqliteRuntimeStore into tests. Update Runtime builder calls in multiple agent tests to use .with_store(temp_store(...)) to isolate test state. Increase polling bounds in background-task wait helpers from 200 to 1000 iterations to make tests more robust. Also add necessary imports and remove an extra redundant wait in one test.
Wrap watch::Receiver wait loops with tokio::time::timeout to avoid hanging tests (20s). Import Duration and timeout. Make background output checks and tool-result comparisons more robust by using substring contains/is_some_and and by destructuring message content instead of asserting exact equality. Changes in mentra/src/agent/tests/runtime_snapshot.rs and mentra/src/agent/tests/runtime_tools.rs.
Increase async test timeouts and replace magic wait values with named constants to reduce flakiness and make timing configurable. Updated runtime_snapshot tests to extend timeout checks from 20s to 90s. Introduced SHORT_WAIT_ATTEMPTS, BACKGROUND_WAIT_ATTEMPTS and POLL_INTERVAL_MS in runtime_tools, and refactored several wait helpers to use these constants (replacing hard-coded loop counts and sleep durations). This stabilizes background/task-related test waits across the agent tests.
Replace PowerShell-based encoded commands with plain cmd usages for Windows test helpers. background_success_command and background_failure_command now compute a ping-based delay (delay_ms / 1000 + 1) and use `ping -n ... 127.0.0.1 >NUL & echo ...` (and `echo ... 1>&2 & exit /b ...` for failures) to emit output and return codes. Removed the PowerShell-specific helpers (powershell_single_quoted and powershell_encoded_command) and added cmd_echo_literal to escape special cmd characters (^ & | < >). This simplifies Windows test command generation and avoids Base64/PowerShell encoding.
@WendellXY
Copy link
Copy Markdown
Collaborator

😭

@WendellXY WendellXY merged commit cc8fd64 into oops-rs:main Mar 26, 2026
3 checks passed
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