Skip to content

Commit 1139b78

Browse files
committed
Remove removeWrapperObject, I can't reproduce this anymore
1 parent 63dac8c commit 1139b78

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

src/core/assistant-message/AssistantMessageParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type ToolName, toolNames } from "@roo-code/types"
22
import { TextContent, ToolUse, ToolParamName, toolParamNames } from "../../shared/tools"
33
import { AssistantMessageContent } from "./parseAssistantMessage"
4-
import { NativeToolCall, parseDoubleEncodedParams, removeWrapperObject } from "./kilocode/native-tool-call"
4+
import { NativeToolCall, parseDoubleEncodedParams } from "./kilocode/native-tool-call"
55
import Anthropic from "@anthropic-ai/sdk" // kilocode_change
66

77
/**
@@ -186,7 +186,7 @@ export class AssistantMessageParser {
186186
const toolUse: ToolUse = {
187187
type: "tool_use",
188188
name: toolName as ToolName,
189-
params: removeWrapperObject(toolName, parsedArgs, 0),
189+
params: parsedArgs,
190190
partial: false, // Now complete after accumulation
191191
toolUseId: accumulatedCall.id,
192192
}

src/core/assistant-message/kilocode/native-tool-call.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,3 @@ export function parseDoubleEncodedParams(obj: any): any {
5757
// Primitive types (number, boolean, etc.) return as-is
5858
return obj
5959
}
60-
61-
const knownWrapperPropertyNames = [
62-
"arguments", // seen with qwen3-coder
63-
"result", // seen with gemini-2.5-flash, haiku-4.5, sonnet-4.5
64-
]
65-
66-
export function removeWrapperObject(toolName: string, parsedArgs: Record<string, unknown>, nestingLevel: number) {
67-
const keys = Object.keys(parsedArgs)
68-
if (keys.length === 1) {
69-
const key = keys[0]
70-
const value = parsedArgs[key]
71-
if (knownWrapperPropertyNames.includes(key) && value && typeof value === "object") {
72-
console.debug(
73-
`Processing tool '${toolName}', assuming property '${key}' of type object (nesting level ${nestingLevel}) contains the actual arguments.`,
74-
value,
75-
)
76-
return removeWrapperObject(toolName, value as Record<string, unknown>, nestingLevel + 1)
77-
}
78-
}
79-
return parsedArgs
80-
}

0 commit comments

Comments
 (0)