Skip to content

feat(coding-agents): Show GitHub App permissions modal on 403 errors#108452

Merged
JoshFerge merged 3 commits intomasterfrom
jferg/copilot-403-frontend
Feb 18, 2026
Merged

feat(coding-agents): Show GitHub App permissions modal on 403 errors#108452
JoshFerge merged 3 commits intomasterfrom
jferg/copilot-403-frontend

Conversation

@JoshFerge
Copy link
Copy Markdown
Member

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

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]>
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 18, 2026
…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]>
@JoshFerge JoshFerge marked this pull request as ready for review February 18, 2026 17:44
@JoshFerge JoshFerge requested a review from a team as a code owner February 18, 2026 17:44
@JoshFerge JoshFerge requested a review from a team February 18, 2026 17:44
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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}
/>
));
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

old autofix will be delenda est soon

@JoshFerge JoshFerge merged commit 21141df into master Feb 18, 2026
62 checks passed
@JoshFerge JoshFerge deleted the jferg/copilot-403-frontend branch February 18, 2026 17:59
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
…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]>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

claude-code-assisted Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants