Skip to content

Commit 838b300

Browse files
committed
fix: do not lowercase all items in tool(like) lists
When importing things from github or other case sensitive location the previous functionality would lowercase everything causing clones from VCS to fail. This fix removes the calls to lowercase tools and contexts along with the other places they occur. Signed-off-by: Bill Maxwell <[email protected]>
1 parent f664d57 commit 838b300

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

pkg/loader/github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func getCommitLsRemote(ctx context.Context, account, repo, ref string) (string,
4141
}
4242

4343
// regexp to match a git commit id
44-
var commitRegexp = regexp.MustCompile("^[a-f0-9]{40}$")
44+
var commitRegexp = regexp.MustCompile("^[a-z0-9]{40}$")
4545

4646
func getCommit(ctx context.Context, account, repo, ref string) (string, error) {
4747
if commitRegexp.MatchString(ref) {

pkg/parser/parser.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ func isParam(line string, tool *types.Tool) (_ bool, err error) {
101101
}
102102
tool.Parameters.Chat = v
103103
case "export":
104-
tool.Parameters.Export = append(tool.Parameters.Export, csv(strings.ToLower(value))...)
104+
tool.Parameters.Export = append(tool.Parameters.Export, csv(value)...)
105105
case "tool", "tools":
106-
tool.Parameters.Tools = append(tool.Parameters.Tools, csv(strings.ToLower(value))...)
106+
tool.Parameters.Tools = append(tool.Parameters.Tools, csv(value)...)
107107
case "globaltool", "globaltools":
108-
tool.Parameters.GlobalTools = append(tool.Parameters.GlobalTools, csv(strings.ToLower(value))...)
108+
tool.Parameters.GlobalTools = append(tool.Parameters.GlobalTools, csv(value)...)
109109
case "exportcontext":
110-
tool.Parameters.ExportContext = append(tool.Parameters.ExportContext, csv(strings.ToLower(value))...)
110+
tool.Parameters.ExportContext = append(tool.Parameters.ExportContext, csv(value)...)
111111
case "context":
112-
tool.Parameters.Context = append(tool.Parameters.Context, csv(strings.ToLower(value))...)
112+
tool.Parameters.Context = append(tool.Parameters.Context, csv(value)...)
113113
case "args", "arg", "param", "params", "parameters", "parameter":
114114
if err := addArg(value, tool); err != nil {
115115
return false, err

pkg/tests/testdata/TestCase/call1.golden

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

pkg/tests/testdata/TestCase2/call1.golden

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

0 commit comments

Comments
 (0)