From 640ca65c00b74ef7b3db9a9e723c77451e349d50 Mon Sep 17 00:00:00 2001 From: Howard Gil Date: Thu, 1 Aug 2024 17:40:33 -0700 Subject: [PATCH] Fixing FileNotFoundError introduced by timetravel (#327) --- 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