Skip to content

fix(anthropic): keep tools array when toolChoice is 'none'#12609

Open
giulio-leone wants to merge 2 commits intovercel:mainfrom
giulio-leone:fix/issue-12378-tool-choice-none-keep-tools
Open

fix(anthropic): keep tools array when toolChoice is 'none'#12609
giulio-leone wants to merge 2 commits intovercel:mainfrom
giulio-leone:fix/issue-12378-tool-choice-none-keep-tools

Conversation

@giulio-leone
Copy link

Fixes #12378

Problem

When toolChoice is 'none', the Anthropic provider strips both tools and tool_choice from the API request. This causes empty content response when conversation history contains tool_use/tool_result blocks.

Fix

  • Changed 'none' case to return tools array and toolChoice: { type: 'none' } instead of undefined for both
  • Added 'none' to AnthropicToolChoice type union
  • Updated tests

giulio-leone and others added 2 commits February 14, 2026 22:05
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giulio-leone giulio-leone force-pushed the fix/issue-12378-tool-choice-none-keep-tools branch from 6863fa0 to 744adcd Compare February 14, 2026 21:05
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.

anthropic provider: toolChoice 'none' strips tools from request, causing empty response with tool_use history

1 participant