Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

chore: post-#146 tightening — dedupe lock const, non-gating Windows CI

AkitaOnRailsf32bad701465
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f025049a..710ccda5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,6 +47,25 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --all-targets
+ # Native Windows is where the `#[cfg(windows)]` regression tests (drain
+ # lock ERROR_LOCK_VIOLATION, libgit2 path-resolution fallback, verbatim
+ # path handling) actually run — the test matrix above never compiles
+ # them. Observability only for now (`continue-on-error`): a Windows
+ # runner-environment quirk must not block Linux/macOS merges, but the
+ # results are visible on every push so Windows-only breakage is caught
+ # in review instead of by end users.
+ test-windows:
+ name: test (windows-latest, non-gating)
+ runs-on: windows-latest
+ continue-on-error: true
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dtolnay/rust-toolchain@stable
+ - uses: Swatinem/rust-cache@v2
+ - run: cargo test --workspace --all-targets
+ env:
+ TAILWIND_SKIP: "1"
+
# The companion importer is deliberately outside the root workspace
# (its own [workspace] in companions/ai-memory-importer/Cargo.toml), so
# none of the jobs above compile it. Gate it here with the same
diff --git a/crates/ai-memory-cli/src/commands/hook_spool.rs b/crates/ai-memory-cli/src/commands/hook_spool.rs
index a3fe82e5..9e857ed3 100644
--- a/crates/ai-memory-cli/src/commands/hook_spool.rs
+++ b/crates/ai-memory-cli/src/commands/hook_spool.rs
@@ -201,19 +201,19 @@ pub struct DrainLock {
_file: File,
}
+/// Windows can report a contended fs2 byte-range lock as this native OS code
+/// instead of mapping it to `WouldBlock`.
+#[cfg(windows)]
+const ERROR_LOCK_VIOLATION: i32 = 33;
+
fn is_drain_lock_busy_error(err: &std::io::Error) -> bool {
if err.kind() == std::io::ErrorKind::WouldBlock {
return true;
}
#[cfg(windows)]
- {
- // Windows can report a contended fs2 byte-range lock as the native
- // ERROR_LOCK_VIOLATION code instead of mapping it to WouldBlock.
- const ERROR_LOCK_VIOLATION: i32 = 33;
- if err.raw_os_error() == Some(ERROR_LOCK_VIOLATION) {
- return true;
- }
+ if err.raw_os_error() == Some(ERROR_LOCK_VIOLATION) {
+ return true;
}
false
@@ -917,7 +917,6 @@ mod tests {
#[cfg(windows)]
#[test]
fn windows_lock_violation_error_is_lock_busy() {
- const ERROR_LOCK_VIOLATION: i32 = 33;
let err = std::io::Error::from_raw_os_error(ERROR_LOCK_VIOLATION);
assert!(is_drain_lock_busy_error(&err));
}