Skip to content

fix(seer): Make ToolResult.content optional to prevent Pydantic validation error#115630

Merged
trevor-e merged 1 commit into
masterfrom
seer/fix/seer-toolresult-content-optional
May 15, 2026
Merged

fix(seer): Make ToolResult.content optional to prevent Pydantic validation error#115630
trevor-e merged 1 commit into
masterfrom
seer/fix/seer-toolresult-content-optional

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry Bot commented May 15, 2026

This PR addresses a ValidationError for SeerRunState that occurred when deserializing responses from Seer. The error, none is not an allowed value for blocks -> tool_results -> content, stemmed from a schema mismatch.

Seer's internal Message model, used for tool results, allows content to be None (e.g., for tool-call-only assistant messages). However, Sentry's ToolResult Pydantic model in src/sentry/seer/agent/client_models.py defined content as a non-optional str.

The fix updates ToolResult.content from str to str | None = None, aligning Sentry's client model with Seer's actual data structure. An audit for existing usages of tool_result.content in 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

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 15, 2026
@trevor-e trevor-e added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label May 15, 2026
@trevor-e trevor-e marked this pull request as ready for review May 15, 2026 19:18
@trevor-e trevor-e requested a review from a team as a code owner May 15, 2026 19:18
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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
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.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe11775. Configure here.

@trevor-e trevor-e merged commit 7c3b9e1 into master May 15, 2026
77 of 78 checks passed
@trevor-e trevor-e deleted the seer/fix/seer-toolresult-content-optional branch May 15, 2026 19:30
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 Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant