Skip to content
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

Merged
merged 3 commits into from
May 16, 2023

Conversation

gravelBridge
Copy link
Contributor

@gravelBridge gravelBridge commented May 16, 2023

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

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@vercel
Copy link

vercel bot commented May 16, 2023

Deployment failed with the following error:

Resource is limited - try again in 2 minutes (more than 100, code: "api-deployments-free-per-day").

@vercel
Copy link

vercel bot commented May 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 16, 2023 0:55am

@gravelBridge
Copy link
Contributor Author

gravelBridge commented May 16, 2023

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.

@vercel
Copy link

vercel bot commented May 16, 2023

Deployment failed with the following error:

Resource is limited - try again in 2 hours (more than 100, code: "api-deployments-free-per-day").

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.03 ⚠️

Comparison is base (6c4426d) 62.33% compared to head (4c3414d) 62.30%.

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              
Impacted Files Coverage Δ
autogpt/agent/agent.py 57.41% <50.00%> (-0.41%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@waynehamadi waynehamadi merged commit c04f221 into Significant-Gravitas:master May 16, 2023
@gravelBridge gravelBridge deleted the stop_y-N branch May 16, 2023 03:02
ppetermann pushed a commit to ppetermann/Auto-GPT that referenced this pull request May 22, 2023
…vitas#4230)

* Added feature to interrupt y -N continuous commands.

* Fixed formatting.

---------

Co-authored-by: Nicholas Tindle <[email protected]>
@ntindle ntindle added this to the v0.4.0 Release milestone May 25, 2023
@jacobgrass
Copy link

This worked before, but has not worked in the latest stable versions, at least for me. Can anyone else confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants