Skip to content

Commit f4da077

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

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pkg/engine/toolname.go

Lines changed: 5 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,20 @@ func ToolNormalizer(tool string) string {
2119
if strings.HasSuffix(tool, system.Suffix) {
2220
tool = strings.TrimSuffix(tool, filepath.Ext(tool))
2321
}
22+
if strings.HasPrefix(tool, "sys.") {
23+
tool = strings.TrimPrefix(tool, "sys.")
24+
}
2425

2526
if validToolName.MatchString(tool) {
2627
return tool
2728
}
2829

29-
name := invalidChars.ReplaceAllString(tool, "-")
30+
name := invalidChars.ReplaceAllString(tool, "_")
3031
if len(name) > 55 {
3132
name = name[:55]
3233
}
3334

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

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

0 commit comments

Comments
 (0)