Skip to content

Commit 5235065

Browse files
committed
fix: remove previous graph state at debug
1 parent 86343b7 commit 5235065

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/uipath_langchain/_cli/_runtime/_runtime.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import logging
3+
import os
34
from typing import List, Optional
45

56
from langchain_core.callbacks.base import BaseCallbackHandler
@@ -54,6 +55,11 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
5455
tracer = None
5556

5657
try:
58+
if self.context.resume is False and self.context.job_id is None:
59+
# Delete the previous graph state file at debug time
60+
if os.path.exists(self.state_file_path):
61+
os.remove(self.state_file_path)
62+
5763
async with AsyncSqliteSaver.from_conn_string(
5864
self.state_file_path
5965
) as memory:

0 commit comments

Comments
 (0)