Skip to content

Store agentic onboarding metadata by stage - #122076

Draft
evanpurkhiser wants to merge 1 commit into
masterfrom
evanpurkhiser/store-agentic-onboarding-metadata-by-stage
Draft

Store agentic onboarding metadata by stage#122076
evanpurkhiser wants to merge 1 commit into
masterfrom
evanpurkhiser/store-agentic-onboarding-metadata-by-stage

Conversation

@evanpurkhiser

Copy link
Copy Markdown
Member

Agentic onboarding progress now stores structured metadata on the stage that owns it. The status endpoint accepts a stage-specific context object, 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 projectSlugs and issueIds must read or write them through the create_project and receive_verification_error stage contexts.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 14, 2026
@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/store-agentic-onboarding-metadata-by-stage branch from 601d5f2 to ea81580 Compare August 14, 2026 19:22
@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/store-agentic-onboarding-metadata-by-stage branch from ea81580 to d089e46 Compare August 14, 2026 19:55
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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dict calls _deserialize_extra(stage, item.extra) immediately after Stage(item.stage) succeeds.
  • _deserialize_extra calls get_stage_definition(stage), which does STAGE_DEFINITION_BY_STAGE[stage] without checking existence first.
  • A stage kept in the Stage enum but removed from STAGE_DEFINITIONS would pass the except ValueError guard and then crash on this dict access.
  • The outer except in from_dict only catches TypeError, ValidationError, and ValueError, so KeyError propagates uncaught.
  • Previously from_dict did not depend on STAGE_DEFINITION_BY_STAGE; this dependency was introduced by the new _deserialize_extra call in this change.

Identified by Warden · sentry-backend-bugs · HBZ-292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant