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

chore: remove dead code and fix compiler warnings

Louis Beaumont35fe9ddb1bcd
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
index 0e909ea9d..331a8d8c9 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
@@ -268,9 +268,7 @@ pub struct PiManager {
child: Option<Child>,
stdin: Option<ChildStdin>,
project_dir: Option<String>,
- request_id: u64,
app_handle: AppHandle,
- /// Tracks last activity (creation or send_command)
last_activity: std::time::Instant,
/// Guard: ensures only one `pi_terminated` event is emitted per session.
terminated_emitted: Arc<AtomicBool>,
@@ -291,7 +289,6 @@ impl PiManager {
child: None,
stdin: None,
project_dir: None,
- request_id: 0,
app_handle,
last_activity: std::time::Instant::now(),
terminated_emitted: Arc::new(AtomicBool::new(false)),
@@ -375,73 +372,6 @@ impl PiManager {
self.check_alive()
}
- /// Send a command to Pi via stdin (fire-and-forget).
- /// Use this for commands like `prompt` where the result streams via events.
- pub fn send_command(&mut self, command: Value) -> Result<(), String> {
- self.send_command_inner(command).map(|_| ())
- }
-
- /// Send a command and wait for the Pi process to respond.
- /// Use this for commands like `abort` and `new_session` that must complete
- /// before the next command can be sent safely.
- pub fn send_command_and_wait(
- &mut self,
- command: Value,
- timeout: std::time::Duration,
- ) -> Result<oneshot::Receiver<RpcResponse>, String> {
- let req_id = self.send_command_inner(command)?;
- let (tx, rx) = oneshot::channel();
- self.pending_responses
- .lock()
- .unwrap()
- .insert(req_id, tx);
- // Caller awaits `rx` with a timeout
- let _ = timeout; // timeout is applied by the caller via tokio::time::timeout
- Ok(rx)
- }
-
- /// Shared implementation: stamps the command with an ID, writes to stdin.
- fn send_command_inner(&mut self, command: Value) -> Result<String, String> {
- if !self.check_alive() {
- return Err("Pi process has died".to_string());
- }
-
- self.last_activity = std::time::Instant::now();
- self.request_id += 1;
- let req_id = format!("req_{}", self.request_id);
-
- let mut cmd = command;
- if let Some(obj) = cmd.as_object_mut() {
- obj.insert("id".to_string(), json!(&req_id));
- }
-
- let cmd_str = serde_json::to_string(&cmd).map_err(|e| e.to_string())?;
- let child_pid = self.child.as_ref().map(|c| c.id());
- let cmd_type = cmd
- .get("type")
- .and_then(|t| t.as_str())
- .unwrap_or("?")
- .to_string();
-
- let stdin = self.stdin.as_mut().ok_or("Pi not running")?;
-
- info!(
- "Sending to Pi ({}): type={}, child_pid={:?}, bytes={}",
- req_id,
- cmd_type,
- child_pid,
- cmd_str.len() + 1
- );
-
- writeln!(stdin, "{}", cmd_str)
- .map_err(|e| format!("Failed to write to Pi stdin: {}", e))?;
- stdin
- .flush()
- .map_err(|e| format!("Failed to flush Pi stdin: {}", e))?;
- info!("Sent to Pi ({}): flushed ok", req_id);
-
- Ok(req_id)
- }
}
/// Get the Pi config directory (~/.pi/agent)
@@ -1623,34 +1553,6 @@ pub async fn pi_new_session(
rx.await.map_err(|_| "Pi command queue dropped".to_string())?
}
-/// Timeout for RPC responses that must complete before the next command.
-const RPC_RESPONSE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(30);
-
-/// Await an RPC response with a timeout. Returns Ok(()) on success or the error from Pi.
-async fn await_rpc_response(
- rx: oneshot::Receiver<RpcResponse>,
- command_name: &str,
-) -> Result<(), String> {
- match tokio::time::timeout(RPC_RESPONSE_TIMEOUT, rx).await {
- Ok(Ok(resp)) => {
- if resp.success == Some(true) {
- Ok(())
- } else {
- Err(resp.error.unwrap_or_else(|| format!("{} failed", command_name)))
- }
- }
- Ok(Err(_)) => {
- // Channel dropped — process likely died
- Err(format!("Pi process died while waiting for {} response", command_name))
- }
- Err(_) => {
- warn!("Timed out waiting for Pi {} response", command_name);
- // Don't error — the command was sent, Pi may still process it
- Ok(())
- }
- }
-}
-
/// Check if pi is available
#[tauri::command]
#[specta::specta]
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi_command_queue.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi_command_queue.rs
index f3420ac23..da60449df 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/pi_command_queue.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi_command_queue.rs
@@ -48,15 +48,6 @@ pub enum WaitMode {
WaitDone,
}
-/// Signals from the stdout reader to the queue drain loop.
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum SdkSignal {
- /// The SDK's agent loop completed (received `done` event).
- Done,
- /// The SDK process terminated (stdout EOF).
- Terminated,
-}
-
/// Handle to submit commands to the queue.
#[derive(Clone)]
pub struct PiQueueHandle {
diff --git a/crates/screenpipe-audio/src/core/run_record_and_transcribe.rs b/crates/screenpipe-audio/src/core/run_record_and_transcribe.rs
index 20b77a50a..69e8e766e 100644
--- a/crates/screenpipe-audio/src/core/run_record_and_transcribe.rs
+++ b/crates/screenpipe-audio/src/core/run_record_and_transcribe.rs
@@ -15,7 +15,7 @@ use tokio::sync::broadcast;
use tracing::{debug, error, info, warn};
use crate::{
- core::{device::DeviceType, update_device_capture_time},
+ core::update_device_capture_time,
metrics::AudioPipelineMetrics,
AudioInput,
};
diff --git a/crates/screenpipe-db/src/db.rs b/crates/screenpipe-db/src/db.rs
index 2f5eb768a..33b22f7fc 100644
--- a/crates/screenpipe-db/src/db.rs
+++ b/crates/screenpipe-db/src/db.rs
@@ -717,14 +717,13 @@ impl DatabaseManager {
/// Execute a pipe UPDATE/INSERT/DELETE via the write queue.
pub async fn pipe_execute_write_queued(
&self,
- id: i64,
+ _id: i64,
sql: &str,
binds: Vec<crate::write_queue::PipeBindValue>,
) -> Result<(), sqlx::Error> {
use crate::write_queue::WriteOp;
self.write_queue
.submit(WriteOp::PipeUpdateExecution {
- id,
sql: sql.to_string(),
binds,
})
diff --git a/crates/screenpipe-db/src/write_queue.rs b/crates/screenpipe-db/src/write_queue.rs
index 8ded5df12..5723bd929 100644
--- a/crates/screenpipe-db/src/write_queue.rs
+++ b/crates/screenpipe-db/src/write_queue.rs
@@ -158,7 +158,6 @@ pub(crate) enum WriteOp {
started_at: String,
},
PipeUpdateExecution {
- id: i64,
sql: String,
binds: Vec<PipeBindValue>,
},
@@ -1093,7 +1092,7 @@ async fn execute_single_write(
Ok(WriteResult::Id(row))
}
- WriteOp::PipeUpdateExecution { id: _, sql, binds } => {
+ WriteOp::PipeUpdateExecution { sql, binds } => {
let mut query = sqlx::query(&sql);
for bind in binds {
match bind {
diff --git a/crates/screenpipe-engine/src/meeting_detector.rs b/crates/screenpipe-engine/src/meeting_detector.rs
index 4d092aa63..5b6249cf4 100644
--- a/crates/screenpipe-engine/src/meeting_detector.rs
+++ b/crates/screenpipe-engine/src/meeting_detector.rs
@@ -680,6 +680,7 @@ impl PrecomputedSignal {
/// `title` and `desc` are expected to be raw (not lowercased) for the original
/// `check_signal_match` entry point. For the optimized hot path, use
/// `check_signal_match_precomputed` with pre-lowercased values.
+#[cfg(any(target_os = "windows", test))]
fn check_signal_match(
signal: &CallSignal,
role: &str,