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: add verbose stdout reader logging to diagnose Pi chat hang

Louis Beaumont232c2ac2f12d
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
index 7f3e06889..0124f4af1 100644
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "2.0.463"
+version = "2.0.464"
description = "24/7 memory for your desktop. 100% local."
authors = ["you"]
license = ""
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
index 7749062ef..541cccd4f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
@@ -687,10 +687,18 @@ pub async fn pi_start_inner(
let app_handle = app.clone();
std::thread::spawn(move || {
let reader = BufReader::new(stdout);
- info!("Pi stdout reader started");
+ info!("Pi stdout reader started (pid: {})", pid);
+ let mut line_count = 0u64;
for line in reader.lines() {
match line {
Ok(line) => {
+ line_count += 1;
+ let event_type = serde_json::from_str::<Value>(&line)
+ .ok()
+ .and_then(|v| v.get("type").and_then(|t| t.as_str()).map(|s| s.to_string()));
+ info!("Pi stdout #{} (pid {}): type={}", line_count, pid,
+ event_type.as_deref().unwrap_or("non-json"));
+
// Try to parse as JSON and emit event
match serde_json::from_str::<Value>(&line) {
Ok(event) => {
@@ -712,7 +720,7 @@ pub async fn pi_start_inner(
}
}
}
- info!("Pi stdout reader ended (pid: {})", pid);
+ info!("Pi stdout reader ended (pid: {}), processed {} lines", pid, line_count);
let _ = app_handle.emit("pi_terminated", pid);
});