feat(seer): Detect Cursor GitHub access errors and return specific failure type#109692
Merged
isaacwang-sentry merged 10 commits intomasterfrom Mar 4, 2026
Merged
feat(seer): Detect Cursor GitHub access errors and return specific failure type#109692isaacwang-sentry merged 10 commits intomasterfrom
isaacwang-sentry merged 10 commits intomasterfrom
Conversation
…ilure type When Cursor returns a 400 error with "Failed to verify existence of branch", surface a cursor_github_access failure type so the frontend can prompt the user to install the Cursor GitHub App instead of showing a generic error. Co-Authored-By: Claude <[email protected]>
3 tasks
JoshFerge
reviewed
Mar 3, 2026
JoshFerge
approved these changes
Mar 3, 2026
Member
JoshFerge
left a comment
There was a problem hiding this comment.
one small thought, but looks great, thanks!
…r_github_access failure The error handling for "Failed to verify existence of branch" assumed any non-null installation was Cursor. Explicitly check the provider to avoid misattributing errors from other coding agent integrations. Co-Authored-By: Claude <[email protected]>
Contributor
Backend Test FailuresFailures on
|
Apply the same provider check from coding_agent.py to coding_agent_handoff.py — use `integration.provider == "cursor"` instead of `not is_github_copilot` to avoid misattributing errors from future non-Cursor providers. Also set mock provider in the test so it matches the production check. Co-Authored-By: Claude <[email protected]>
Contributor
Backend Test FailuresFailures on
|
The "Failed to verify existence of branch" error from Cursor is specifically a 400 response. Without checking the status code, errors with other codes (e.g. 401, 500) containing that text would be misclassified and skip more appropriate handlers. Co-Authored-By: Claude <[email protected]>
Contributor
Backend Test FailuresFailures on
|
…check Use getattr chain to safely access installation.model.provider, avoiding AttributeError when the model attribute is None. Co-Authored-By: Claude <[email protected]>
Replace defensive getattr chain with isinstance(installation, CursorAgentIntegration) which is more idiomatic, avoids hard-coding the "cursor" string, and implicitly handles the None case. Co-Authored-By: Claude <[email protected]>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Replace string comparison `integration.provider == "cursor"` with `isinstance(installation, CursorAgentIntegration)` to match the pattern already used in coding_agent.py and cursor/webhooks/handler.py. Co-Authored-By: Claude <[email protected]>
JoshFerge
approved these changes
Mar 4, 2026
isaacwang-sentry
added a commit
that referenced
this pull request
Mar 5, 2026
…#109695) ## Summary - Adds a new `AutofixCursorGithubAccessModal` component that guides users to install the Cursor GitHub App when Cursor can't access a repository - Updates both `useAutofix` and `useExplorerAutofix` hooks to detect the new `cursor_github_access` failure type and show the modal instead of a generic error toast Depends on backend PR: #109692 AIML-2569 ## Test plan - [x] Frontend test passes: `CI=true pnpm test static/app/components/events/autofix/autofixCursorGithubAccessModal.spec.tsx` - [x] Modal renders with correct title, body, and link to `https://github.com/apps/cursor` - [x] When backend returns `cursor_github_access` failure_type, modal is shown instead of generic error toast
JonasBa
pushed a commit
that referenced
this pull request
Mar 5, 2026
…#109695) ## Summary - Adds a new `AutofixCursorGithubAccessModal` component that guides users to install the Cursor GitHub App when Cursor can't access a repository - Updates both `useAutofix` and `useExplorerAutofix` hooks to detect the new `cursor_github_access` failure type and show the modal instead of a generic error toast Depends on backend PR: #109692 AIML-2569 ## Test plan - [x] Frontend test passes: `CI=true pnpm test static/app/components/events/autofix/autofixCursorGithubAccessModal.spec.tsx` - [x] Modal renders with correct title, body, and link to `https://github.com/apps/cursor` - [x] When backend returns `cursor_github_access` failure_type, modal is shown instead of generic error toast
3 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Detect when Cursor's coding agent returns a 400 error with "Failed to verify existence of branch" and surface a
cursor_github_accessfailure type instead of falling through to the generic error handler.This allows the frontend to show a targeted prompt asking the user to install the Cursor GitHub App, rather than a confusing generic error message.
Changes:
coding_agent.py: Add branch-verification error detection with aninstallation is not Noneguard (only applies to Cursor, not GitHub Copilot which has no installation)coding_agent_handoff.py: Restructure theisinstance(e, ApiError)block to check for this error whennot is_github_copilot