From 5235065f29deeb9225df31809bc08ef1b71d6b22 Mon Sep 17 00:00:00 2001 From: Cristian Pufu Date: Mon, 14 Apr 2025 08:54:00 +0300 Subject: [PATCH] fix: remove previous graph state at debug --- src/uipath_langchain/_cli/_runtime/_runtime.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/uipath_langchain/_cli/_runtime/_runtime.py b/src/uipath_langchain/_cli/_runtime/_runtime.py index a2cefe2e..ff567a07 100644 --- a/src/uipath_langchain/_cli/_runtime/_runtime.py +++ b/src/uipath_langchain/_cli/_runtime/_runtime.py @@ -1,5 +1,6 @@ import json import logging +import os from typing import List, Optional from langchain_core.callbacks.base import BaseCallbackHandler @@ -54,6 +55,11 @@ async def execute(self) -> Optional[UiPathRuntimeResult]: tracer = None try: + if self.context.resume is False and self.context.job_id is None: + # Delete the previous graph state file at debug time + if os.path.exists(self.state_file_path): + os.remove(self.state_file_path) + async with AsyncSqliteSaver.from_conn_string( self.state_file_path ) as memory: