diff --git a/src/seer/automation/models.py b/src/seer/automation/models.py index 714e1ff51..f9562c74b 100644 --- a/src/seer/automation/models.py +++ b/src/seer/automation/models.py @@ -289,14 +289,20 @@ def validate_stacktrace(cls, sentry_stacktrace: SentryStacktrace | Stacktrace): class ThreadDetails(BaseModel): - id: int - name: Optional[str] = None - crashed: Optional[bool] = False - current: Optional[bool] = False - state: Optional[str] = None - main: Optional[bool] = False - - stacktrace: Optional[Stacktrace] = None + id: int + name: Optional[str] = None + crashed: Optional[bool] = False + current: Optional[bool] = False + state: Optional[str] = None + main: Optional[bool] = False + stacktrace: Optional[Stacktrace] = None + + @field_validator("id", mode="before") + @classmethod + def validate_id(cls, v): + if v is None: + raise ValueError("id cannot be None") + return v @field_validator("stacktrace", mode="before") @classmethod