fix: Vercel AI SDK parallel tool results + Anthropic base URL hint#55
Merged
luokerenx4 merged 2 commits intomasterfrom Mar 14, 2026
Merged
fix: Vercel AI SDK parallel tool results + Anthropic base URL hint#55luokerenx4 merged 2 commits intomasterfrom
luokerenx4 merged 2 commits intomasterfrom
Conversation
Parallel tool calls (multiple tool_use in one step) previously flushed each tool_result as a separate user message. On the next turn, toModelMessages() would reconstruct a history where the assistant had N tool calls but each result was its own message, causing Vercel AI SDK to throw MissingToolResultsError. Fix: accumulate tool results and only flush when the next round begins (new tool_use or text event), so all results land in one user message. Adds A16 (persistence) and parallel tool call test (agent.spec) to pin the correct behaviour. Fixes #50 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ai-sdk/anthropic constructs request URLs as `${baseURL}/messages`,
so the baseURL must already include /v1 — unlike the Anthropic SDK
which appends /v1 automatically. Added an inline hint in the channel
config modal when the anthropic provider is selected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MissingToolResultsErrorwhen Vercel AI SDK backend uses parallel tool calls (issue 使用Vercel AI SDK 的兼容api遇到问题 #50)/v1when using Vercel AI SDK backendRoot Cause
@ai-sdk/anthropicconstructs request URLs as${baseURL}/messages(assuming/v1is already in the base URL), whereas the Anthropic SDK appends/v1/messagesautomatically. This means the same base URL works with Agent SDK but returns 404 with Vercel AI SDK.Test plan
pnpm test— A16 parallel tool call persistence test addedMissingToolResultsErrorwith Vercel AI SDK/v1🤖 Generated with Claude Code