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

refactor: remove dead realtime WebSocket references from frontend

Louis Beaumontd0b2d298c1c5
diff --git a/apps/screenpipe-app-tauri/components/cli-command-dialog.tsx b/apps/screenpipe-app-tauri/components/cli-command-dialog.tsx
index 2fd1c9e89..df263057f 100644
--- a/apps/screenpipe-app-tauri/components/cli-command-dialog.tsx
+++ b/apps/screenpipe-app-tauri/components/cli-command-dialog.tsx
@@ -59,25 +59,16 @@ export function CliCommandDialog({ settings }: CliCommandDialogProps) {
envVars.push(
`SET DEEPGRAM_API_URL=https://api.screenpi.pe/v1/listen`
);
- envVars.push(
- `SET DEEPGRAM_WEBSOCKET_URL=wss://api.screenpi.pe`
- );
envVars.push(`SET CUSTOM_DEEPGRAM_API_TOKEN=${settings.userId}`);
} else if (shell === "powershell") {
envVars.push(
`$env:DEEPGRAM_API_URL="https://api.screenpi.pe/v1/listen"`
);
- envVars.push(
- `$env:DEEPGRAM_WEBSOCKET_URL="wss://api.screenpi.pe"`
- );
envVars.push(`$env:CUSTOM_DEEPGRAM_API_TOKEN="${settings.userId}"`);
} else {
envVars.push(
`DEEPGRAM_API_URL="https://api.screenpi.pe/v1/listen"`
);
- envVars.push(
- `DEEPGRAM_WEBSOCKET_URL="wss://api.screenpi.pe"`
- );
envVars.push(`CUSTOM_DEEPGRAM_API_TOKEN="${settings.userId}"`);
}
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 13d36bd23..fcc7eea33 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -280,7 +280,6 @@ let DEFAULT_SETTINGS: Settings = {
showChatShortcut: "Control+Super+L",
searchShortcut: "Control+Super+K",
lockVaultShortcut: "Super+Shift+L",
- realtimeAudioTranscriptionEngine: "whisper-large-v3-turbo",
disableVision: false,
disableOcr: false,
useAllMonitors: true,
diff --git a/apps/screenpipe-app-tauri/lib/utils/validation.ts b/apps/screenpipe-app-tauri/lib/utils/validation.ts
index 3255a546f..0f857e13e 100644
--- a/apps/screenpipe-app-tauri/lib/utils/validation.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/validation.ts
@@ -63,7 +63,6 @@ export const settingsStoreSchema = z.object({
// Audio Settings
audioTranscriptionEngine: z.string().min(1, "Audio transcription engine is required"),
- realtimeAudioTranscriptionEngine: z.string(),
audioDevices: z.array(z.string()),
disableAudio: z.boolean(),
languages: z.array(z.string()),
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index ed0d055a8..fb813ca39 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -158,8 +158,6 @@ pub struct SettingsStore {
pub search_shortcut: String,
#[serde(rename = "lockVaultShortcut", default)]
pub lock_vault_shortcut: String,
- #[serde(rename = "realtimeAudioTranscriptionEngine")]
- pub realtime_audio_transcription_engine: String,
/// When true, screen capture continues but OCR text extraction is skipped.
/// Reduces CPU usage significantly while still recording video.
#[serde(rename = "disableOcr", default)]
@@ -480,7 +478,6 @@ impl Default for SettingsStore {
lock_vault_shortcut: "Ctrl+Shift+L".to_string(),
#[cfg(not(target_os = "windows"))]
lock_vault_shortcut: "Super+Shift+L".to_string(),
- realtime_audio_transcription_engine: "deepgram".to_string(),
disable_ocr: false,
show_shortcut_overlay: true,
device_id: uuid::Uuid::new_v4().to_string(),
diff --git a/packages/ai-gateway/src/handlers/transcription.ts b/packages/ai-gateway/src/handlers/transcription.ts
index a6fabc9d3..58df28a5c 100644
--- a/packages/ai-gateway/src/handlers/transcription.ts
+++ b/packages/ai-gateway/src/handlers/transcription.ts
@@ -1,5 +1,4 @@
import { Env } from '../types';
-import { createClient, LiveTranscriptionEvents } from '@deepgram/sdk';
import { createSuccessResponse, createErrorResponse } from '../utils/cors';
import { VertexAIProvider } from '../providers/vertex';
@@ -339,70 +338,3 @@ async function handleChirp2Transcription(request: Request, env: Env): Promise<Re
}
}
-/**
- * Handles WebSocket upgrade for real-time transcription
- * @param request The HTTP request for WebSocket upgrade
- * @param env Environment variables
- * @returns Response with WebSocket connection
- */
-export async function handleWebSocketUpgrade(request: Request, env: Env): Promise<Response> {
- try {
- const requestId = crypto.randomUUID();
-
- const webSocketPair = new WebSocketPair();
- const [client, server] = Object.values(webSocketPair);
- server.accept();
-
- let params = new URL(request.url).searchParams;
- let url = new URL('wss://api.deepgram.com/v1/listen');
-
- for (let [key, value] of params.entries()) {
- url.searchParams.set(key, value);
- }
-
- let deepgram = createClient(env.DEEPGRAM_API_KEY);
- let deepgramSocket = deepgram.listen.live({}, url.toString());
-
- deepgramSocket.on(LiveTranscriptionEvents.Open, () => {
- server.send(
- JSON.stringify({
- type: 'connected',
- message: 'WebSocket connection established',
- })
- );
- });
-
- server.addEventListener('message', (event) => {
- if (deepgramSocket.getReadyState() === WebSocket.OPEN) {
- deepgramSocket.send(event.data);
- }
- });
-
- deepgramSocket.on(LiveTranscriptionEvents.Transcript, (data) => {
- if (server.readyState === WebSocket.OPEN) {
- server.send(JSON.stringify(data));
- }
- });
-
- server.addEventListener('close', () => {
- deepgramSocket.requestClose();
- });
-
- deepgramSocket.on(LiveTranscriptionEvents.Error, (error) => {
- if (server.readyState === WebSocket.OPEN) {
- server.close(1011, 'Deepgram error: ' + error.message);
- }
- });
-
- return new Response(null, {
- status: 101,
- webSocket: client,
- headers: {
- 'dg-request-id': requestId,
- },
- });
- } catch (error) {
- console.error('WebSocket upgrade failed:', error);
- return createErrorResponse(500, 'WebSocket upgrade failed');
- }
-}
\ No newline at end of file