Skip to content

feat(cursor): PostHog error → Cursor autofix automation - #2753

Open
riderx wants to merge 2 commits into
mainfrom
cursor/posthog-error-autofix-5373
Open

feat(cursor): PostHog error → Cursor autofix automation#2753
riderx wants to merge 2 commits into
mainfrom
cursor/posthog-error-autofix-5373

Conversation

@riderx

@riderx riderx commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Adds .cursor/automations/posthog-error-autofix.md with:
    • One-time setup for a Cursor Webhook automation + PostHog Error Tracking alert
    • Ready-to-paste agent prompt that investigates new/reopened PostHog issues
    • Hard gates so the agent only opens a draft PR for high-confidence, easy fixes

Motivation (AI generated)

Cursor has no native PostHog trigger (Sentry exists; PostHog must use webhooks). We want new production errors to spawn a cloud agent that attempts a safe autofix without burning budget on every $exception event or opening speculative PRs.

Business Impact (AI generated)

Faster triage of new console/CLI/backend errors with less human toil. Easy bugs can land as draft PRs automatically; hard bugs stay investigation-only so agent spend stays bounded.

Test Plan (AI generated)

  • Create Cursor Automation (Webhook) at cursor.com/automations using the prompt in .cursor/automations/posthog-error-autofix.md
  • Point PostHog Error Tracking → Alerting → HTTP Webhook at the automation URL (issue created/reopened only)
  • Run PostHog Test function and confirm an agent run appears at cursor.com/agents
  • Confirm easy synthetic bugs can produce a draft PR; low-confidence cases produce no PR

Manual wiring (required after merge)

This PR only versions the prompt. Activate the loop in two UIs:

  1. CursorAutomations → Webhook trigger → repo cap-go/capgo.app → paste Agent prompt → enable PR tool
  2. PostHog (EU) → Error Tracking → Alerting → HTTP Webhook on issue created or reopened → Cursor webhook URL + API key

Do not use a PostHog real-time destination on every $exception.

Generated with AI

Open in Web Open in Cursor 

Review in cubic

Version-control the webhook automation prompt and setup checklist for
PostHog Error Tracking → Cursor Cloud Agent → draft PR on easy fixes.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 825cae66-9b39-44c9-a395-e248069e944e

📥 Commits

Reviewing files that changed from the base of the PR and between 0143e16 and 0ee36b6.

📒 Files selected for processing (1)
  • .cursor/automations/posthog-error-autofix.md

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing cursor/posthog-error-autofix-5373 (0ee36b6) with main (0143e16)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cursor
cursor Bot marked this pull request as ready for review July 24, 2026 13:51
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_59731813-8c76-479c-9464-e708c6281eed)

@cursor
cursor Bot requested review from Dalanir and WcaleNieWolny July 24, 2026 13:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: low. Not approving because Cursor Bugbot did not complete successfully (check skipped due to usage limit). Human review is needed before merge; reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Cursor Bugbot skipped (usage limit reached), so automated review did not complete successfully; not approving. Human review is needed for this automation documentation.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .cursor/automations/posthog-error-autofix.md Outdated
Comment thread .cursor/automations/posthog-error-autofix.md Outdated
Treat webhook fields as untrusted data only, and clarify PostHog
Authorization Bearer header setup for the Cursor webhook API key.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@cursor
cursor Bot temporarily deployed to deepsec-pr July 24, 2026 14:01 Inactive
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5a7e6d71-04aa-4c9d-be21-1d7d4f000346)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Cursor Bugbot did not complete successfully (skipped due to usage limit), so I am not approving. Human review is still needed; reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Not approving because Cursor Bugbot did not complete successfully (check skipped due to usage limit). Human review is still needed before merge; Dalanir and WcaleNieWolny are already assigned as reviewers.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants