diff --git a/pyproject.toml b/pyproject.toml index f826b132..80f9a1a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-langchain" -version = "0.3.3" +version = "0.3.4" description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath_langchain/runtime/factory.py b/src/uipath_langchain/runtime/factory.py index afad695a..0bb88542 100644 --- a/src/uipath_langchain/runtime/factory.py +++ b/src/uipath_langchain/runtime/factory.py @@ -62,6 +62,8 @@ def _setup_instrumentation(self, trace_manager: UiPathTraceManager | None) -> No def _get_connection_string(self) -> str: """Get the database connection string.""" + print(f"DEBUG: runtime_dir = {repr(self.context.runtime_dir)}") + print(f"DEBUG: state_file = {repr(self.context.state_file)}") if self.context.runtime_dir and self.context.state_file: path = os.path.join(self.context.runtime_dir, self.context.state_file) if not self.context.resume and self.context.job_id is None: @@ -69,10 +71,12 @@ def _get_connection_string(self) -> str: if os.path.exists(path): os.remove(path) os.makedirs(self.context.runtime_dir, exist_ok=True) + print(f"DEBUG: path = {repr(path)}") return path default_path = os.path.join("__uipath", "state.db") os.makedirs(os.path.dirname(default_path), exist_ok=True) + print(f"DEBUG: defaultpath = {repr(default_path)}") return default_path async def _get_memory(self) -> AsyncSqliteSaver: @@ -80,6 +84,28 @@ async def _get_memory(self) -> AsyncSqliteSaver: async with self._memory_lock: if self._memory is None: connection_string = self._get_connection_string() + print(f"DEBUG: connection_string = {repr(connection_string)}") + print( + f"DEBUG: Does parent dir exist? {os.path.exists(os.path.dirname(connection_string))}" + ) + print(f"DEBUG: Parent dir = {repr(os.path.dirname(connection_string))}") + print( + f"DEBUG: Can write to parent? {os.access(os.path.dirname(connection_string), os.W_OK)}" + ) + print( + f"DEBUG: Does database file exist? {os.path.exists(connection_string)}" + ) + + # Try to create a test file to verify we can write + test_file = connection_string + ".test" + try: + with open(test_file, "w") as f: + f.write("test") + print(f"DEBUG: Successfully created test file at {test_file}") + os.remove(test_file) + except Exception as e: + print(f"DEBUG: FAILED to create test file: {e}") + self._memory_cm = AsyncSqliteSaver.from_conn_string(connection_string) self._memory = await self._memory_cm.__aenter__() await self._memory.setup() @@ -308,6 +334,7 @@ async def new_runtime( async def dispose(self) -> None: """Cleanup factory resources.""" + print("DEBUG: Disposing UiPathLangGraphRuntimeFactory resources...") for loader in self._graph_loaders.values(): await loader.cleanup() diff --git a/uv.lock b/uv.lock index 812eed82..13fc66e3 100644 --- a/uv.lock +++ b/uv.lock @@ -3282,7 +3282,7 @@ wheels = [ [[package]] name = "uipath-langchain" -version = "0.3.3" +version = "0.3.4" source = { editable = "." } dependencies = [ { name = "aiosqlite" },