Skip to content

feat: adopt PostHog error tracking via captureException#346

Open
GLips wants to merge 1 commit intomainfrom
feat/posthog-error-tracking
Open

feat: adopt PostHog error tracking via captureException#346
GLips wants to merge 1 commit intomainfrom
feat/posthog-error-tracking

Conversation

@GLips
Copy link
Copy Markdown
Owner

@GLips GLips commented Apr 11, 2026

Summary

  • Sends $exception events via PostHog's captureException API when tool calls fail, enabling built-in issue grouping, stack traces, lifecycle management, and alerting
  • Passes domain metadata (error_phase, error_category, http_status, is_retryable, etc.) as additional properties so PostHog issues carry our context
  • Consolidates secret redaction into a single before_send hook covering both tool_called events and SDK-built $exception events — previously this was done inline in captureEvent
  • Keeps existing tool_called events unchanged for usage analytics; $exception fires in addition, not instead

Test plan

  • pnpm type-check passes
  • All pre-existing passing tests still pass (server/stdio transport test failures are pre-existing)
  • Deploy and verify $exception events appear in PostHog error tracking dashboard
  • Verify secrets are redacted in both tool_called and $exception events

Send $exception events alongside existing tool_called events when tool
calls fail. This gives us PostHog's built-in issue grouping, stack
traces, lifecycle management, and alerting — without losing our custom
domain metadata (error_phase, error_category, http_status, etc.).

Also consolidates secret redaction into a single before_send hook that
covers both regular events and SDK-built exception events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant