Closed jshigetomi closed 4 months ago
Left some comments. Not done yet. Will be reviewing the
Model
code.A feedback from Steve:
You display
powershell:
andpython:
for the code about to run to let the user know what code that is. The feedback is to make that a comment of the corresponding language. For both powershell and python, a comment starts with#
, so it would be nice if you can change the above display to be like:# powershell az --version
and similarly, for any python code, make it
# python
instead ofpython:
I made the changes in the function calling model. However, the text based model, the code is displayed in the AI's response. I will modify the response rules and see how well that works.
https://github.com/PowerShell/ShellCopilot/pull/107#discussion_r1575405573
When user cancels code execution Run will throw a canceled exception. This is caught in CodeExecutionService and returns a "Code run cancelled message" to be logged in chat history.
In subprocesslanguage, the code continues to run and populates OutputQueue and done could be set or not set.
On the next code execution cycle, OutputQueue is cleared and Done is reset. This prevents old code output.
However If the code is taking a long time, like find all prime numbers between 1 and 2 million and you cancelled out of this. This would still be running by the next execution cycle... There must be a way to send CTRL ^C to the process to stop the code from running. Will look into this further...
-Added KeyboardInterrupt detection in HandleErrorOutput method for python process. -Ctrl^C is forwarded to pwsh process and will cancel the code. No detection seems to be needed. -Now long running code like "print all primes from 1 to 2 million" can be cancelled for python and powershell. -Ctrl^C immediately stops execution and renders "Code run cancelled". -Because code execution immediately stopped, no more output is expected.
@jshigetomi please add your README.md file to this PR so I can add comments/review
@StevenBucher98 ReadMe Added
Thank you Dongbo for combing through my code and teaching me all kinds of tips and tricks!
Thank you Steven for the robust ReadMe updates!
I appreciate ya'll taking your time with my project.
PR Summary
PR Context