From 502b80a1495032443264c5047d4cd33e16ca89b5 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 13:34:07 +0300 Subject: [PATCH 1/3] fix(pipeline): fall back to PATH lookup for cocoindex binary When installed via `pip install --user`, scripts land in ~/Library/Python/X.Y/bin/ while sys.executable points to the framework Python elsewhere. The new fallback uses shutil.which() to find cocoindex on PATH when it's not next to the interpreter. Co-Authored-By: Claude Opus 4.7 --- java_codebase_rag/pipeline.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/java_codebase_rag/pipeline.py b/java_codebase_rag/pipeline.py index 16cd6b5b..2cd1eedd 100644 --- a/java_codebase_rag/pipeline.py +++ b/java_codebase_rag/pipeline.py @@ -2,6 +2,7 @@ from __future__ import annotations import os +import shutil import subprocess import sys import threading @@ -19,7 +20,13 @@ def bundle_dir() -> Path: def cocoindex_bin() -> Path: - return Path(sys.executable).parent / "cocoindex" + candidate = Path(sys.executable).parent / "cocoindex" + if candidate.is_file(): + return candidate + found = shutil.which("cocoindex") + if found: + return Path(found) + return candidate class _LineFilter: From cf8c43a618a0d0012d89d28d5e2aff45c989dbb2 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 13:44:44 +0300 Subject: [PATCH 2/3] fix(pipeline): update cocoindex error message for PATH-found binaries "next to Python" is misleading when the binary comes from PATH via shutil.which(). Updated error and matching test assertion. Co-Authored-By: Claude Opus 4.7 --- java_codebase_rag/pipeline.py | 4 ++-- tests/test_java_codebase_rag_cli.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java_codebase_rag/pipeline.py b/java_codebase_rag/pipeline.py index 2cd1eedd..f1d34270 100644 --- a/java_codebase_rag/pipeline.py +++ b/java_codebase_rag/pipeline.py @@ -117,7 +117,7 @@ def run_cocoindex_update( args=[str(exe)], returncode=127, stdout="", - stderr=f"cocoindex not found next to Python: {exe}", + stderr=f"cocoindex not found: {exe}", ) bd = bundle_dir() flow = bd / "java_index_flow_lancedb.py" @@ -179,7 +179,7 @@ def run_cocoindex_drop(env: dict[str, str], *, quiet: bool) -> subprocess.Comple args=[str(exe)], returncode=127, stdout="", - stderr=f"cocoindex not found next to Python: {exe}", + stderr=f"cocoindex not found: {exe}", ) bd = bundle_dir() cmd = [str(exe), "drop", COCOINDEX_TARGET, "-f"] diff --git a/tests/test_java_codebase_rag_cli.py b/tests/test_java_codebase_rag_cli.py index 892fa77e..1d67cb77 100644 --- a/tests/test_java_codebase_rag_cli.py +++ b/tests/test_java_codebase_rag_cli.py @@ -784,7 +784,7 @@ def fake_coco(*_a: object, **_k: object) -> subprocess.CompletedProcess[str]: args=["/nonexistent/cocoindex"], returncode=127, stdout="", - stderr="cocoindex not found next to Python", + stderr="cocoindex not found", ) monkeypatch.setattr(cli_mod, "run_cocoindex_update", fake_coco) From 03ca3fcc91a28b095011ba768cca306b0419e2b8 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 13:46:26 +0300 Subject: [PATCH 3/3] chore: bump version to 0.3.1 Co-Authored-By: Claude Opus 4.7 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 60f96b72..2cf7ce8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "java-codebase-rag" -version = "0.3.0" +version = "0.3.1" description = "MCP server for semantic + structural search over Java codebases" readme = "README.md" requires-python = ">=3.11"