Skip to content

Commit 2925963

Browse files
committed
useCallback is unnecessary here
1 parent 677c4e0 commit 2925963

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

webview-ui/src/components/chat/McpExecution.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ interface McpExecutionProps {
3131
initiallyExpanded?: boolean // kilocode_change: For Storybook stories only
3232
}
3333

34+
function removeRenamedPrefix_kilocode(text: string): string {
35+
// Remove "renamed_" prefix from property names in JSON (native tool calling)
36+
const prefix = "renamed_"
37+
if (!text || !text.startsWith(prefix)) return text
38+
return text.substring(prefix.length)
39+
}
40+
3441
export const McpExecution = ({
3542
executionId,
3643
text,
@@ -54,13 +61,6 @@ export const McpExecution = ({
5461
// kilocode_change: Main collapse state for the entire MCP execution content
5562
const [isResponseExpanded, setIsResponseExpanded] = useState(initiallyExpanded)
5663

57-
// kilocode_change: Remove "renamed_" prefix from property names in JSON (native tool calling)
58-
const removeRenamedPrefix_kilocode = useCallback((text: string): string => {
59-
const prefix = "renamed_"
60-
if (!text || !text.startsWith(prefix)) return text
61-
return text.substring(prefix.length)
62-
}, [])
63-
6464
// Try to parse JSON and return both the result and formatted text
6565
const tryParseJson = useCallback((text: string): { isJson: boolean; formatted: string } => {
6666
if (!text) return { isJson: false, formatted: "" }

0 commit comments

Comments
 (0)