fix(seer): Make ToolResult.content optional to prevent Pydantic validation error#115630
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fe11775. Configure here.
| tool_call_id: str | ||
| tool_call_function: str | ||
| content: str | ||
| content: str | None = None |
There was a problem hiding this comment.
Frontend TypeScript type not updated for nullable content
Low Severity
Making ToolResult.content nullable in the Python model means null values now flow through to the frontend API response. The corresponding TypeScript ToolResult interface in static/app/views/seerExplorer/types.tsx still declares content: string as required and non-nullable. While no frontend code currently accesses .content on ToolResult, this type mismatch can silently mislead a future developer into assuming content is always a string, potentially causing a runtime error.
Reviewed by Cursor Bugbot for commit fe11775. Configure here.


This PR addresses a
ValidationErrorforSeerRunStatethat occurred when deserializing responses from Seer. The error,none is not an allowed valueforblocks -> tool_results -> content, stemmed from a schema mismatch.Seer's internal
Messagemodel, used for tool results, allowscontentto beNone(e.g., for tool-call-only assistant messages). However, Sentry'sToolResultPydantic model insrc/sentry/seer/agent/client_models.pydefinedcontentas a non-optionalstr.The fix updates
ToolResult.contentfromstrtostr | None = None, aligning Sentry's client model with Seer's actual data structure. An audit for existing usages oftool_result.contentin Sentry found no direct accesses that would break with this change, ensuring a safe and targeted fix.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Fixes SENTRY-5P20