Skip to content

Commit b01617c

Browse files
chore: change tool names to be more LLM friendly
1 parent b5bc614 commit b01617c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pkg/engine/toolname.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package engine
22

33
import (
4-
"crypto/md5"
5-
"encoding/hex"
64
"path/filepath"
75
"regexp"
86
"strings"
@@ -21,20 +19,18 @@ func ToolNormalizer(tool string) string {
2119
if strings.HasSuffix(tool, system.Suffix) {
2220
tool = strings.TrimSuffix(tool, filepath.Ext(tool))
2321
}
22+
tool = strings.TrimPrefix(tool, "sys.")
2423

2524
if validToolName.MatchString(tool) {
2625
return tool
2726
}
2827

29-
name := invalidChars.ReplaceAllString(tool, "-")
28+
name := invalidChars.ReplaceAllString(tool, "_")
3029
if len(name) > 55 {
3130
name = name[:55]
3231
}
3332

34-
hash := md5.Sum([]byte(tool))
35-
hexed := hex.EncodeToString(hash[:])
36-
37-
return name + "-" + hexed[:8]
33+
return name
3834
}
3935

4036
func PickToolName(toolName string, existing map[string]struct{}) string {

0 commit comments

Comments
 (0)