Skip to content

Commit bc8deca

Browse files
authored
Merge pull request #4596 from hank9999/fix/duplicate-tool-use-in-anthropic
fix(providers): fix duplicate tool use in anthropic
2 parents 52d42da + 1c33884 commit bc8deca

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.changeset/olive-carpets-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Fix duplicate tool use in Anthropic

src/api/providers/anthropic.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { filterNonAnthropicBlocks } from "../transform/anthropic-filter"
2020
import { BaseProvider } from "./base-provider"
2121
import type { SingleCompletionHandler, ApiHandlerCreateMessageMetadata } from "../index"
2222
import { calculateApiCostAnthropic } from "../../shared/cost"
23-
import { convertOpenAIToolsToAnthropic, ToolCallAccumulatorAnthropic } from "./kilocode/nativeToolCallHelpers"
23+
import { convertOpenAIToolsToAnthropic } from "./kilocode/nativeToolCallHelpers"
2424

2525
export class AnthropicHandler extends BaseProvider implements SingleCompletionHandler {
2626
private options: ApiHandlerOptions
@@ -204,12 +204,9 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
204204
let thinkingDeltaAccumulator = ""
205205
let thinkText = ""
206206
let thinkSignature = ""
207-
const toolCallAccumulator = new ToolCallAccumulatorAnthropic()
208207
// kilocode_change end
209208

210209
for await (const chunk of stream) {
211-
yield* toolCallAccumulator.processChunk(chunk) // kilocode_change
212-
213210
switch (chunk.type) {
214211
case "message_start": {
215212
// Tells us cache reads/writes/input/output.

0 commit comments

Comments
 (0)