feat(coding-agents): Show GitHub App permissions modal on 403 errors#108452
feat(coding-agents): Show GitHub App permissions modal on 403 errors#108452
Conversation
When the backend returns failure_type="github_app_permissions" for a coding agent launch failure, show a modal explaining that the Sentry GitHub App needs updated permissions and link the user directly to their GitHub App installation settings page (using github_installation_id from the response, falling back to the generic installations page). Previously these failures surfaced as a cryptic error toast with no actionable guidance. The modal includes a "Remind me later" dismiss button and an "Update Permissions" button that links to GitHub settings. Both the autofix (useLaunchCodingAgent) and explorer (triggerCodingAgentHandoff) code paths are updated. Fully backwards compatible: if the backend doesn't return failure_type, the code falls through to the existing error toast behavior. Co-Authored-By: Claude <[email protected]>
…ions modal Replace raw <h3> and <p> elements with <Heading as="h3"> and <Text as="p"> from @sentry/scraps/text per design system guidelines. Co-Authored-By: Claude <[email protected]>
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.
| installationUrl={installationUrl} | ||
| /> | ||
| )); | ||
| } |
There was a problem hiding this comment.
Duplicated permission-failure handling logic across two files
Low Severity
The permission-failure handling logic — filtering by failure_type, constructing the installationUrl from github_installation_id, and calling openModal with AutofixGithubAppPermissionsModal — is duplicated nearly verbatim across useAutofix.tsx and useExplorerAutofix.tsx. This increases risk of the two copies diverging if the failure type string, URL format, or modal behavior changes in the future. Extracting this into a shared helper would reduce that maintenance burden.
Additional Locations (1)
There was a problem hiding this comment.
old autofix will be delenda est soon
…108452) When launching coding agents (GitHub Copilot, Cursor) fails with a 403 from the GitHub API, it typically means the Sentry GitHub App installation lacks the required `contents:write` permission. Previously this surfaced as a cryptic error toast with no actionable guidance. This PR adds a `AutofixGithubAppPermissionsModal` that explains the issue and links users directly to the specific GitHub App installation settings page to grant the missing permission (or falls back to the generic installations list if the installation ID isn't known). **Changes:** - `autofixGithubAppPermissionsModal.tsx`: New modal component with "Remind me later" and "Update Permissions" (links to GitHub settings) buttons - `useAutofix.tsx`: In `useLaunchCodingAgent`, split failures by `failure_type` — show the permissions modal for `"github_app_permissions"` failures, regular error toasts for others - `useExplorerAutofix.tsx`: Same modal logic in `triggerCodingAgentHandoff` (the explorer code path) **Backwards compatible**: If the backend doesn't return `failure_type` (old backend), failures without `failure_type === "github_app_permissions"` fall through to the existing error toast behavior. This PR can be deployed before or after the backend PR. **Backend PR**: #108451 --------- Co-authored-by: Claude <[email protected]>


When launching coding agents (GitHub Copilot, Cursor) fails with a 403 from the GitHub API, it typically means the Sentry GitHub App installation lacks the required
contents:writepermission. Previously this surfaced as a cryptic error toast with no actionable guidance.This PR adds a
AutofixGithubAppPermissionsModalthat explains the issue and links users directly to the specific GitHub App installation settings page to grant the missing permission (or falls back to the generic installations list if the installation ID isn't known).Changes:
autofixGithubAppPermissionsModal.tsx: New modal component with "Remind me later" and "Update Permissions" (links to GitHub settings) buttonsuseAutofix.tsx: InuseLaunchCodingAgent, split failures byfailure_type— show the permissions modal for"github_app_permissions"failures, regular error toasts for othersuseExplorerAutofix.tsx: Same modal logic intriggerCodingAgentHandoff(the explorer code path)Backwards compatible: If the backend doesn't return
failure_type(old backend), failures withoutfailure_type === "github_app_permissions"fall through to the existing error toast behavior. This PR can be deployed before or after the backend PR.Backend PR: #108451