Skip to content

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

fix: remove whisper logging hook to prevent double panic on app restart

Louis Beaumont0dbaf800add9
diff --git a/crates/screenpipe-audio/src/transcription/engine.rs b/crates/screenpipe-audio/src/transcription/engine.rs
index fa4e14e81..2b2930741 100644
--- a/crates/screenpipe-audio/src/transcription/engine.rs
+++ b/crates/screenpipe-audio/src/transcription/engine.rs
@@ -138,7 +138,13 @@ impl TranscriptionEngine {
.map_err(|e| anyhow!("failed to load whisper model: {}", e))?;
info!("whisper model loaded successfully");
- whisper_rs::install_logging_hooks();
+ // NOTE: do NOT call whisper_rs::install_logging_hooks() here.
+ // It redirects ggml/whisper logs into Rust's tracing subscriber via
+ // a global FFI callback. During app restart (process::exit), C++ static
+ // destructors free Metal GPU resources and try to log via this hook —
+ // but the tracing subscriber's thread-local storage is already torn down,
+ // causing a double panic → abort. Without the hook, ggml logs go to
+ // stderr harmlessly.
Ok(Self::Whisper {
context,