Skip to content

Commit 5964457

Browse files
committed
refactor: remove redundant alias registration loop
The loop in filterNativeToolsForMode that registers alias renames for tools that are allowed and explicitly requested as aliases is redundant. This logic is already handled in applyModelToolCustomization at lines 195-205, which adds alias renames when processing includedTools. The removed code was iterating over modelInfo.includedTools a second time to add the same entries to aliasRenames that applyModelToolCustomization had already added.
1 parent 2753783 commit 5964457

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/core/prompts/tools/filter-tools-for-mode.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,6 @@ export function filterNativeToolsForMode(
267267
)
268268
allowedToolNames = customizedTools
269269

270-
// Register alias renames for tools that are allowed and explicitly requested as aliases
271-
if (modelInfo?.includedTools && modelInfo.includedTools.length > 0) {
272-
for (const includedTool of modelInfo.includedTools) {
273-
const canonical = resolveToolAlias(includedTool)
274-
if (canonical !== includedTool && allowedToolNames.has(canonical)) {
275-
aliasRenames.set(canonical, includedTool)
276-
}
277-
}
278-
}
279-
280270
// Conditionally exclude codebase_search if feature is disabled or not configured
281271
if (
282272
!codeIndexManager ||

0 commit comments

Comments
 (0)