Skip to content

Accept built-in tool parts in message builders - #367

Merged
anbuzin merged 1 commit into
mainfrom
accept-builtin-tool-parts
Nov 18, 2026
Merged

anbuzin merged 1 commit into
mainfrom
accept-builtin-tool-parts

Conversation

@anbuzin

@anbuzin anbuzin commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

We were rejecting built-in tool calls and returns in the message builders even though they're already valid parts. ai.assistant_message(*stored.parts) now works for turns with a provider tool like web search.

The message builders accept Part values, but their runtime type check
omitted BuiltinToolCallPart and BuiltinToolReturnPart. This made them
reject stored provider-tool turns even though both types belong to Part.

Include the existing types in the check and cover a built-in call and
return followed by text. No new part type or parameter is added.
@anbuzin anbuzin added the fix Bug fix label Nov 17, 2026
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ai-python Ready Ready Preview, v0 Nov 17, 2026 11:52pm UTC

@anbuzin
anbuzin merged commit 05aefd3 into main Nov 18, 2026
14 checks passed
@anbuzin
anbuzin deleted the accept-builtin-tool-parts branch November 18, 2026 18:53

This branch was successfully deployed

1 active deployment
Preview — 7391ef36 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants