Skip to content

fix(providers): fix duplicate tool use in anthropic - #4596

Merged
chrarnoldus merged 3 commits into
Kilo-Org:mainfrom
hank9999:fix/duplicate-tool-use-in-anthropic
Dec 20, 2025
Merged

fix(providers): fix duplicate tool use in anthropic#4596
chrarnoldus merged 3 commits into
Kilo-Org:mainfrom
hank9999:fix/duplicate-tool-use-in-anthropic

Conversation

@hank9999

@hank9999 hank9999 commented Dec 20, 2025

Copy link
Copy Markdown

Context

Fixes duplicate tool_use emissions in Anthropic tool streaming. The current flow produces both tool_call_partial and a full tool_call, which results in the same id being emitted twice and API provider rejecting the request with "tool_use ids must be unique". This shows up easily with tools like ask_followup_question.

Implementation

Removed the Anthropic ToolCallAccumulatorAnthropic output so we rely solely on tool_call_partial, letting NativeToolCallParser handle streaming assembly and completion.

Screenshots

before after
image image

How to Test

Configure the provider without changing nothing, then start a new chat, let AI ask your some question, 100% repeation.

Get in Touch

username hank9999 in the server

@changeset-bot

changeset-bot Bot commented Dec 20, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c33884

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread src/api/providers/__tests__/anthropic.spec.ts Outdated
Comment thread src/api/providers/__tests__/anthropic.spec.ts Outdated
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.

2 participants