From 8b6dd81480896c1098e0d19f0c0ca58578b3f506 Mon Sep 17 00:00:00 2001 From: Anthony Byram Date: Wed, 19 Aug 2026 09:21:05 -0400 Subject: [PATCH 1/2] fix: pin tree-sitter below 0.26.0 to fix segfault in make test tree-sitter 0.26.0 reimplemented Point as a native tuple subclass (replacing the namedtuple), and that reimplementation has a memory safety bug that corrupts the heap when Point objects are repeatedly constructed/discarded, as chunking.py and query/__init__.py do. The corruption doesn't crash immediately, so `make test` segfaulted at different, seemingly unrelated tests across runs. Pinning to >=0.25.1,<0.26.0 (still excluding the aarch64-linux-broken 0.25.0) eliminates the crash. Also widen the exception handling in chunking.py's parser lookup to catch tree_sitter_language_pack's own Error hierarchy, not just LookupError: the currently locked tree_sitter_language_pack (1.14.3) raises DownloadError for an unrecognized language instead of the LookupError it used to raise, and normalize the re-raised exception back to LookupError so callers keep the same contract. --- pyproject.toml | 2 +- src/vectorcode/chunking.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01fd3b28..eecd0855 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "numpy", "psutil", "httpx", - "tree-sitter!=0.25.0", + "tree-sitter>=0.25.1,<0.26.0", "tree-sitter-language-pack", "pygments", "transformers>=4.36.0,!=4.51.0,!=4.51.1,!=4.51.2", diff --git a/src/vectorcode/chunking.py b/src/vectorcode/chunking.py index 89e30ad1..475112a4 100644 --- a/src/vectorcode/chunking.py +++ b/src/vectorcode/chunking.py @@ -12,6 +12,7 @@ from pygments.util import ClassNotFound from tree_sitter import Node, Point from tree_sitter_language_pack import SupportedLanguage, get_parser +from tree_sitter_language_pack import Error as TreeSitterLanguagePackError from vectorcode.cli_utils import Config @@ -370,11 +371,10 @@ def __get_parser_from_config(self, file_path: str): f"\nInvalid regex pattern '{pattern}' for language '{language}' in filetype_map" ) raise - except LookupError as e: - e.add_note( - f"\nTreeSitter Parser for language '{language}' not found. Please check your filetype_map config." - ) - raise + except (LookupError, TreeSitterLanguagePackError) as e: + raise LookupError( + f"TreeSitter Parser for language '{language}' not found. Please check your filetype_map config." + ) from e logger.debug(f"No matching filetype map entry found for {filename}.") return None @@ -412,7 +412,7 @@ def chunk( language, ) break - except LookupError: # pragma: nocover + except (LookupError, TreeSitterLanguagePackError): # pragma: nocover pass if parser is None: From dac873adb535ef814099f95f07c8e267612f4fe3 Mon Sep 17 00:00:00 2001 From: Anthony Byram Date: Fri, 21 Aug 2026 11:01:19 -0400 Subject: [PATCH 2/2] fix: update test to filter out onnxruntime know issue of extra warnings in stderr in GitHub Linux runners https://github.com/microsoft/onnxruntime/issues/27268 --- tests/test_cli_utils.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/test_cli_utils.py b/tests/test_cli_utils.py index bd10efc5..712df697 100644 --- a/tests/test_cli_utils.py +++ b/tests/test_cli_utils.py @@ -210,9 +210,7 @@ async def test_load_config_file_invalid_json(): @pytest.mark.asyncio async def test_load_from_default_config(): for name in ("config.json5", "config.json"): - with ( - tempfile.TemporaryDirectory() as fake_home, - ): + with (tempfile.TemporaryDirectory() as fake_home,): os.environ.update({"HOME": fake_home}) config_path = os.path.join(fake_home, ".config", "vectorcode", name) config_dir = os.path.join(fake_home, ".config", "vectorcode") @@ -562,14 +560,23 @@ def test_cleanup_path(): def test_shtab(): for shell in ("bash", "zsh", "tcsh"): - assert ( - subprocess.Popen( - [sys.executable, "-m", "vectorcode.main", "-s", shell], - stderr=subprocess.PIPE, - ) - .stderr.read() - .decode() - ) == "" + result = subprocess.Popen( + [sys.executable, "-m", "vectorcode.main", "-s", shell], + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + ) + assert result.stderr is not None + + stderr_output = result.stderr.read().decode() + + # Filter out ONNX Runtime warnings which are not test failures + filtered_stderr = "\n".join( + line + for line in stderr_output.split("\n") + if "onnxruntime" not in line.lower() and line.strip() + ) + + assert filtered_stderr == "" @pytest.mark.asyncio