Add anonymous PostHog telemetry for provider lifecycle events

- introduce `AnalyticsService` with buffered PostHog batch flush
- add hashed telemetry identifier from Codex account id or anonymous local id
- record provider session/turn lifecycle events and flush on stop-all
- wire telemetry layer into server runtime and update tests with no-op analytics
This commit is contained in:
Julius Marminge authored and Julius Marminge committed 2026-03-05 23:40:49 -08:00
1 parent 8c5b8d3b72
commit ec3778bbf4
12 files changed
+337 -7

No files matched your search

+3 -1
View File
@@ -71,6 +71,7 @@ import {
resolveAttachmentPathById,
} from "./attachmentStore.ts";
import { parseBase64DataUrl } from "./imageMime.ts";
import { AnalyticsService } from "./telemetry/Services/AnalyticsService.ts";
/**
* ServerShape - Service API for server lifecycle control.
@@ -207,7 +208,8 @@ export type ServerRuntimeServices =
| GitCore
| TerminalManager
| Keybindings
| Open;
| Open
| AnalyticsService;
export class ServerLifecycleError extends Schema.TaggedErrorClass<ServerLifecycleError>()(
"ServerLifecycleError",