Skip to content

Commit

Permalink
hot fix the SIGINT handler (#4997)
Browse files Browse the repository at this point in the history
The signal handler in the autogpt/main.py doesn't work properly because
of the clean_input(...) func. This commit remedies this issue. The issue
is mentioned in
https://github.com/Significant-Gravitas/Auto-GPT/pull/4799/files/3966cdfd694c2a80c0333823c3bc3da090f85ed3#r1264278776
  • Loading branch information
cyrus-hawk authored Jul 17, 2023
1 parent 3966cdf commit 01ac8d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autogpt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def clean_input(config: Config, prompt: str = "", talk=False):

# ask for input, default when just pressing Enter is y
logger.info("Asking user via keyboard...")
answer = session.prompt(ANSI(prompt))

# handle_sigint must be set to False, so the signal handler in the
# autogpt/main.py could be employed properly. This referes to
# https://github.com/Significant-Gravitas/Auto-GPT/pull/4799/files/3966cdfd694c2a80c0333823c3bc3da090f85ed3#r1264278776
answer = session.prompt(ANSI(prompt), handle_sigint=False)
return answer
except KeyboardInterrupt:
logger.info("You interrupted Auto-GPT")
Expand Down

0 comments on commit 01ac8d5

Please sign in to comment.