feat(plugin): add PostHog tracking to plugin initialization

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-10 15:53:05 +09:00
parent 785d6e2dee
commit 150dd1c89b
+11
View File
@@ -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)
}