diff --git a/src/cli/run/runner.telemetry.test.ts b/src/cli/run/runner.telemetry.test.ts index 3d4b5193b..26e700b10 100644 --- a/src/cli/run/runner.telemetry.test.ts +++ b/src/cli/run/runner.telemetry.test.ts @@ -64,8 +64,6 @@ describe("run telemetry isolation", () => { trackActive: () => { throw new Error("telemetry failed") }, - capture: mock(() => {}), - captureException: mock(() => {}), shutdown: mock(async () => { throw new Error("shutdown failed") }), diff --git a/src/cli/run/runner.ts b/src/cli/run/runner.ts index d6b52a299..75e6e49da 100644 --- a/src/cli/run/runner.ts +++ b/src/cli/run/runner.ts @@ -58,20 +58,6 @@ export async function run(options: RunOptions): Promise { } catch { // telemetry failure is non-fatal, silently ignore } - try { - posthog.capture({ - distinctId, - event: "run_started", - properties: { - command: "run", - agent: resolvedAgent, - has_model: !!options.model, - has_session_id: !!options.sessionId, - }, - }) - } catch { - // telemetry failure is non-fatal, silently ignore - } try { const resolvedModel = resolveRunModel(options.model) @@ -164,38 +150,6 @@ export async function run(options: RunOptions): Promise { }) } - if (exitCode === 0) { - try { - posthog.capture({ - distinctId, - event: "run_completed", - properties: { - command: "run", - agent: resolvedAgent, - duration_ms: durationMs, - message_count: eventState.messageCount, - }, - }) - } catch { - // telemetry failure is non-fatal, silently ignore - } - } else if (exitCode === 1) { - try { - posthog.capture({ - distinctId, - event: "run_failed", - properties: { - command: "run", - agent: resolvedAgent, - exit_code: exitCode, - duration_ms: durationMs, - }, - }) - } catch { - // telemetry failure is non-fatal, silently ignore - } - } - return exitCode } catch (err) { cleanup() @@ -210,25 +164,6 @@ export async function run(options: RunOptions): Promise { if (err instanceof Error && err.name === "AbortError") { return 130 } - try { - posthog.captureException(err, distinctId) - } catch { - // telemetry failure is non-fatal, silently ignore - } - try { - posthog.capture({ - distinctId, - event: "run_failed", - properties: { - command: "run", - agent: resolvedAgent, - error: serializeError(err), - duration_ms: Date.now() - startTime, - }, - }) - } catch { - // telemetry failure is non-fatal, silently ignore - } console.error(pc.red(`Error: ${serializeError(err)}`)) return 1 } finally {