Skip to content

Commit

Permalink
Fixing FileNotFoundError introduced by timetravel (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG authored Aug 2, 2024
1 parent 4fe5b37 commit 640ca65
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions agentops/time_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 640ca65

Please sign in to comment.