fix: skip error-tracking capture for expected matched aborts#742
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix: skip error-tracking capture for expected matched aborts#742posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
A matched AbortCase (e.g. declining the GitHub connection in self-driving) is a deliberate, well-handled exit that already emits a distinct `agent aborted` product event. wizardAbort still reported it to error tracking via analytics.captureException, minting a spurious issue for every real declined connection. Add a `captureError` flag (default true) to wizardAbort and set it to `!matched` in the linear runner's ABORT branch, so matched aborts skip exception capture while the generic/unmatched abort and genuine faults still report. Generated-By: PostHog Code Task-Id: 7a9e916e-33bf-4ed3-968b-91d67e471235
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user declines the required GitHub connection during the new
self-drivingprogram, the wizard shipsWizardError: Agent aborted: github connection declinedto error tracking as an exception. This is a deliberate, well-handled exit — a matchedAbortCasethat already renders a friendly "GitHub connection required" outro, not a crash.The root cause is in
wizardAbort(src/utils/wizard-abort.ts): it unconditionally callsanalytics.captureExceptionwhenever anerroris passed, and every matched abort in the linear runner funnels through it. The same path already emits a distinctwizardCapture('agent aborted')product event, so the exception is redundant — it mints a fresh spurious error-tracking issue for the wizard team on every real declined connection as self-driving rolls out.Changes
captureErrorflag (defaulttrue) towizardAbort's options. Whenfalse, the exception is suppressed but everything else (cleanup, shutdown, outro, exit) is unchanged.ABORTbranch, passcaptureError: !matched. Expected, matchedAbortCases (declined GitHub, requires-interactive-mode, not-available-for-project) skip exception capture and keep only thewizardCapture('agent aborted')analytics event; the generic/unmatched abort branch and genuine faults still report to error tracking.Test plan
captureError: false(suppresses capture, still shuts down) andcaptureError: true(captures).pnpm build && pnpm test— 1013 tests pass.pnpm fix— clean.Created with PostHog Code from an inbox report.