@@ -57,7 +57,6 @@ type GPTScript struct {
5757 Assemble bool `usage:"Assemble tool to a single artifact, saved to --output" hidden:"true" local:"true"`
5858 ListModels bool `usage:"List the models available and exit" local:"true"`
5959 ListTools bool `usage:"List built-in tools and exit" local:"true"`
60- ListenAddress string `usage:"Server listen address" default:"127.0.0.1:0"`
6160 Chdir string `usage:"Change current working directory" short:"C"`
6261 Daemon bool `usage:"Run tool as a daemon" local:"true" hidden:"true"`
6362 Ports string `usage:"The port range to use for ephemeral daemon ports (ex: 11000-12000)" hidden:"true"`
@@ -439,8 +438,12 @@ func (r *GPTScript) Run(cmd *cobra.Command, args []string) (retErr error) {
439438
440439 if prg .IsChat () || r .ForceChat {
441440 if ! r .DisableTUI && ! r .Debug && ! r .DebugMessages {
442- return tui .Run (cmd .Context (), args [0 ], tui.RunOptions {
443- TrustedRepoPrefixes : []string {"github.com/gptscript-ai/context" },
441+ // Don't use cmd.Context() because then sigint will cancel everything
442+ return tui .Run (context .Background (), args [0 ], tui.RunOptions {
443+ OpenAIAPIKey : r .OpenAIOptions .APIKey ,
444+ OpenAIBaseURL : r .OpenAIOptions .BaseURL ,
445+ DefaultModel : r .DefaultModel ,
446+ TrustedRepoPrefixes : []string {"github.com/gptscript-ai" },
444447 DisableCache : r .DisableCache ,
445448 Input : strings .Join (args [1 :], " " ),
446449 CacheDir : r .CacheDir ,
0 commit comments