Skip to content

Discriminate tool search result union#1395

Open
hwaxxer wants to merge 1 commit intoanthropics:mainfrom
hwaxxer:fix-tool-search-result
Open

Discriminate tool search result union#1395
hwaxxer wants to merge 1 commit intoanthropics:mainfrom
hwaxxer:fix-tool-search-result

Conversation

@hwaxxer
Copy link
Copy Markdown

@hwaxxer hwaxxer commented Apr 15, 2026

Fixes #1394

ToolSearchToolResultBlock.content is generated as a plain union, but the two variants are discriminated by type. Without that discriminator metadata, BaseModel.construct() can fall back to the first union member and construct a search result payload as ToolSearchToolResultError.

This adds the expected discriminator metadata for stable and beta, plus regression coverage.

I realize these files are Stainless-generated, so this PR may not be directly mergeable as-is. I’m submitting it to make the bug and expected generated output concrete.

@hwaxxer hwaxxer requested a review from a team as a code owner April 15, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolSearchToolResultBlock is raw dict

1 participant