-
Notifications
You must be signed in to change notification settings - Fork 44.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added feature to interrupt y -N continuous commands. #4230
Added feature to interrupt y -N continuous commands. #4230
Conversation
Deployment failed with the following error:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Waiting for @merwanehamadi pr: #4222 to be merged to fix the failing check that I am experiencing. After that has been merged, this PR is good to be reviewed/merged. |
Deployment failed with the following error:
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4230 +/- ##
==========================================
- Coverage 62.33% 62.30% -0.03%
==========================================
Files 73 73
Lines 3329 3337 +8
Branches 480 481 +1
==========================================
+ Hits 2075 2079 +4
- Misses 1107 1111 +4
Partials 147 147
☔ View full report in Codecov by Sentry. |
…vitas#4230) * Added feature to interrupt y -N continuous commands. * Fixed formatting. --------- Co-authored-by: Nicholas Tindle <[email protected]>
This worked before, but has not worked in the latest stable versions, at least for me. Can anyone else confirm? |
Background
Currently, there is no feature to interrupt Auto-GPT during y -N continuous commands without exiting the entire program. This feature allows the user to interrupt y -N to provide feedback or stop the bot at a command. This issue is referenced in:
#1472
#2481
#2291
#3083
Special thanks @james-coder, @ehei and @adrianegraphene for bringing this feature up and your valuable contributions. If I forgot to mention you here, please alert me, and I will fix it. Thank you!
Thank you to all the contributors who brought this issue up! We have opted for this approach, but we genuinely appreciate your contributions. 😁
Changes
Added the imports signal, and sys in for signal and sys.exit() to work. The code adds a signal handler that is called when Control-C is execute, and checks if y -N is currently running. If it is, the code sets N to 0, and continues. However, if N is already 0, meaning the user just wants to stop the program, the program is executed normally.
Documentation
I added a comment defining what my new function does.
Test Plan
I have tested this functionality with and without y -N, and both have worked as intended.
PR Quality Checklist