fix(telemetry): isolate plugin telemetry failures

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-11 21:25:26 +09:00
parent e4bb60ba07
commit c09ee32fe9
2 changed files with 147 additions and 10 deletions
+18 -10
View File
@@ -41,16 +41,24 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
const posthog = createPluginPostHog()
const distinctId = getPostHogDistinctId()
posthog.trackActive(distinctId, "plugin_loaded")
posthog.capture({
distinctId,
event: "plugin_loaded",
properties: {
entry_point: "plugin",
has_openclaw: !!pluginConfig.openclaw,
tmux_enabled: isTmuxIntegrationEnabled(pluginConfig),
},
})
try {
posthog.trackActive(distinctId, "plugin_loaded")
} catch {
// telemetry failure is non-fatal, silently ignore
}
try {
posthog.capture({
distinctId,
event: "plugin_loaded",
properties: {
entry_point: "plugin",
has_openclaw: !!pluginConfig.openclaw,
tmux_enabled: isTmuxIntegrationEnabled(pluginConfig),
},
})
} catch {
// telemetry failure is non-fatal, silently ignore
}
if (pluginConfig.openclaw) {
await initializeOpenClaw(pluginConfig.openclaw)
}