Closed hcal closed 8 months ago
This is actually a bug, --shell
should not have access to functions. It is not particularly useful in the context of generating pure shell commands. Functions should only work with the default and custom roles. I tested it with default role sgpt --repl temp
, and it works as expected. We will remove function calls from repl --shell/code
in upcoming releases.
in powershell, it acts as follows:
>>> what is current folder?
```powershell
Get-Location
e
powershell : The term '
powershell' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ CategoryInfo : ObjectNotFound: (`powershell:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
```
I attempted to replicate the issue using the command from the initial comment. It appears that --shell
used immediately after --repl
is just creating a session called "--shell".
Instead, the issue seems to be broader and occurs whenever the --chat
or --repl
flags are used and a function is called. sgpt outputs the function string, but then it doesn't manage to output the expected answer.
I've encountered a potential issue or unexpected behavior with ShellGPT's REPL mode when using the --repl --shell options. I'm not 100% sure if this is a bug or if I'm not using the feature correctly.
Issue Description
When using the
sgpt --repl --shell
command and then asking it to list files in the current directory, the command's behavior is inconsistent between executions. Initially, the command executes but does not produce any output. Repeating the same command immediately after results in the expected output being displayed. Steps to ReproduceNote the command I issued 'list files in this dir' twice and how the first time didn't product output following the "@FunctionCall" notice.
Expected Behavior
I expected the command run a function and list the files and directories upon the first execution without needing to repeat the command for output.
Actual Behavior
The command needs to be executed twice to produce the expected output. The first execution runs the function without any visible output, and the second execution displays the correct information without seemingly running the function again. Additional Information
I observed similar behavior with other commands that produce output, such as interactions with Task Warrior, which worked impressively well without additional configuration.
Is this behavior a bug, or am I missing a step in setting up or using the --repl --shell mode incorrectly?