Repository navigation
Fix Hermes gateway with symlinked venv Python - #12996
Conversation
|
Note Pull Request opener @austinywang is not an author or co-author of any commit in this PR (commit identities: All contributors have signed the CLA ✍️ ✅ |
|
Warning Review limit reachedNext included review available in 1 minute. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe Hermes Python wrapper now prefers interpreters from the source-root virtual environment before using ChangesHermes interpreter resolution
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant TUI as TUI Python wrapper
participant Venv as Hermes venv interpreter
participant Gateway as tui_gateway.entry
TUI->>Venv: Select interpreter under HERMES_PYTHON_SRC_ROOT
TUI->>Gateway: Execute -m tui_gateway.entry with original arguments
Gateway-->>TUI: Exit successfully
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Mac fleet instructions for head JOB_JSON=$(~/.local/bin/cmux-ci submit --kind cmux --command 'CMUX_FLEET_BUILD_TAG=pr-12996-341dda70 /Users/Shared/cmux-build-fleet/recipes/cmux.sh https://github.com/manaflow-ai/cmux.git 341dda70f8362313c00820da407770e939dab301' --artifact artifacts/cmux.app.zip --workspace https://github.com/manaflow-ai/cmux/pull/12996 --source-digest 341dda70f8362313c00820da407770e939dab301 --cache-key cmux:pr-12996 --min-free-bytes 268435456000 --label cmux --label ram48)
JOB_ID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"$JOB_JSON")
~/.local/bin/cmux-ci wait "$JOB_ID" --receipt artifacts/fleet/$JOB_ID.json
~/.local/bin/cmux-ci publish-hq "$JOB_ID"Use an existing campaign job ID if one is already posted; do not submit a duplicate. A wait timeout leaves the remote job running. Published results will include an exact-head artifact link and timing/disk receipt. This recipe validates the macOS app only, not iOS or tests. Never use maclease or put credentials in a PR comment. |
|
Reviewed: Hermes always exports |
4aa2736 Fix cmux events access-denied stream error (manaflow-ai#10712) f4ff9af ci: never let a focused test run pass after executing zero tests (manaflow-ai#14053) fbaf239 Fix persistent LaunchServices registration from duplicate plist keys (manaflow-ai#12990) 7b1cb4a Fix Hermes gateway with symlinked venv Python (manaflow-ai#12996) b6b2720 ssh-tmux mirror: preserve deliberate pane titles (manaflow-ai#10714) 33edbc7 Fix Cloud VM panel text readability across all terminal themes (manaflow-ai#7538) 30dccd6 fix: prevent detached TUI preferred editor processes (manaflow-ai#10681) 22eec58 Reap disowned shell watchers on parent PID reuse (issue 10926) (manaflow-ai#11035) 0b9b318 ci: start Linux-only jobs beside Fast static checks (manaflow-ai#14181) 9e78d22 ci: one git archive for the trusted router; delete duplicate CI guard tests (manaflow-ai#14199) 20e79e6 feat: load local cmux config packs (manaflow-ai#13356) 224327b ci: download the admission DerivedData seed while packages resolve (manaflow-ai#14184) 886a6f0 ci: run changed suites inside compile admission (manaflow-ai#14182) # Conflicts: # .github/workflows/ci-guards.yml # .github/workflows/ci-macos.yml # .github/workflows/ci.yml # .github/workflows/test-e2e.yml # .github/workflows/test-macos-suite.yml
The TUI Python wrapper picked $HERMES_PYTHON_SRC_ROOT/{venv,.venv} before
the launcher's own interpreter (#12996). A Hermes source checkout managed by
`hermes pm` runs on a store interpreter, and its .venv can be an unrelated
test env on another Python minor version, so the gateway crash-looped
loading extensions built for the launcher's version.
Resolve the launcher interpreter first, and skip a source venv whose
pyvenv.cfg version differs from it. Venvs without a readable version, or
when the launcher is unknown, are still preferred as before, which keeps
the symlinked-venv fix for #12948.
Fixes #18680
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fix Hermes Python wrapper resolution for uv/Homebrew environments where
venv/bin/pythonis a symlink. The wrapper now prefers the interpreter underHERMES_PYTHON_SRC_ROOTbefore falling back to process discovery, preserving the venv site-packages used by the gateway.Adds an executable regression test covering a symlinked venv interpreter.
Closes #12948
Validation
bash -n Resources/bin/cmux-hermes-python-wrapper: passedpython3 tests/test_hermes_wrapper_hooks.py: existing TUI bridge lifecycle assertion fails in this environment (unrelated to this change)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the Hermes gateway in uv/Homebrew setups where
venv/bin/pythonis a symlink. The wrapper previously resolved the launcher's executable to the base interpreter, which lacks Hermes's site-packages; it now prefers the interpreter underHERMES_PYTHON_SRC_ROOTfirst and falls back to process discovery. Closes #12948.Written for commit f3486bf. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests