fix: improve CodexLens env defaults, self-exclusion, and route handling

- Adjust env defaults (embed batch 64, workers 2) and add HNSW/chunking params
- Exclude .codexlens directory from indexing and file watching
- Expand codexlens-routes with improved validation and error handling
- Enhance integration tests for broader route coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-03-19 10:34:18 +08:00
parent 683b85228f
commit 00672ec8e5
11 changed files with 478 additions and 191 deletions

View File

@@ -9,7 +9,13 @@ from unittest.mock import patch
import pytest
from codexlens_search.bridge import _build_parser, _json_output, _error_exit
from codexlens_search.bridge import (
DEFAULT_EXCLUDES,
_build_parser,
_json_output,
_error_exit,
should_exclude,
)
# ---------------------------------------------------------------------------
@@ -71,6 +77,12 @@ class TestParser:
args = self.parser.parse_args([])
assert args.command is None
def test_default_excludes_include_codexlens(self):
assert ".codexlens" in DEFAULT_EXCLUDES
def test_should_exclude_codexlens_directory(self):
assert should_exclude(Path(".codexlens") / "metadata.db", DEFAULT_EXCLUDES) is True
# ---------------------------------------------------------------------------
# JSON output helpers