From f2d6d16347478e2dac35a38a4bd8b7035e87ec9b Mon Sep 17 00:00:00 2001 From: milind-jain-uipath Date: Thu, 7 May 2026 14:51:22 +0530 Subject: [PATCH 1/2] fix: keep context tool backwards-compatible with pre-v48 agent bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DataFabric PR (#726) added `assert resource.context_type is not None` at the top of `create_context_tool`. Agents packaged with storage-schema < v48 don't carry a `contextType` field, so the assert fires at runtime and the agent fails to start. The downstream `context_type == DATA_FABRIC_ENTITY_SET` check already short-circuits correctly when `context_type` is None, and the semantic-search / deep-rag / batch-transform handlers don't read `context_type` at all — they branch on `settings.retrieval_mode`, which legacy bundles always populate. So removing the assert restores the pre-PR behaviour for legacy bundles without affecting v48+ flows. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/uipath_langchain/agent/tools/context_tool.py | 1 - tests/agent/tools/test_context_tool.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/uipath_langchain/agent/tools/context_tool.py b/src/uipath_langchain/agent/tools/context_tool.py index 062a5426e..8a6f95c3f 100644 --- a/src/uipath_langchain/agent/tools/context_tool.py +++ b/src/uipath_langchain/agent/tools/context_tool.py @@ -150,7 +150,6 @@ def create_context_tool( llm: BaseChatModel | None = None, agent: LowCodeAgentDefinition | None = None, ) -> StructuredTool | BaseTool | None: - assert resource.context_type is not None tool_name = sanitize_tool_name(resource.name) if resource.context_type == AgentContextType.DATA_FABRIC_ENTITY_SET: diff --git a/tests/agent/tools/test_context_tool.py b/tests/agent/tools/test_context_tool.py index c1f7f6375..1d2074237 100644 --- a/tests/agent/tools/test_context_tool.py +++ b/tests/agent/tools/test_context_tool.py @@ -396,6 +396,19 @@ def test_case_insensitive_retrieval_mode(self, deep_rag_config): result = create_context_tool(deep_rag_config) assert isinstance(result, StructuredToolWithArgumentProperties) + def test_legacy_none_context_type_semantic_search(self, semantic_search_config): + # Agents packaged with storage-schema < v48 have no contextType field. + semantic_search_config.context_type = None + result = create_context_tool(semantic_search_config) + assert isinstance(result, StructuredToolWithOutputType) + assert result.name == "test_semantic_search" + + def test_legacy_none_context_type_deep_rag(self, deep_rag_config): + deep_rag_config.context_type = None + result = create_context_tool(deep_rag_config) + assert isinstance(result, StructuredToolWithArgumentProperties) + assert result.name == "test_deep_rag" + class TestHandleSemanticSearch: """Test cases for handle_semantic_search function.""" From 8c193cb88f532475cee8137a885238ed9e435072 Mon Sep 17 00:00:00 2001 From: milind-jain-uipath Date: Thu, 7 May 2026 14:56:13 +0530 Subject: [PATCH 2/2] chore: bump package version - 0.10.18 Includes the context_type backwards-compatibility fix so legacy agent bundles (storage-schema < v48) start cleanly under the new release. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c80e846c3..1c904384e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-langchain" -version = "0.10.17" +version = "0.10.18" 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/uv.lock b/uv.lock index d2c568371..f9d8993b2 100644 --- a/uv.lock +++ b/uv.lock @@ -4375,7 +4375,7 @@ wheels = [ [[package]] name = "uipath-langchain" -version = "0.10.17" +version = "0.10.18" source = { editable = "." } dependencies = [ { name = "a2a-sdk" },