AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Adding pause capability. Hold SHIFT and press P Twice

Open adrianegraphene opened this issue 2 years ago • 14 comments

Background

Added the ability to pause a continuous loop. When we input "y -X", where X is some number, there is a desire to be able to pause the AI and input some human feedback, then have the AI continue on its trajectory, as noted here #563

Changes

Uses can pause a long loop with just 3 key presses. Hold "SHIFT" and press "P" twice. Then users can enter feedback + have the loop automatically continue.

"Shift + P + P"

User friendly UX On the 2nd iteration of a loop, the message "Thinking...." changes to "Thinking... Hold Shift & press 'P' twice to give feedback to the AI"

Documentation

The person must click into the same code window where the code originally ran, then hold "Shift" + hit "p" twice "SHIFT + P + P" will bring pause the loop on the next run, so that someone can entire feedback to the AI. This way, instead of having to stop a long loop, you can just pause it, give feedback, and have the loop continue.

The clicks will not be detected if the active windows is something besides the running code window.

Test Plan

Tested several iterations on Windows, to ensure that expected behavior is experienced (it is).

Request that someone tests this on Linux.

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

Edit: Updated with documentation on README

adrianegraphene avatar Apr 17 '23 02:04 adrianegraphene

There seems to be an issue when trying this command after a few hundred repetitions (>~300) . Edit: It turns out this is just a function of the natural complexities that arise with long continuous loops, and not due to the pause capabilities this PR brings.

adrianegraphene avatar Apr 17 '23 06:04 adrianegraphene

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 16:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 16:04 github-actions[bot]

We need to push this, this is huge! Can anyone help the gentleman get this to master and stable after? https://github.com/Significant-Gravitas/Auto-GPT/discussions/563#discussion-5060916

GoMightyAlgorythmGo avatar Apr 18 '23 19:04 GoMightyAlgorythmGo

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 19 '23 00:04 github-actions[bot]

Thanks. I just updated this to the latest mater and tested it on Windows again. It performs as expected.

I feel I might be missing some basic code etiquette (not sure if I should add the new modules to requirements.txt or not). Please advisel

adrianegraphene avatar Apr 19 '23 01:04 adrianegraphene

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 19 '23 23:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 20 '23 04:04 github-actions[bot]

Give my compliments to whoever wrote these github actions. Very nice documentation throughout. I added a final visual touch with magenta coloring for the prompt users get after pausing a loop. Should be good to go now. It's feeling a lot cleaner lately - can't wait to play with this more.

adrianegraphene avatar Apr 20 '23 05:04 adrianegraphene

Added documentation to README.md and tested the "--continuous" loop flag to verify the expected "pause" behavior exists there. Note: once your are in "paused mode", if you hold "Shift + P" down while typing, your prompt.... the notification message will appear, but it does not affect your input. Annoying, but is an edge case that only appears in "paused mode". LMK if I need to address that edge-case before this can be merged - I think the added functionality is greater than that minor edge-case, & support merging this PR as is. Open to thoughts, thx.

adrianegraphene avatar Apr 22 '23 00:04 adrianegraphene

win10 python3.9

I added the code to the document, but holding shitf+p+p does not pause

z-x-x136 avatar Apr 22 '23 05:04 z-x-x136

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 22 '23 12:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 22 '23 13:04 github-actions[bot]

@z-x-x136 This may have been an issue with requirements.txt not having pyinput. I have just updated that. Could you pip install -r requirements.txt and try again? Thank you.

adrianegraphene avatar Apr 22 '23 13:04 adrianegraphene

So, I'm having a heck of a time trying to figure out how to get this PR merged with the GitHub actions. The pause code works well as-is. There's just some GitHub actions blocking me that I don't understand how to get around.

I keep getting errors on "Sponsors" and others. Can anyone let me know what steps I should take to complete this?


0s
Run JamesIves/github-sponsors-readme-action@v1

    GitHub Sponsors Readme Action 💖

    🚀 Getting Started Guide: https://github.com/JamesIves/github-sponsors-readme-action
    ❓ Discussions / Q&A: https://github.com/JamesIves/github-sponsors-readme-action/discussions
    🔧 Report a Bug: https://github.com/JamesIves/github-sponsors-readme-action/issues

    📣 Maintained by James Ives: https://jamesiv.es/
    💖 Support: https://github.com/sponsors/JamesIves
Checking configuration and initializing… 🚚
Error: No deployment token was provided. You must provide the action with a Personal Access Token scoped to user:read or org:read.
There was an error generating sponsors. ❌

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

I think what I have added here is not correct. https://github.com/Significant-Gravitas/Auto-GPT/pull/2069/commits/ed2a2c67b2357170151edc33d4309812a02c9d35

So I am going to put my efforts here on pause until I can get some feedback.

adrianegraphene avatar Apr 24 '23 00:04 adrianegraphene

Hey looks like your git changes got a bit muddy. You can fix them the old fashion way by cloning the repo somewhere else and reapplying them in one commit and making a new PR or you can try and clean you fit history. I recommend the first because cleaning your history through a week of progress in this repo will be exceptionally painful

ntindle avatar Apr 24 '23 00:04 ntindle

Thanks, I'll resubmit fresh. Shouldn't be difficult that way.

adrianegraphene avatar Apr 24 '23 02:04 adrianegraphene

I am closing this PR in favor of PR #3083, which has the same functionality - but is less messy.

adrianegraphene avatar Apr 24 '23 03:04 adrianegraphene

@ntindle If you're open to supporting this pause capability - I've got the new PR here #3083. Thanks for the tip! It does look much cleaner now.

adrianegraphene avatar Apr 24 '23 03:04 adrianegraphene