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: commit remaining local changes from parallel agents

Louis Beaumont0e9dc90355b8
diff --git a/.claude/agents/sentry.md b/.claude/agents/sentry.md
index d57bb15fa..a7f59b750 100644
--- a/.claude/agents/sentry.md
+++ b/.claude/agents/sentry.md
@@ -8,6 +8,23 @@ tools: Bash, Read
Query Sentry issues for Screenpipe applications.
+## IMPORTANT: Always Include Version Context
+
+Before reporting issues, **always check the current released versions**:
+
+```bash
+echo "App:" && grep '^version' /Users/louisbeaumont/Documents/screenpipe/apps/screenpipe-app-tauri/src-tauri/Cargo.toml | head -1
+echo "CLI:" && grep '^version' /Users/louisbeaumont/Documents/screenpipe/Cargo.toml | head -1
+```
+
+For every issue you report, you **MUST**:
+1. Extract the **app/CLI version from the issue's tags** (look for `release`, `version`, or `app_version` tags in the latest event)
+2. Compare it against the **current released version**
+3. Include this in your output, e.g.: `Last seen on: v2.0.465 (current: v2.0.470 — may be outdated)`
+4. If an issue only has events from old versions (3+ versions behind), flag it as **"possibly fixed in newer versions"**
+
+This prevents wasting time investigating issues that have already been fixed in recent releases.
+
## Configuration
**Org:** `mediar`
@@ -137,7 +154,12 @@ print(f'Event: {r.get(\"eventID\", \"?\")}')
print(f'Message: {r.get(\"message\", r.get(\"title\", \"?\"))}')
print(f'Timestamp: {r.get(\"dateCreated\", \"?\")}')
print()
-print('Tags:')
+print('Version/Release:')
+for t in r.get('tags', []):
+ if t['key'] in ('release', 'version', 'app_version', 'os', 'os.name'):
+ print(f' {t[\"key\"]}: {t[\"value\"]}')
+print()
+print('All Tags:')
for t in r.get('tags', []):
print(f' {t[\"key\"]}: {t[\"value\"]}')
print()
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index 0899d79ef..52bf46615 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -512,6 +512,16 @@ export function PipesSection() {
<p className="text-sm text-muted-foreground">
scheduled agents that run on your screen data
{" · "}
+ <a
+ href="https://screenpi.pe/pipes"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center gap-1 underline underline-offset-2 hover:text-foreground transition-colors"
+ >
+ pipe store
+ <ExternalLink className="h-3 w-3" />
+ </a>
+ {" · "}
<a
href="https://docs.screenpi.pe/pipes"
target="_blank"
diff --git a/crates/screenpipe-accessibility/src/config.rs b/crates/screenpipe-accessibility/src/config.rs
index 94a7f77cb..982aa7759 100644
--- a/crates/screenpipe-accessibility/src/config.rs
+++ b/crates/screenpipe-accessibility/src/config.rs
@@ -88,7 +88,7 @@ impl Default for UiCaptureConfig {
capture_app_switch: true,
capture_window_focus: true,
capture_clipboard: true,
- capture_clipboard_content: false, // Privacy risk
+ capture_clipboard_content: true,
capture_context: true,
capture_mouse_move: false, // High volume
mouse_move_threshold: 5.0,
@@ -242,7 +242,7 @@ mod tests {
assert!(config.enabled);
assert!(config.capture_clicks);
assert!(!config.capture_keystrokes); // Should be off by default
- assert!(!config.capture_clipboard_content); // Should be off by default
+ assert!(config.capture_clipboard_content); // On by default
}
#[test]
diff --git a/crates/screenpipe-db/src/db.rs b/crates/screenpipe-db/src/db.rs
index a1060c57e..2aae02676 100644
--- a/crates/screenpipe-db/src/db.rs
+++ b/crates/screenpipe-db/src/db.rs
@@ -4044,6 +4044,40 @@ LIMIT ? OFFSET ?
Ok(rows.into_iter().map(UiEventRecord::from).collect())
}
+
+ /// Spawn a background task that runs `PRAGMA wal_checkpoint(TRUNCATE)` every 5 minutes.
+ /// This prevents unbounded WAL growth when long-running readers block auto-checkpoint.
+ pub fn start_wal_maintenance(&self) {
+ let pool = self.pool.clone();
+ tokio::spawn(async move {
+ let mut interval = tokio::time::interval(Duration::from_secs(300));
+ loop {
+ interval.tick().await;
+ match sqlx::query("PRAGMA wal_checkpoint(TRUNCATE)")
+ .fetch_one(&pool)
+ .await
+ {
+ Ok(row) => {
+ let busy: i32 = row.get(0);
+ let log_pages: i32 = row.get(1);
+ let checkpointed: i32 = row.get(2);
+ if busy == 1 {
+ warn!(
+ "wal checkpoint: busy (could not truncate), {} pages in WAL",
+ log_pages
+ );
+ } else {
+ debug!(
+ "wal checkpoint: truncated, checkpointed {}/{} pages",
+ checkpointed, log_pages
+ );
+ }
+ }
+ Err(e) => warn!("wal checkpoint failed: {}", e),
+ }
+ }
+ });
+ }
}
pub fn find_matching_positions(blocks: &[OcrTextBlock], query: &str) -> Vec<TextPosition> {
diff --git a/crates/screenpipe-server/src/bin/screenpipe-server.rs b/crates/screenpipe-server/src/bin/screenpipe-server.rs
index 8efc8e69a..b5f515d72 100644
--- a/crates/screenpipe-server/src/bin/screenpipe-server.rs
+++ b/crates/screenpipe-server/src/bin/screenpipe-server.rs
@@ -241,6 +241,68 @@ fn setup_logging(local_data_dir: &PathBuf, cli: &Cli) -> anyhow::Result<WorkerGu
Ok(guard)
}
+/// Periodically scans the data directory for `.log` files and enforces a total size cap.
+/// Deletes oldest log files first until total size is under the limit.
+fn spawn_log_cleanup(data_dir: PathBuf) {
+ const MAX_TOTAL_LOG_BYTES: u64 = 200 * 1024 * 1024; // 200 MB
+ const CHECK_INTERVAL_SECS: u64 = 60;
+
+ tokio::spawn(async move {
+ let mut interval = tokio::time::interval(Duration::from_secs(CHECK_INTERVAL_SECS));
+ loop {
+ interval.tick().await;
+
+ let entries = match std::fs::read_dir(&data_dir) {
+ Ok(e) => e,
+ Err(e) => {
+ warn!("log cleanup: failed to read dir {}: {}", data_dir.display(), e);
+ continue;
+ }
+ };
+
+ let mut log_files: Vec<(PathBuf, u64, std::time::SystemTime)> = Vec::new();
+ for entry in entries.flatten() {
+ let path = entry.path();
+ if path.extension().and_then(|e| e.to_str()) == Some("log") {
+ if let Ok(meta) = entry.metadata() {
+ let modified = meta.modified().unwrap_or(std::time::UNIX_EPOCH);
+ log_files.push((path, meta.len(), modified));
+ }
+ }
+ }
+
+ // Sort oldest first
+ log_files.sort_by_key(|(_, _, modified)| *modified);
+
+ let total: u64 = log_files.iter().map(|(_, size, _)| size).sum();
+ if total <= MAX_TOTAL_LOG_BYTES {
+ continue;
+ }
+
+ let mut remaining = total;
+ for (path, size, _) in &log_files {
+ if remaining <= MAX_TOTAL_LOG_BYTES {
+ break;
+ }
+ match std::fs::remove_file(path) {
+ Ok(_) => {
+ info!("log cleanup: deleted {} ({} bytes)", path.display(), size);
+ remaining -= size;
+ }
+ Err(e) => {
+ warn!("log cleanup: failed to delete {}: {}", path.display(), e);
+ }
+ }
+ }
+
+ info!(
+ "log cleanup: total log size reduced from {} to {} bytes",
+ total, remaining
+ );
+ }
+ });
+}
+
#[tokio::main]
#[tracing::instrument]
async fn main() -> anyhow::Result<()> {
@@ -1236,6 +1298,12 @@ async fn main() -> anyhow::Result<()> {
// Start background FTS indexer (replaces synchronous INSERT triggers)
let _fts_handle = screenpipe_db::fts_indexer::start_fts_indexer(db.clone());
+ // Periodic WAL checkpoint to prevent unbounded WAL growth
+ db.start_wal_maintenance();
+
+ // Periodic log file cleanup to cap total log size at 200 MB
+ spawn_log_cleanup(local_data_dir.clone());
+
let server_future = server.start(cli.enable_frame_cache);
pin_mut!(server_future);
diff --git a/crates/screenpipe-server/src/ui_recorder.rs b/crates/screenpipe-server/src/ui_recorder.rs
index 1e2b9b9e7..3b1d67778 100644
--- a/crates/screenpipe-server/src/ui_recorder.rs
+++ b/crates/screenpipe-server/src/ui_recorder.rs
@@ -63,7 +63,7 @@ impl Default for UiRecorderConfig {
capture_text: true,
capture_keystrokes: false,
capture_clipboard: true,
- capture_clipboard_content: false,
+ capture_clipboard_content: true,
capture_app_switch: true,
capture_window_focus: true,
capture_context: true,