-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(telemetry): add PostHog exception tracking for consecutive mistake errors #10193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ke errors Add structured exception tracking via PostHog for 'Roo is having trouble' events: - Add ConsecutiveMistakeError class with reason field (no_tools_used, tool_repetition, unknown) - Add type guard isConsecutiveMistakeError() and property extractor - Update PostHogTelemetryClient.captureException() to auto-extract properties - Track consecutive mistake limit reached in Task.ts with 'no_tools_used' reason - Track tool repetition limit in presentAssistantMessage.ts with 'tool_repetition' reason - Add comprehensive tests (69 tests pass)
Review completed. No new issues found. The changes add Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
- Add ConsecutiveMistakeError class with provider and modelId tracking - Add type guard and property extraction for ConsecutiveMistakeError - Update PostHogTelemetryClient to handle ConsecutiveMistakeError - Track 'Roo is having trouble' events via captureException in Task.ts and presentAssistantMessage.ts - Include both telemetry event (captureConsecutiveMistakeError) and exception tracking - Add comprehensive tests for new error tracking functionality
Summary
Add structured exception tracking via PostHog for 'Roo is having trouble' events (consecutive mistake limit reached).
Changes
New Types (
packages/types/src/telemetry.ts)ConsecutiveMistakeReasontype:"no_tools_used" | "tool_repetition" | "unknown"ConsecutiveMistakeErrorclass with properties:taskId,consecutiveMistakeCount,consecutiveMistakeLimit,reasonisConsecutiveMistakeError()type guardextractConsecutiveMistakeErrorProperties()property extractorPostHog Integration (
packages/telemetry/src/PostHogTelemetryClient.ts)captureException()to detectConsecutiveMistakeErrorand auto-extract propertiesTracking Points
no_tools_used)tool_repetition)PostHog Event Data
When a consecutive mistake event fires, PostHog receives:
taskIdconsecutiveMistakeCountconsecutiveMistakeLimitreasonmessageappVersion,apiProvider,modelId, etc.Testing
Important
Introduces
ConsecutiveMistakeErrorfor tracking consecutive mistake errors via PostHog, with updates to telemetry handling and comprehensive tests.ConsecutiveMistakeErrorclass intelemetry.tsfor tracking consecutive mistake errors.captureException()inPostHogTelemetryClient.tsto handleConsecutiveMistakeError.Task.tswhen no tools are used and inpresentAssistantMessage.tsfor tool repetition.ConsecutiveMistakeReasontype andisConsecutiveMistakeError()type guard intelemetry.ts.extractConsecutiveMistakeErrorProperties()intelemetry.ts.ConsecutiveMistakeErrorand related utilities intelemetry.test.ts.This description was created by
for 2ab2df5. You can customize this summary. It will automatically update as commits are pushed.