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
feat: add posthog tracking for chat_opened and chat_message_sent
Louis Beaumontf8d0f4d6155e
diff --git a/screenpipe-app-tauri/components/global-chat.tsx b/screenpipe-app-tauri/components/global-chat.tsxindex cc9b98364..ad77863e8 100644--- a/screenpipe-app-tauri/components/global-chat.tsx+++ b/screenpipe-app-tauri/components/global-chat.tsx@@ -28,6 +28,7 @@ import { usePlatform } from "@/lib/hooks/use-platform";import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";import { useSqlAutocomplete } from "@/lib/hooks/use-sql-autocomplete";import { commands, OpencodeInfo } from "@/lib/utils/tauri";+import posthog from "posthog-js";import { UpgradeDialog } from "@/components/upgrade-dialog";import { createOpencodeClient } from "@opencode-ai/sdk/v2/client";@@ -1203,6 +1204,7 @@ export function GlobalChat() {// Focus input when opening, reset state when closinguseEffect(() => {if (open) {+ posthog.capture("chat_opened");setTimeout(() => inputRef.current?.focus(), 100);} else {// Reset chat state when dialog closes@@ -1488,6 +1490,14 @@ export function GlobalChat() {async function sendMessage(userMessage: string) {if (!canChat || !activePreset) return;+ // Track chat message+ posthog.capture("chat_message_sent", {+ message_length: userMessage.length,+ provider: activePreset?.provider,+ model: activePreset?.model,+ is_opencode: isOpencode,+ });+// Use OpenCode if that's the active providerif (isOpencode) {return sendOpencodeMessage(userMessage);