Store agentic onboarding metadata by stage - #122076
Draft
evanpurkhiser wants to merge 1 commit into
Draft
Conversation
evanpurkhiser
force-pushed
the
evanpurkhiser/store-agentic-onboarding-metadata-by-stage
branch
from
August 14, 2026 19:22
601d5f2 to
ea81580
Compare
evanpurkhiser
force-pushed
the
evanpurkhiser/store-agentic-onboarding-metadata-by-stage
branch
from
August 14, 2026 19:55
ea81580 to
d089e46
Compare
| event_note=item.get("event_note"), | ||
| status=StageStatus(item.status) if item.status is not None else None, | ||
| event_note=item.event_note, | ||
| extra=_deserialize_extra(stage, item.extra), |
Contributor
There was a problem hiding this comment.
KeyError when deserializing stage without a definition
Deserializing persisted onboarding data with a valid Stage enum value that lacks a STAGE_DEFINITIONS entry raises an uncaught KeyError instead of being skipped gracefully.
Evidence
from_dictcalls_deserialize_extra(stage, item.extra)immediately afterStage(item.stage)succeeds._deserialize_extracallsget_stage_definition(stage), which doesSTAGE_DEFINITION_BY_STAGE[stage]without checking existence first.- A stage kept in the
Stageenum but removed fromSTAGE_DEFINITIONSwould pass theexcept ValueErrorguard and then crash on this dict access. - The outer
exceptinfrom_dictonly catchesTypeError,ValidationError, andValueError, soKeyErrorpropagates uncaught. - Previously
from_dictdid not depend onSTAGE_DEFINITION_BY_STAGE; this dependency was introduced by the new_deserialize_extracall in this change.
Identified by Warden · sentry-backend-bugs · HBZ-292
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.
Agentic onboarding progress now stores structured metadata on the stage that owns it. The status endpoint accepts a stage-specific
contextobject, and run snapshots return that context alongside each stage instead of exposing project slugs and issue IDs at the run level.Context models use Pydantic for strict runtime validation at both the API and Redis persistence boundaries while generic stage definitions preserve the corresponding Python context type. Consumers of
projectSlugsandissueIdsmust read or write them through thecreate_projectandreceive_verification_errorstage contexts.