fix(reprocess): resolve cocoindex via PATH, not just next-to-python#410
Merged
Merged
Conversation
`reprocess` (no flags) routed through `server.run_refresh_pipeline`, which hardcoded `Path(sys.executable).parent / "cocoindex"` and ignored PATH — unlike the sync path (`pipeline.cocoindex_bin`) used by init/increment/ `reprocess --vectors-only`, which falls back to `shutil.which`. So a legit console-script location (e.g. `~/.local/bin` from `pip install --user`) made `reprocess` fail with "cocoindex not found next to Python" while every sibling command succeeded on the same install. Reuse the shared `cocoindex_bin()` helper so both paths resolve identically, and clarify the not-found message to name both locations checked. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
java-codebase-rag reprocess(no flags) failed withcocoindex not found next to pythonon installs where thecocoindexconsole script lives away from the venv python — e.g.~/.local/binfrompip install --user— even though cocoindex was installed, importable, and onPATH.Meanwhile every sibling command worked on the same install:
cocoindexviainit,increment,reprocess --vectors-only,eraseshutil.which(PATH)reprocess(no flags)The two code paths disagreed: the sync path (
pipeline.cocoindex_bin,pipeline.py:45) falls back toshutil.which; the async path (server.run_refresh_pipeline,server.py:425) checked onlyPath(sys.executable).parent / "cocoindex".Fix
server.run_refresh_pipelinenow reuses the sharedpipeline.cocoindex_bin()helper (imported asresolve_cocoindex_bin) instead of hardcoding the next-to-python path. Both paths now resolve cocoindex identically. The not-found message now names both locations checked.Tests
test_cocoindex_bin_falls_back_to_path— unit guard on the helper's PATH fallback (shutil.which).test_refresh_pipeline_resolves_cocoindex_via_path_not_next_to_python— regression: withvector_stack_installed=Trueand cocoindex reachable only via PATH,run_refresh_pipelinespawns cocoindex instead of short-circuiting to the not-found failure.Verification
tests/package/test_graph_only_boot.py— 6 passedtests/package/ tests/mcp/— 691 passed, 5 skippedtable_names()deprecation, an unrelated FastMCP coroutine warning)Workaround for users on existing installs (before this ships)
reprocess --graph-only && reprocess --vectors-only, or reinstall cocoindex into the same venv asjava-codebase-rag.🤖 Generated with Claude Code