Repository navigation
fix(tools): Explain link_issue's installation 404 for integration tokens - #2296
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Sentry answers GET /organizations/{org}/sentry-app-installations/ with
404 "Could not find requested organization" when the token's user is not
an org member, such as an internal integration's proxy user. link_issue
passed that through after it had already read the issue in the same org,
so agents retried with other issue ID and URL forms.
Translate that 404 into a UserInputError that says a user token or OAuth
sign-in is needed. Reported through MCP feedback MCP-SERVER-GQW.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
link_issuepasses through Sentry'sHTTP 404: "Could not find requested organization."when it lists Sentry App installations with an integration token. By then the tool has already read the issue in that org, so agents assume the issue reference is wrong and retry with other forms (MCP feedback MCP-SERVER-GQW).Sentry only lists App installations for organization members.
SentryAppInstallationsBaseEndpoint.convert_argsraises this 404 when the caller has auser_idbut no membership (src/sentry/sentry_apps/api/bases/sentryapps.py:416-422), and a Sentry App proxy user is never a member. In the reported call, the token was a directSentry-Bearerintegration token: the issue read triggeredapp.find_installation_by_proxy_user, then the listing returned 404 (trace1ef233a8…, span858fccc96f0fe1d3).Changes
linkAppIssuenow becomes aUserInputError. It says integration tokens get this 404, that linking App issues needs a user token or OAuth sign-in, and that a different issue ID or URL won't help. Other listing errors are unchanged.docs/specs/issue-linking.mddocuments the case.Related
SentryAppInstallationPermissiononly lets an App caller through for its own installation (sentryapps.py:469-470). I haven't tested that. If it's right, this message stays useful after that PR lands, though the wording may need a tweak.via automation
evt_905b9c478746fd9deeb853f85ad7441b· Run IDdispatch_6b056fcf1c2c5c748f43774a62ac1591.--
View Session [Sentry]