Skip to content

fix(tools): Explain whoami's 400 for tokens with no user - #2316

Draft
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/whoami-userless-token-400
Draft

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/whoami-userless-token-400

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

When no user stands behind a token, as with an org auth token (sntrys_...), Sentry's GET /api/0/auth/ returns a 400 with no body (sentry src/sentry/api/endpoints/auth_index.py:63-65). whoami passed that through the generic Input Error template as "There was an HTTP 400 error...", so the agent that hit it in MCP feedback couldn't tell that the token type was the problem.

whoami now turns that 400 into a UserInputError. The message says the token isn't tied to a user, that org auth tokens only carry org:ci (sentry src/sentry/models/orgauthtoken.py:36), and that the user should connect with a personal auth token or OAuth instead. Other errors behave as before.

Out of scope: rejecting sntrys_ tokens up front in Sentry-Bearer mode. The issue notes it as a follow-up.

Refs #2315

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_d428b39c5339ad27cbfcee6c1a8f7e77.

--

View Session [Sentry]

Sentry's /auth/ endpoint returns a bodiless 400 when no user stands
behind the token, as with org auth tokens. whoami passed that through
as a generic HTTP 400 input error, so agents could not tell the token
type was the problem. Say the token is not tied to a user and that
org auth tokens only carry org:ci.

Refs #2315
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 17, 2026 1:33pm UTC

Request Review

This branch was successfully deployed

1 active and 1 inactive deployments
Actions — 969f0328 Deployed Nov 17, 2026 by sentry-junior[bot] via eval #1943
Preview — 969f0328 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants