From 531ed3d7469e582ad0b3ff54d2d0f46d745a51ed Mon Sep 17 00:00:00 2001 From: Howard Gil Date: Thu, 1 Aug 2024 17:32:30 -0700 Subject: [PATCH] Adding back except for FileNotFoundError --- agentops/time_travel.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/agentops/time_travel.py b/agentops/time_travel.py index e7638438..be84e190 100644 --- a/agentops/time_travel.py +++ b/agentops/time_travel.py @@ -85,11 +85,14 @@ def check_time_travel_active(): parent_dir = os.path.dirname(script_dir) config_file_path = os.path.join(parent_dir, ".agentops_time_travel.yaml") - with open(config_file_path, "r") as config_file: - config = yaml.safe_load(config_file) - if config.get("Time_Travel_Debugging_Active", True): - manage_time_travel_state(activated=True) - return True + try: + with open(config_file_path, "r") as config_file: + config = yaml.safe_load(config_file) + if config.get("Time_Travel_Debugging_Active", True): + manage_time_travel_state(activated=True) + return True + except FileNotFoundError: + return False return False