Skip to content

feat(onboarding): Store agentic setup progress - #121913

Draft
evanpurkhiser wants to merge 1 commit into
agentic-onboarding-modelfrom
agentic-onboarding-storage
Draft

feat(onboarding): Store agentic setup progress#121913
evanpurkhiser wants to merge 1 commit into
agentic-onboarding-modelfrom
agentic-onboarding-storage

Conversation

@evanpurkhiser

@evanpurkhiser evanpurkhiser commented Aug 13, 2026

Copy link
Copy Markdown
Member

Stack 2 of 5. Previous: #121912. Next: #121914

Persist onboarding runs in Redis with a 24-hour lifetime and opaque, hashed handoff tokens. The service owns registration, resumption, updates, cancellation, ownership checks, and snapshot serialization.

Client-run claiming and state updates use optimistic concurrency so retries remain idempotent and concurrent page loads converge on one run.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 13, 2026
@evanpurkhiser evanpurkhiser changed the title agentic onboarding storage feat(onboarding): Store agentic setup progress Aug 13, 2026
@evanpurkhiser
evanpurkhiser force-pushed the agentic-onboarding-storage branch from 52b4e29 to 9d2f7fd Compare August 13, 2026 01:09
@sentry

sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 451 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Comment thread src/sentry/onboarding/agentic_progress/service.py
@evanpurkhiser
evanpurkhiser force-pushed the agentic-onboarding-storage branch from 9d2f7fd to e46bf6b Compare August 13, 2026 01:23
Persist onboarding runs in Redis with a 24-hour lifetime and opaque,
hashed handoff tokens. The service owns registration, resumption, updates,
cancellation, ownership checks, and snapshot serialization.

Client-run claiming and state updates use optimistic concurrency so retries
remain idempotent and concurrent page loads converge on one run.
@evanpurkhiser
evanpurkhiser force-pushed the agentic-onboarding-storage branch from e46bf6b to a510924 Compare August 13, 2026 01:26
Comment on lines +157 to +158

def replace_token(current: OnboardingRun) -> OnboardingRun:

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.

Stored onboarding state parsed without JSON error handling

_deserialize calls json.loads without catching JSONDecodeError, causing unhandled crashes when Redis holds empty or corrupted run state. _load only guards against None, so an empty string or corrupted bytes from Redis reaches _deserialize and crashes instead of being treated as a missing run.

Evidence
  • _deserialize at line 273 calls json.loads(raw) directly without try/except.
  • _load at lines 275-277 passes the raw Redis value into _deserialize after only checking raw is not None; empty strings ("" or b"") pass this guard and trigger JSONDecodeError.
  • get, _claim_client_run, and _atomic_update all consume _load or _deserialize.
  • A corrupted state value causes an unhandled 500 instead of returning None/RunNotFound as callers expect for missing runs.

Identified by Warden · sentry-backend-bugs · GD5-MNF

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