From 85047e1160611ec522e76ab3aefb31f3ba094049 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Wed, 19 Jun 2024 08:45:50 -0700 Subject: [PATCH] bug: fix regression in changing GPTSCRIPT_INPUT env var --- pkg/cli/gptscript.go | 17 +++++++++-------- pkg/engine/cmd.go | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/cli/gptscript.go b/pkg/cli/gptscript.go index 658682be..fbac48a0 100644 --- a/pkg/cli/gptscript.go +++ b/pkg/cli/gptscript.go @@ -45,14 +45,15 @@ type GPTScript struct { CacheOptions OpenAIOptions DisplayOptions - Color *bool `usage:"Use color in output (default true)" default:"true"` - Confirm bool `usage:"Prompt before running potentially dangerous commands"` - Debug bool `usage:"Enable debug logging"` - NoTrunc bool `usage:"Do not truncate long log messages"` - Quiet *bool `usage:"No output logging (set --quiet=false to force on even when there is no TTY)" short:"q"` - Output string `usage:"Save output to a file, or - for stdout" short:"o"` - EventsStreamTo string `usage:"Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\\\.\\pipe\\my-pipe)" name:"events-stream-to"` - Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f"` + Color *bool `usage:"Use color in output (default true)" default:"true"` + Confirm bool `usage:"Prompt before running potentially dangerous commands"` + Debug bool `usage:"Enable debug logging"` + NoTrunc bool `usage:"Do not truncate long log messages"` + Quiet *bool `usage:"No output logging (set --quiet=false to force on even when there is no TTY)" short:"q"` + Output string `usage:"Save output to a file, or - for stdout" short:"o"` + EventsStreamTo string `usage:"Stream events to this location, could be a file descriptor/handle (e.g. fd://2), filename, or named pipe (e.g. \\\\.\\pipe\\my-pipe)" name:"events-stream-to"` + // Input should not be using GPTSCRIPT_INPUT env var because that is the same value that is set in tool executions + Input string `usage:"Read input from a file (\"-\" for stdin)" short:"f" env:"GPTSCRIPT_INPUT_FILE"` SubTool string `usage:"Use tool of this name, not the first tool in file" local:"true"` Assemble bool `usage:"Assemble tool to a single artifact, saved to --output" hidden:"true" local:"true"` ListModels bool `usage:"List the models available and exit" local:"true"` diff --git a/pkg/engine/cmd.go b/pkg/engine/cmd.go index cb88c1d6..4a697c69 100644 --- a/pkg/engine/cmd.go +++ b/pkg/engine/cmd.go @@ -182,7 +182,7 @@ func appendInputAsEnv(env []string, input string) []string { } } - env = appendEnv(env, "GPTSCRIPT_INPUT_CONTENT", input) + env = appendEnv(env, "GPTSCRIPT_INPUT", input) return env }