-
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
More control over flow ( interrupt command JIT + choose commands to ignore/stop on + stop when looping ) #3914
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
b495d65
to
105ecce
Compare
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
This looks interesting, and like a significant potential UX improvement |
@eyalk11 We're prepping for release v0.4.3. Please resolve conflicts and stand by as we merge. |
OK, I am working on this. it is a bit hard to merge. (merge_int branch in my fork). |
105ecce
to
4827736
Compare
❌ Deploy Preview for auto-gpt-docs failed.
|
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
(There are still some merging issues, will solve) |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3914 +/- ##
==========================================
+ Coverage 51.93% 51.94% +0.01%
==========================================
Files 117 117
Lines 4987 5088 +101
Branches 671 694 +23
==========================================
+ Hits 2590 2643 +53
- Misses 2199 2235 +36
- Partials 198 210 +12
☔ View full report in Codecov by Sentry. |
4827736
to
7e26c5c
Compare
87d0158
to
592514b
Compare
I added test for command_to_stop/ignore. |
1827465
to
f8032a8
Compare
requirements.txt
Outdated
@@ -29,6 +29,7 @@ spacy>=3.0.0,<4.0.0 | |||
en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.5.0/en_core_web_sm-3.5.0-py3-none-any.whl | |||
prompt_toolkit>=3.0.38 | |||
pydantic | |||
frozendict | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyboard not in req file because isn't supported on mac.
autogpt/spinner.py
Outdated
if ( | ||
pressed_key | ||
and pressed_key == key_to_check | ||
or (os.name == "nt" and keyboard.is_pressed(keyboard_key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will work if out of focus
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
@eyalk11 The agent was updated recently, probably the reason for the conflicts. |
f8032a8
to
e028f9f
Compare
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
aadef76
to
ce6ad6d
Compare
ce6ad6d
to
24ad3dd
Compare
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Background
Now it is quite challenging to control the flow. You would need to assume the next N authorised commands are OK, beforehand. If it goes astray, you have nothing to do, but to wait after the batch.
This commit make it possible to interrupt just in time and define commands that are more and less relevant with regard to batch.
Changes
config.commands_to_stop
andconfig.commands_to_ignore
.config.commands_to_stop
would stop after the command anyway. For example, you might want to stop on task completion, anyway.config.commands_to_ignore
are commands that authorized automatically and don't increase the counter.<space>
in the middle of thinking means soft-interrupt complete execution and ask for user input after execution).<q>
means abort - exit task immediately and ask for user input.Have two implementation for linux and windows.
Introduced a function
async_task_and_spin
to wait for either task completion or interrupt.To do so, it keeps all previously executed commands in set.
Documentation
In code
Test Plan
I just checked the code on my own, saw that both soft and hard interrupts working.
commands_to_stop and to_ignore seems to be working.
There was an error in test_memory_trimmed_from_context that seem unrelated.
Want to see if it fails on workflow.
PR Quality Checklist
I didn't add tests because of lack of time. A bit of help is wanted, if you think testing is required for it.
This is how soft interrupt looks like. It keeps thinking afterwards.