fix(telemetry): dedupe plugin_loaded event to once per UTC day
The plugin_loaded event was emitted on every plugin reload, generating high event volume on PostHog (proportional to opencode restarts per user per day). With MAU > 60K and active power users restarting frequently, this drove unnecessary event spend. Add a separate daily dedup state field (lastPluginLoadedDayUTC) so the plugin_loaded capture only fires once per UTC day per machine. The existing daily activity dedup (lastActiveDayUTC, used by omo_daily_active) is preserved as an independent gate so the two dimensions cannot overwrite each other in the activity state file.
This commit is contained in:
@@ -104,6 +104,12 @@ function installModuleMocks(): void {
|
||||
createPluginPostHog: mockCreatePluginPostHog,
|
||||
getPostHogDistinctId: mockGetPostHogDistinctId,
|
||||
}))
|
||||
mock.module("./shared/posthog-activity-state", () => ({
|
||||
getPluginLoadedCaptureState: () => ({
|
||||
dayUTC: "2026-04-18",
|
||||
capturePluginLoaded: true,
|
||||
}),
|
||||
}))
|
||||
}
|
||||
|
||||
describe("oh-my-openagent telemetry isolation", () => {
|
||||
|
||||
Reference in New Issue
Block a user