Add env. variable to disable log creation while replaying

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
Víctor Mayoral Vilches 2025-06-09 16:42:43 +02:00
parent ad282284ba
commit 182799f956
1 changed files with 5 additions and 0 deletions

View File

@ -33,6 +33,11 @@ def get_session_recorder(workspace_name=None):
DataRecorder: The session recorder instance.
"""
global _session_recorder
# Check if session recording is disabled (e.g., during replay)
if os.environ.get("CAI_DISABLE_SESSION_RECORDING", "").lower() == "true":
return None
if _session_recorder is None:
_session_recorder = DataRecorder(workspace_name)
return _session_recorder