Improve Windows support for runtime execution and CI#5
Merged
WendellXY merged 15 commits intooops-rs:mainfrom Mar 26, 2026
Merged
Improve Windows support for runtime execution and CI#5WendellXY merged 15 commits intooops-rs:mainfrom
WendellXY merged 15 commits intooops-rs:mainfrom
Conversation
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.
Collaborator
|
😭 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LocalRuntimeExecutorand add Windows timeout teardownwindows-latestto Rust CI and document the runtime shell/OAuth store behaviorVerification
Notes