feat(onboarding): Model agentic setup progress - #121912
Draft
evanpurkhiser wants to merge 1 commit into
Draft
Conversation
evanpurkhiser
force-pushed
the
agentic-onboarding-model
branch
2 times, most recently
from
August 13, 2026 01:23
131151b to
0385a6b
Compare
Define the ordered onboarding stages and their durable state transitions. Later stages complete earlier required work, optional stages remain explicit, and completed stages never regress. The run model keeps terminal state separate from stage state and validates concise UI notes and failure reasons before they reach storage.
evanpurkhiser
force-pushed
the
agentic-onboarding-model
branch
from
August 13, 2026 01:26
0385a6b to
7d64140
Compare
| schema_version: int = SCHEMA_VERSION | ||
| """Version of the Redis and public snapshot representation.""" | ||
|
|
||
| @classmethod |
Contributor
There was a problem hiding this comment.
KeyError on unknown stage in validate_update instead of ValueError
STAGE_DEFINITION_BY_STAGE[update.stage] crashes with KeyError when the stage string is not registered. Use .get() and raise ValueError so callers receive a clean validation error instead of a raw dict miss.
Evidence
STAGE_DEFINITION_BY_STAGEonly contains keys built fromSTAGE_DEFINITIONS.ProgressUpdate.stageis typed asStage, but Python dataclasses do not enforce enum membership at runtime, so a caller can pass any string (e.g., deserializing JSON directly into the dataclass).- When an unregistered stage reaches
validate_update, the direct lookupSTAGE_DEFINITION_BY_STAGE[update.stage]raisesKeyErrorinstead of a controlledValueError. - This matches the production
HANDLERS[event_type]pattern: registry dict lookups without existence checks crash on unexpected input.
Also found at 1 additional location
src/sentry/onboarding/agentic_progress/model.py:269-297
Identified by Warden · sentry-backend-bugs · 43T-LWE
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 1 of 5. Next: #121913
Define the ordered onboarding stages and their durable state transitions. Later stages complete earlier required work, optional stages remain explicit, and completed stages never regress.
The run model keeps terminal state separate from stage state and validates concise UI notes and failure reasons before they reach storage.