Repository navigation
fix(mcp): Tell the agent a 403 without a scope challenge won't succeed on retry - #2422
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
…d on retry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@pcbeingused333 is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been 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.
Fixes #2356
When Sentry answers 403 without an
insufficient_scopechallenge (the account lacks the role or project access, for examplesearch_issueswith aprojectthe caller's teams can't reach),formatErrorForUsersent it through the generic Input Error template, which ends with "You may be able to resolve the issue by addressing the concern and trying again." The 403 comes from the account's access, not from the input, so the agent retries a call that cannot succeed and never tells the user to ask for access.#2222 handled only the scope-challenge case. This adds
findPermissionDeniedError, which finds any non-scopeApiPermissionErroron the error or within itscausechain (so it also covers tools that rewrap it as aUserInputError).formatErrorForUsernow returns a Permission Denied message that keeps the API detail, says retrying the same call will not help, and points to an organization Owner or Manager or a different organization or project. The scope-challenge path is unchanged and still checked first; both finders share one cause-walking helper.Tests: the existing "keeps the input error template for a 403 without a challenge" case now expects the new message, and a new case covers the rewrapped
UserInputError. Both fail on main and pass with the change; the fullpackages/mcp-coresuite passes.This change was prepared, and the tests above were run, with the assistance of an AI coding tool.