Bump reflexio-ai to 0.2.25 (CPU-default reranker) + venv-direct backend with vendored-install self-repair#72
Conversation
… Reflexio Replace editable vendored Reflexio installs with --reinstall --no-deps so the venv always matches the shipped vendor snapshot, invoke the prepared venv's interpreter directly from hooks/CLI/backend instead of uv run, resolve plugin-root to a physical path, and add ensure_vendored_reflexio_active to repair a stale reflexio-ai install before backend start.
reflexio-ai 0.2.25 defaults the relevance-floor cross-encoder to CPU (REFLEXIO_RERANK_DEVICE override available), eliminating ~3 GB of MPS memory the backend accumulated on Apple Silicon. Document the new env var in DEVELOPER.md and return the lock to the strict PyPI source.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughUpgrade reflexio-ai to 0.2.25, replace editable vendored installs with non-editable reinstalls, add a vendored-version check/repair at backend start, run Reflexio/CLI/hooks via the prepared venv Python with PYTHONPATH wiring, canonicalize plugin-root symlink targets, and update tests. ChangesReflexio Installation and Execution Refactoring
Sequence Diagram(s)sequenceDiagram
participant BackendScript as backend-service.sh
participant PreparedVenvPython as prepared venv Python
participant UVpip as uv pip
participant ReflexioCLI as reflexio.cli
BackendScript->>PreparedVenvPython: ensure_vendored_reflexio_active() (read vendor pyproject.toml)
PreparedVenvPython->>BackendScript: compare installed reflexio-ai version
BackendScript->>UVpip: uv pip install --reinstall --no-deps vendor/reflexio (on mismatch)
BackendScript->>PreparedVenvPython: set PYTHONPATH and exec -m reflexio.cli services start
PreparedVenvPython->>ReflexioCLI: start backend service
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugin/scripts/backend-service.sh`:
- Around line 186-213: The function ensure_vendored_reflexio_active currently
hardcodes plugin_python to "$PLUGIN_ROOT/.venv/bin/python" which breaks Windows;
replace that assignment to use the existing helper claude_smart_plugin_python
(same name used in cli.sh) to resolve the platform-specific venv python path,
keep the rest of the function unchanged (references:
ensure_vendored_reflexio_active, plugin_python, claude_smart_plugin_python) so
the subsequent Python check and pip install use the correct executable on
Windows and Unix.
- Around line 315-320: The call to claude_smart_spawn_detached hardcodes
"$PLUGIN_ROOT/.venv/bin/reflexio" which breaks Windows; compute a platform-aware
reflexio binary path (like plugin_python is resolved) into a variable (e.g.,
reflexio_bin) that picks ".venv/bin/reflexio" on Unix and
".venv/Scripts/reflexio" or ".venv/Scripts/reflexio.exe" on Windows, then
replace the hardcoded path in the claude_smart_spawn_detached invocation with
that reflexio_bin variable so the script works cross-platform.
In `@plugin/scripts/hook_entry.sh`:
- Around line 6-7: Update the header comment in hook_entry.sh to correctly state
that vendored Reflexio is installed non-editably (using the --reinstall
--no-deps style) rather than as an editable install; reference the
smart-install.sh behavior and the relevant tests
(test_reflexio_vendor_release_uses_generated_bundle and
test_smart_install_installs_vendored_reflexio) in the comment so it accurately
describes that hooks use the dependency set produced by smart-install.sh which
includes non-editable vendored Reflexio installs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2e2d6475-7631-4097-a393-80e3ffa8f3f6
📒 Files selected for processing (11)
DEVELOPER.mdbin/claude-smart.jsplugin/pyproject.tomlplugin/scripts/backend-service.shplugin/scripts/cli.shplugin/scripts/ensure-plugin-root.shplugin/scripts/hook_entry.shplugin/scripts/smart-install.shreflexio.lock.jsonscripts/release-with-reflexio.shtests/test_install_scripts.py
ensure_vendored_reflexio_active hardcoded the Unix venv python path; resolve it via claude_smart_plugin_python like cli.sh and hook_entry.sh. Launch the backend with the venv python via -m reflexio.cli instead of the Unix-only .venv/bin/reflexio entry point, and build PYTHONPATH with a ;-separator and cygpath-converted vendor path on Windows, since native Windows Python does not understand :-separated MSYS paths.
…-editably smart-install.sh switched the vendored install to --reinstall --no-deps; the header still said hooks rely on editable vendored installs.
The release flow's 'uv lock --project plugin' ran inside the enterprise repo checkout, where plugin/ is a uv workspace member, so it updated the workspace lockfile instead of plugin/uv.lock. Regenerated standalone so 'uv sync --locked' passes in CI.
What
Two related changes that together fix the multi-GB memory footprint of the claude-smart backend on Apple Silicon and harden how the plugin runs its Python environment.
1. reflexio-ai 0.2.25 (ReflexioAI/reflexio#143)
The relevance-floor cross-encoder previously auto-selected MPS on Apple Silicon; torch's MPS caching allocator accumulated GPU buffers across searches and never released them — measured at 4.4 GB physical footprint (3.0 GB IOAccelerator/MPS) on a live backend. 0.2.25 defaults the reranker to CPU with a
REFLEXIO_RERANK_DEVICEoverride (documented in DEVELOPER.md) and silences tqdm batch bars in server logs.Verified live: after a 12-query /api/search burst on the fixed backend, vmmap shows no IOAccelerator region and a 982 MB footprint (peak 1.2 GB) — a ~3.4 GB reduction — with relevance-floor filtering still active.
Lock returned to the strict PyPI source via
REFLEXIO_RELEASE_SOURCE=pypi scripts/release-with-reflexio.sh(release checks + full test suite + npm pack passed).2. Backend runs from the prepared venv with vendored-install self-repair
--reinstall --no-deps(not editable) so the venv always matches the shipped vendor snapshot.uv run.ensure_vendored_reflexio_activerepairs a stale reflexio-ai install before backend start (covered in tests/test_install_scripts.py).ensure-plugin-root.shresolves the symlink target to a physical path.Tests
Summary by CodeRabbit
Documentation
Chores
Tests