YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(release): repair Vulkan builds and isolate recovery tests (#7278)
Ezra Ellettea58e9260c01e
diff --git a/.github/scripts/release-workflows.test.ts b/.github/scripts/release-workflows.test.tsindex 590e6d092..fff794536 100644--- a/.github/scripts/release-workflows.test.ts+++ b/.github/scripts/release-workflows.test.ts@@ -4,9 +4,10 @@import { expect, test } from "bun:test";import { readFileSync } from "node:fs";import { join } from "node:path";+import { fileURLToPath } from "node:url";import { dispatchEnterprise, reportEnterprise } from "./enterprise-release.cjs";-const root = new URL("../../", import.meta.url).pathname;+const root = fileURLToPath(new URL("../../", import.meta.url));const readYaml = (path: string): any => Bun.YAML.parse(readFileSync(join(root, path), "utf8"));const app = readYaml(".github/workflows/release-app.yml");const enterprise = readYaml(".github/workflows/release-enterprise.yml");@@ -95,6 +96,18 @@ test("both Windows builds use the shared install action from the workflow revisiexpect(action.runs.steps[0].shell).toBe("pwsh");});+test("all Windows native dependency builds select the shared Ninja setup", () => {+ const appStep = app.jobs["publish-tauri"].steps.find((step: any) => step.name === "Configure Ninja for Windows native dependencies");+ expect(appStep.if).toBe("matrix.os_type == 'windows'");+ expect(appStep.run).toBe("./.github/scripts/setup-ninja-windows.ps1");++ const enterpriseStep = enterprise.jobs["release-enterprise-windows"].steps.find(+ (step: any) => step.name === "Configure Ninja for Windows native dependencies",+ );+ expect(enterpriseStep.run).toBe("./.github/scripts/setup-ninja-windows.ps1");+ expect(readFileSync(join(root, ".github/scripts/setup-ninja-windows.ps1"), "utf8")).toContain('"CMAKE_GENERATOR=Ninja"');+});+test("completion reports every platform even if one is failed or skipped", () => {const gate = enterprise.jobs["enterprise-complete"];expect(gate.if).toBe("always()");diff --git a/.github/scripts/setup-ninja-windows.ps1 b/.github/scripts/setup-ninja-windows.ps1new file mode 100644index 000000000..6351d9692--- /dev/null+++ b/.github/scripts/setup-ninja-windows.ps1@@ -0,0 +1,60 @@+# screenpipe — AI that knows everything you've seen, said, or heard+# https://screenpipe.com++[CmdletBinding()]+param(+ [string]$TargetDirectory = $env:CARGO_TARGET_DIR+)++$ErrorActionPreference = 'Stop'++$ninja = Get-Command ninja.exe -ErrorAction SilentlyContinue+if (-not $ninja) {+ $knownPaths = @('C:\Program Files\Ninja', 'C:\Tools\Ninja')+ $ninjaDirectory = $knownPaths |+ Where-Object { Test-Path -LiteralPath "$_\ninja.exe" } |+ Select-Object -First 1++ if (-not $ninjaDirectory) {+ if (Get-Command winget.exe -ErrorAction SilentlyContinue) {+ winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent+ $ninjaDirectory = $knownPaths |+ Where-Object { Test-Path -LiteralPath "$_\ninja.exe" } |+ Select-Object -First 1+ }++ if (-not $ninjaDirectory) {+ $archive = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'ninja-winarm64.zip' } else { 'ninja-win.zip' }+ $zip = Join-Path $env:RUNNER_TEMP $archive+ $ninjaDirectory = 'C:\Tools\Ninja'+ Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/latest/download/$archive" -OutFile $zip+ New-Item -ItemType Directory -Force -Path $ninjaDirectory | Out-Null+ Expand-Archive -LiteralPath $zip -DestinationPath $ninjaDirectory -Force+ }+ }++ $ninjaDirectory | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8+ $env:Path = "$ninjaDirectory;$env:Path"+ $ninja = Get-Command ninja.exe -ErrorAction Stop+}++"CMAKE_GENERATOR=Ninja" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8+$env:CMAKE_GENERATOR = 'Ninja'+Write-Host "Using Ninja $(& $ninja.Source --version) at $($ninja.Source)"++if ($TargetDirectory -and (Test-Path -LiteralPath $TargetDirectory)) {+ $targetRoot = (Get-Item -LiteralPath $TargetDirectory).FullName.TrimEnd('\')+ Get-ChildItem -LiteralPath $targetRoot -Filter CMakeCache.txt -File -Recurse -ErrorAction SilentlyContinue |+ ForEach-Object {+ $generator = Select-String -LiteralPath $_.FullName -Pattern '^CMAKE_GENERATOR:(?:INTERNAL|UNINITIALIZED)=(.+)$' |+ Select-Object -First 1+ if ($generator -and $generator.Matches[0].Groups[1].Value -ne 'Ninja') {+ $buildDirectory = (Get-Item -LiteralPath $_.Directory.FullName).FullName+ if (-not $buildDirectory.StartsWith("$targetRoot\", [StringComparison]::OrdinalIgnoreCase)) {+ throw "Refusing to remove CMake cache outside target directory: $buildDirectory"+ }+ Write-Host "Removing stale $($generator.Matches[0].Groups[1].Value) CMake build directory: $buildDirectory"+ Remove-Item -LiteralPath $buildDirectory -Recurse -Force+ }+ }+}diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.ymlindex 29ad25f0a..ebbd01921 100644--- a/.github/workflows/release-app.yml+++ b/.github/workflows/release-app.yml@@ -699,40 +699,10 @@ jobs:shell: pwshrun: ./.github/scripts/setup-vulkan-windows.ps1 -Architecture ${{ matrix.target == 'aarch64-pc-windows-msvc' && 'arm64' || 'x64' }} -InstallSdk- - name: Install Ninja (ARM64)- if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'+ - name: Configure Ninja for Windows native dependencies+ if: matrix.os_type == 'windows'shell: pwsh- run: |- # The windows-11-arm runner image pre-installs Ninja at C:\Tools\Ninja- # but winget is NOT on PATH by default - so blindly calling- # `winget install` fails with CommandNotFoundException and kills- # the build even though Ninja is already available. Check first,- # fall back to winget only if both the pre-installed path AND the- # winget CLI are present.- $paths = @("C:\Program Files\Ninja", "C:\Tools\Ninja")- $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1-- if (-not $found) {- Write-Host "Ninja not found in preinstalled paths, trying winget..."- if (Get-Command winget -ErrorAction SilentlyContinue) {- winget install Ninja-build.Ninja --accept-package-agreements --accept-source-agreements --silent- $found = $paths | Where-Object { Test-Path "$_\ninja.exe" } | Select-Object -First 1- } else {- Write-Host "winget unavailable on this runner - downloading Ninja release zip"- $zip = "$env:RUNNER_TEMP\ninja.zip"- Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-winarm64.zip" -OutFile $zip- $dest = "C:\Tools\Ninja"- New-Item -ItemType Directory -Force -Path $dest | Out-Null- Expand-Archive -Path $zip -DestinationPath $dest -Force- $found = $dest- }- }-- if (-not $found) { throw "Ninja not found and could not be installed" }- Write-Host "Using Ninja at: $found"- echo $found | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append- $env:Path = "$found;" + $env:Path- ninja --version+ run: ./.github/scripts/setup-ninja-windows.ps1- name: Verify Windows download supportif: matrix.os_type == 'windows'diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.ymlindex a9444883a..d8596cd13 100644--- a/.github/workflows/release-enterprise.yml+++ b/.github/workflows/release-enterprise.yml@@ -356,6 +356,10 @@ jobs:shell: pwshrun: ./.github/scripts/setup-vulkan-windows.ps1 -Architecture x64 -InstallSdk -StageRuntimeDirectory apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.24.2/lib+ - name: Configure Ninja for Windows native dependencies+ shell: pwsh+ run: ./.github/scripts/setup-ninja-windows.ps1+- name: Use enterprise configshell: bashrun: cp -p apps/screenpipe-app-tauri/src-tauri/tauri.enterprise.conf.json apps/screenpipe-app-tauri/src-tauri/tauri.conf.jsondiff --git a/Cargo.lock b/Cargo.lockindex 5587fc302..547ea6abf 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -12227,7 +12227,7 @@ dependencies = [[[package]]name = "whisper-rs"version = "0.16.0"-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"dependencies = ["libc","tracing",@@ -12237,7 +12237,7 @@ dependencies = [[[package]]name = "whisper-rs-sys"version = "0.15.0"-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"dependencies = ["bindgen 0.72.1","cfg-if",diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 4e0f33efa..91ddb4c5e 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -16410,7 +16410,7 @@ dependencies = [[[package]]name = "whisper-rs"version = "0.16.0"-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"dependencies = ["libc","tracing",@@ -16420,7 +16420,7 @@ dependencies = [[[package]]name = "whisper-rs-sys"version = "0.15.0"-source = "git+https://github.com/screenpipe/whisper-rs.git?rev=97e4070#97e40705033724dee601e89f3bd701af8096c846"+source = "git+https://github.com/EzraEllette/whisper-rs.git?rev=b649c3fccc8dcee4512c2778b049e64aa2d15978#b649c3fccc8dcee4512c2778b049e64aa2d15978"dependencies = ["bindgen 0.72.1","cfg-if 1.0.4",diff --git a/crates/screenpipe-audio/Cargo.toml b/crates/screenpipe-audio/Cargo.tomlindex 8738c7f0e..ee5f0e46d 100644--- a/crates/screenpipe-audio/Cargo.toml+++ b/crates/screenpipe-audio/Cargo.toml@@ -49,7 +49,7 @@ hf-hub = { workspace = true }# https://github.com/pdeljanov/Symphonia/tree/master?tab=readme-ov-file#optimizationssymphonia = { version = "0.5.4", features = ["aac", "isomp4", "opt-simd"] }rubato = "0.15.0"-whisper-rs = { git = "https://github.com/screenpipe/whisper-rs.git", rev = "97e4070", features = ["tracing_backend"] }+whisper-rs = { git = "https://github.com/EzraEllette/whisper-rs.git", rev = "b649c3fccc8dcee4512c2778b049e64aa2d15978", features = ["tracing_backend"] }# Loglog = { workspace = true }diff --git a/crates/screenpipe-audio/src/audio_manager/manager.rs b/crates/screenpipe-audio/src/audio_manager/manager.rsindex a313db1b3..7948579e2 100644--- a/crates/screenpipe-audio/src/audio_manager/manager.rs+++ b/crates/screenpipe-audio/src/audio_manager/manager.rs@@ -2663,6 +2663,9 @@ mod tests {#[tokio::test]async fn pending_cloud_audio_recovers_in_both_modes_after_failure_and_restart() {+ let _reconciliation = super::super::reconciliation::RECONCILIATION_TEST_LOCK+ .lock()+ .await;use crate::transcription::deepgram::DeepgramTranscriptionConfig;use crate::utils::ffmpeg::write_audio_to_file;use wiremock::{matchers::method, Mock, MockServer, ResponseTemplate};@@ -2768,6 +2771,7 @@ mod tests {.mount(&server).await;// Restart the worker against the same durable pending records.let worker = manager.start_reconciliation_handler().await;+ let cancellation = worker.abort_handle();*manager.reconciliation_handle.write().await = Some(worker);manager.reconciliation_wakeup.notify_one();tokio::time::timeout(Duration::from_secs(10), async {@@ -2797,6 +2801,13 @@ mod tests {.await.unwrap();manager.stop_internal().await.unwrap();+ tokio::time::timeout(Duration::from_secs(10), async {+ while !cancellation.is_finished() {+ tokio::task::yield_now().await;+ }+ })+ .await+ .expect("restarted recovery must stop before releasing the test lock");assert_eq!(db.count_audio_transcriptions(id).await.unwrap(), 1);assert_eq!(std::fs::read(&path).unwrap(), retained);assert!(fresh.exists());diff --git a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs b/crates/screenpipe-audio/src/audio_manager/reconciliation.rsindex e310fdf1f..d57a00114 100644--- a/crates/screenpipe-audio/src/audio_manager/reconciliation.rs+++ b/crates/screenpipe-audio/src/audio_manager/reconciliation.rs@@ -20,6 +20,11 @@ use tracing::{debug, error, info, warn};/// Global lock to prevent concurrent reconciliation runs (batch mode + background sweep)./// Two simultaneous Whisper sessions will use 200%+ CPU and starve the system.static RECONCILIATION_RUNNING: AtomicBool = AtomicBool::new(false);+// Independent test databases still share the production process-wide guard.+// Serialize tests that run sweeps so neither can skip the other's recovery.+#[cfg(test)]+pub(super) static RECONCILIATION_TEST_LOCK: tokio::sync::Mutex<()> =+ tokio::sync::Mutex::const_new(());static BACKFILL_IN_PROGRESS: AtomicBool = AtomicBool::new(false);static BACKFILL_LAST_TRIGGERED_MS: AtomicU64 = AtomicU64::new(0);@@ -1842,6 +1847,7 @@ mod tests {#[tokio::test]async fn disabled_runtime_keeps_pending_audio_even_when_an_engine_is_configured() {+ let _reconciliation = RECONCILIATION_TEST_LOCK.lock().await;let dir = tempfile::tempdir().unwrap();let db = temp_db(dir.path()).await;let path = dir.path().join("Mic (input)_2026-09-23_10-00-00.mp4");@@ -2411,6 +2417,7 @@ mod tests {#[tokio::test]async fn completed_batch_is_not_retranscribed_or_remerged_after_save_failure() {+ let _reconciliation = RECONCILIATION_TEST_LOCK.lock().await;let _ = tracing_subscriber::fmt().with_max_level(tracing::Level::WARN).with_test_writer()@@ -2990,6 +2997,7 @@ mod tests {#[tokio::test(flavor = "multi_thread", worker_threads = 4)]#[ignore = "real-model full reconciliation memory plateau regression"]async fn cached_parakeet_mlx_post_meeting_backlog_memory_plateaus() {+ let _reconciliation = RECONCILIATION_TEST_LOCK.lock().await;const MODEL_REPO: &str = "mlx-community/parakeet-tdt-0.6b-v3";const WARMUP_CALLS: usize = 4;// Mirrors the v2.5.151 incident: four immediately-drained capped sweeps