From bcb9f7f3c7e1b7f500688c57cee4624e5dccbd33 Mon Sep 17 00:00:00 2001 From: Vivian Fang Date: Tue, 31 Oct 2023 14:34:32 -0700 Subject: [PATCH] Break out of loop if agent.step succeeds --- memgpt/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/memgpt/main.py b/memgpt/main.py index 57ea9e8b..6f4adb25 100644 --- a/memgpt/main.py +++ b/memgpt/main.py @@ -533,6 +533,7 @@ async def run_agent_loop(memgpt_agent, first, no_verify=False, cfg=None, legacy= elif heartbeat_request: user_message = system.get_heartbeat(constants.REQ_HEARTBEAT_MESSAGE) skip_next_user_input = True + break except Exception as e: print("An exception ocurred when running agent.step(): ") traceback.print_exc()