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:
+18
-10
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user