Add agentic onboarding progress endpoints - #121914
Draft
evanpurkhiser wants to merge 1 commit into
Draft
Conversation
Contributor
Sentry Snapshot Testing
|
evanpurkhiser
force-pushed
the
agentic-onboarding-endpoints
branch
from
August 13, 2026 01:09
25bcd25 to
c821a57
Compare
evanpurkhiser
force-pushed
the
agentic-onboarding-endpoints
branch
from
August 13, 2026 01:23
254ea10 to
6fec113
Compare
Expose private organization endpoints for registering a browser run and accepting stage updates from the MCP tool. Requests require org:read access and bind every run to both the authenticated user and organization. The API returns the complete normalized snapshot after each update so callers can observe accepted state and stop after a terminal run.
evanpurkhiser
force-pushed
the
agentic-onboarding-endpoints
branch
from
August 13, 2026 01:26
6fec113 to
667236e
Compare
| serializer = AgenticOnboardingRunRequestSerializer(data=request.data) | ||
| serializer.is_valid(raise_exception=True) | ||
| user_id = request.user.id | ||
| assert user_id is not None |
Contributor
There was a problem hiding this comment.
Bare assert used to validate authenticated user presence
Replace assert user_id is not None with an explicit guard that returns a 401/400 for requests that lack a user (e.g. org auth tokens), since OrganizationPermission allows token-based authentication where request.user.id can be None.
Evidence
AgenticOnboardingPermissioninheritsOrganizationPermission, whosedetermine_accessmethod grants access for token auth (e.g. org auth tokens) even whenrequest.useris anonymous.convert_argsinOrganizationEndpointalready callsorganization_service.get_organization_by_id(..., user_id=None)for such requests, confirming the base class tolerates a missing user.- The
assert user_id is not Nonein the view method will therefore raiseAssertionError(500) instead of a proper client error when a valid org auth token withorg:readhits this endpoint.
Also found at 1 additional location
src/sentry/api/endpoints/organization_agentic_onboarding.py:132
Identified by Warden · sentry-backend-bugs · V5T-YSR
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.
Stack 3 of 5. Previous: #121913. Next: #121915
Expose private organization endpoints for registering a browser run and accepting stage updates from the MCP tool. Requests require
org:readaccess and bind every run to both the authenticated user and organization.The API returns the complete normalized snapshot after each update so callers can observe accepted state and stop after a terminal run.