From 01ac8d505fd60fc08c513fb5b3a0b18c75966b78 Mon Sep 17 00:00:00 2001 From: Cyrus <39694513+cyrus-hawk@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:25:12 +0300 Subject: [PATCH] hot fix the SIGINT handler (#4997) 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 --- autogpt/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autogpt/utils.py b/autogpt/utils.py index 9eb6cbe4ba89..28c4be517fee 100644 --- a/autogpt/utils.py +++ b/autogpt/utils.py @@ -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")