Skip to content

Commit ab79d6a

Browse files
committed
Improve Haiku check for native tool calling
1 parent 4cfbcba commit ab79d6a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/types/src/kilocode/native-function-calling.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const nativeFunctionCallingProviders = [
2121
"human-relay",
2222
] satisfies ProviderName[] as ProviderName[]
2323

24-
const modelsDefaultingToNativeFunctionCalls = ["anthropic/claude-haiku-4.5"]
24+
const modelsDefaultingToJsonKeywords = ["claude-haiku-4.5", "claude-haiku-4-5"]
2525

2626
export function getActiveToolUseStyle(settings: ProviderSettings | undefined): ToolUseStyle {
2727
if (
@@ -33,8 +33,8 @@ export function getActiveToolUseStyle(settings: ProviderSettings | undefined): T
3333
if (settings.toolStyle) {
3434
return settings.toolStyle
3535
}
36-
const model = getModelId(settings)
37-
if (model && modelsDefaultingToNativeFunctionCalls.includes(model)) {
36+
const model = getModelId(settings)?.toLowerCase()
37+
if (model && modelsDefaultingToJsonKeywords.some((keyword) => model.includes(keyword))) {
3838
return "json"
3939
}
4040
return "xml"

packages/types/src/single-file-read-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
* @returns true if the model should use single file reads
1111
*/
1212
export function shouldUseSingleFileRead(modelId: string): boolean {
13-
return modelId.includes("claude-haiku-4.5") // kilocode_change
13+
return modelId.includes("claude-haiku-4.5") || modelId.includes("claude-haiku-4-5") // kilocode_change
1414
}

0 commit comments

Comments
 (0)