From 150dd1c89b2b649b871fe838bc0acfae7e1159d7 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 10 Apr 2026 15:53:05 +0900 Subject: [PATCH] feat(plugin): add PostHog tracking to plugin initialization Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index f13faf1ec..d0c8050c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,7 @@ import { injectServerAuthIntoClient, log, logLegacyPluginStartupWarning } from " import { detectExternalSkillPlugin, getSkillPluginConflictWarning } from "./shared/external-plugin-detector" import { startBackgroundCheck as startTmuxCheck } from "./tools/interactive-bash" import { lspManager } from "./tools/lsp/client" +import { createPluginPostHog, getPostHogDistinctId } from "./shared/posthog" let activePluginDispose: PluginDispose | null = null @@ -37,6 +38,16 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await activePluginDispose?.() const pluginConfig = loadPluginConfig(ctx.directory, ctx) + + const posthog = createPluginPostHog() + posthog.capture({ + distinctId: getPostHogDistinctId(), + event: "plugin_loaded", + properties: { + has_openclaw: !!pluginConfig.openclaw, + tmux_enabled: isTmuxIntegrationEnabled(pluginConfig), + }, + }) if (pluginConfig.openclaw) { await initializeOpenClaw(pluginConfig.openclaw) }