Skip to content

Commit 8128bbc

Browse files
ibuildthecloudcjellick
authored andcommitted
bug: always prefer tool's given name over the referenced name
1 parent d97d564 commit 8128bbc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/tests/testdata/TestCase2/call1.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"function": {
66
"toolID": "testdata/TestCase2/test.gpt:bob",
7-
"name": "Bob",
7+
"name": "bob",
88
"description": "I'm Bob, a friendly guy.",
99
"parameters": {
1010
"properties": {

pkg/types/tool.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,10 @@ func toolRefsToCompletionTools(completionTools []ToolReference, prg Program) (re
698698
for _, subToolRef := range completionTools {
699699
subTool := prg.ToolSet[subToolRef.ToolID]
700700

701-
subToolName := subToolRef.Reference
701+
subToolName := subTool.Name
702+
if subToolName == "" {
703+
subToolName = subToolRef.Reference
704+
}
702705
if subToolRef.Named != "" {
703706
subToolName = subToolRef.Named
704707
}

0 commit comments

Comments
 (0)