Skip to content

Commit 8c3a838

Browse files
committed
feat: include fields in prompt only when there are fields
This essentially allows tools to "display" info to a user, even when using SDKs. Signed-off-by: Donnie Adams <[email protected]>
1 parent c8cf310 commit 8c3a838

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/prompt/prompt.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ func SysPrompt(ctx context.Context, envs []string, input string, _ chan<- string
6161

6262
for _, env := range envs {
6363
if url, ok := strings.CutPrefix(env, types.PromptURLEnvVar+"="); ok {
64+
var fields []string
65+
if params.Fields != "" {
66+
fields = strings.Split(params.Fields, ",")
67+
}
6468
httpPrompt := types.Prompt{
6569
Message: params.Message,
66-
Fields: strings.Split(params.Fields, ","),
70+
Fields: fields,
6771
Sensitive: params.Sensitive == "true",
6872
}
6973
return sysPromptHTTP(ctx, envs, url, httpPrompt)

0 commit comments

Comments
 (0)