From bca52a8bbf4ec9161fcc12d32e4035bca6b60239 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Fri, 20 Nov 2026 16:14:13 +0000 Subject: [PATCH 1/2] Pin retriever installation to available SDK packages Signed-off-by: zlareb1 --- docs/features/integrations/frameworks.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/features/integrations/frameworks.md b/docs/features/integrations/frameworks.md index 4de98b63bb..4b17e6ce53 100644 --- a/docs/features/integrations/frameworks.md +++ b/docs/features/integrations/frameworks.md @@ -1,10 +1,9 @@ # Agent frameworks and orchestrators The SDKs ship adapters that present Loom through a framework's own memory or retrieval -interface. An adapter needs its framework: in Python, the SDK extra its section names -(`pip install 'clickhouse-loom[langchain]'` and so on); in TypeScript, the framework -package, an optional peer dependency. The LangGraph and Strands adapters import without -their framework. Identity comes from the Loom `Agent` the adapter wraps, and isolation is +interface. An adapter needs its framework: in Python, the SDK extra its section names; +in TypeScript, the framework package, an optional peer dependency. The LangGraph and +Strands adapters import without their framework. Identity comes from the Loom `Agent` the adapter wraps, and isolation is Loom's namespace authorization. Every adapter calls your Loom server through the SDK: the data is stored in your Loom deployment (ClickHouse, and Postgres for live memory under the [Postgres memory authority](../../architecture/storage-authority.md)), and no adapter adds @@ -47,7 +46,7 @@ see [agent integration](../../guides/agent-integration.md) and `LoomKnowledgeRetriever` searches the namespace's documents (`knowledge.search`) and `LoomMemoryRetriever` its memories (`memory.search`). Both are LangChain `BaseRetriever`s, so they work with `invoke`, in a chain, and as an agent tool through -`create_retriever_tool`. Install with `pip install 'clickhouse-loom[langchain]'` +`create_retriever_tool`. Install with `pip install 'clickhouse-loom[langchain]==1.3.0rc1'` (`langchain-core` 1.x). ```python @@ -91,9 +90,11 @@ families. A LangChain agent built with `create_agent` runs on LangGraph: pass `LoomStore` (below) as its `store` for long-term memory. -The TypeScript retrievers extend `BaseRetriever` from `@langchain/core` (an optional peer -dependency, 1.x) and take the same options in camelCase, with the memory retriever's -user, session, run and agent in one `scope`: +Install the TypeScript SDK and its framework peer with +`npm install @clickhouse/loom@1.3.0-rc.1 '@langchain/core@^1.0.0'`. +The TypeScript retrievers extend `BaseRetriever` from `@langchain/core` and take the same +options in camelCase, with the memory retriever's user, session, run and agent in one +`scope`: ```ts import { From 66e22fcc0b71401e740cfe847d79c9fc45a68776 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Fri, 20 Nov 2026 17:22:15 +0000 Subject: [PATCH 2/2] LangChain examples select published SDK artifacts Install the matching stable SDKs and the declared native peer. Validation fixtures establish a post-exec witness and completed backend termination before checking successor ownership. Reuses the complete published witness repair from 9ffae961d4200bbb6ec57be37fa5ac9803cef8c1 (#1046). Signed-off-by: zlareb1 --- docs/features/integrations/frameworks.md | 4 +- tests/integration/test_cell_control_fence.py | 4 +- tests/unit/test_provider_zombie_exit.py | 46 ++++++++++++-------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/docs/features/integrations/frameworks.md b/docs/features/integrations/frameworks.md index 4b17e6ce53..0527d00365 100644 --- a/docs/features/integrations/frameworks.md +++ b/docs/features/integrations/frameworks.md @@ -46,7 +46,7 @@ see [agent integration](../../guides/agent-integration.md) and `LoomKnowledgeRetriever` searches the namespace's documents (`knowledge.search`) and `LoomMemoryRetriever` its memories (`memory.search`). Both are LangChain `BaseRetriever`s, so they work with `invoke`, in a chain, and as an agent tool through -`create_retriever_tool`. Install with `pip install 'clickhouse-loom[langchain]==1.3.0rc1'` +`create_retriever_tool`. Install with `pip install 'clickhouse-loom[langchain]==1.3.0'` (`langchain-core` 1.x). ```python @@ -91,7 +91,7 @@ A LangChain agent built with `create_agent` runs on LangGraph: pass `LoomStore` as its `store` for long-term memory. Install the TypeScript SDK and its framework peer with -`npm install @clickhouse/loom@1.3.0-rc.1 '@langchain/core@^1.0.0'`. +`npm install @clickhouse/loom@1.3.0 '@langchain/core@^1.0.0'`. The TypeScript retrievers extend `BaseRetriever` from `@langchain/core` and take the same options in camelCase, with the memory retriever's user, session, run and agent in one `scope`: diff --git a/tests/integration/test_cell_control_fence.py b/tests/integration/test_cell_control_fence.py index 9d9a2d2151..e18e3e4b3e 100644 --- a/tests/integration/test_cell_control_fence.py +++ b/tests/integration/test_cell_control_fence.py @@ -393,7 +393,9 @@ async def mutate(conn, found): old = await claim(client, await read(client)) task = asyncio.create_task(client.post("/test-finalize/first", json=expected(old))) await asyncio.wait_for(started.wait(), 3) - await local_admin.execute("SELECT pg_terminate_backend($1)", a.get_server_pid()) + assert await local_admin.fetchval( + "SELECT pg_terminate_backend($1, 5000)", a.get_server_pid() + ) await apg.take_lock(b, "new controller") newer = await claim(client, await read(client)) diff --git a/tests/unit/test_provider_zombie_exit.py b/tests/unit/test_provider_zombie_exit.py index db6bd2868f..411a17812d 100644 --- a/tests/unit/test_provider_zombie_exit.py +++ b/tests/unit/test_provider_zombie_exit.py @@ -4,6 +4,8 @@ import os import select import signal +import subprocess +import sys import threading import time from pathlib import Path @@ -41,16 +43,18 @@ def _wait_owned(pid: int, start: str) -> int: def test_an_exact_single_thread_zombie_is_proven_stopped_before_wait() -> None: """A captured child has exited, even while its parent retains the wait status.""" - read_fd, write_fd = os.pipe() - pid = os.fork() - if pid == 0: - os.close(write_fd) - os.read(read_fd, 1) - os._exit(0) - os.close(read_fd) - start = None - released = False + # Fork hooks can start exporter threads; exec gives this witness one thread. + child = subprocess.Popen( + [sys.executable, "-I", "-c", "import os; os.write(1, b'r'); os.read(0, 1)"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + env={}, + ) + assert child.stdin is not None and child.stdout is not None + pid = child.pid try: + assert select.select([child.stdout], [], [], 2.0)[0] == [child.stdout] + assert child.stdout.read(1) == b"r" state, parent, start, threads = _stat(pid) assert state != "Z" and parent == os.getpid() and threads == 1 proof = provider_process.host_proof().split("|") @@ -61,8 +65,8 @@ def test_an_exact_single_thread_zombie_is_proven_stopped_before_wait() -> None: wrong_namespace = proof.copy() wrong_namespace[3] = str(int(proof[3]) + 1) assert not provider_process.proves_stopped("|".join(wrong_namespace)) - os.write(write_fd, b"x") - released = True + child.stdin.write(b"x") + child.stdin.flush() end = time.monotonic() + 2.0 while time.monotonic() < end: state, parent, observed_start, threads = _stat(pid) @@ -75,14 +79,18 @@ def test_an_exact_single_thread_zombie_is_proven_stopped_before_wait() -> None: ) assert provider_process.proves_stopped(exact) finally: - if not released: - os.write(write_fd, b"x") - os.close(write_fd) - if start is None: - _, parent, start, _ = _stat(pid) - assert parent == os.getpid() - status = _wait_owned(pid, start) - assert os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0 + child.stdin.close() + try: + status = child.wait(timeout=2.0) + except subprocess.TimeoutExpired: + child.kill() + child.wait(timeout=2.0) + raise AssertionError( + "Owned witness child did not settle within cleanup allowance" + ) from None + finally: + child.stdout.close() + assert status == 0 assert provider_process.proves_stopped(exact), "After waitpid, absence proves death"