mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 20:30:00 +08:00
hermes_venv_python() only looked at \HERMES_PYTHON\ and \~/.hermes-venv\
(the uv-pip layout), but ClawPanel's default \install_hermes\ runs
\uv tool install\ and lands the Python at
\<uv tool dir>/hermes-agent/{Scripts,bin}/python\. Result: any code path
that funnels through \
un_venv_python_json\ — most importantly the
'可选依赖管理 / Optional Dependencies' page (hermes_lazy_deps_*) — refused
to start with 'Hermes venv 未找到(~/.hermes-venv 不存在)。请先安装 Hermes。',
even on machines where Hermes was already installed and Profile / Channels /
Dashboard pages worked fine.
Refactor:
- Extract \hermes_uv_tool_root()\ (resolves \<uv tool dir>/hermes-agent\).
- Add \hermes_uv_tool_python()\ (returns Scripts/python.exe on Windows,
bin/python on Unix).
- Reuse \hermes_uv_tool_root()\ from the existing
\locate_hermes_cli_package_dir()\ so the two helpers share one source
of truth.
- \hermes_venv_python()\ now falls through to the uv-tool path after
\HERMES_PYTHON\ and \~/.hermes-venv\. Error message updated to list
every probed location so users on truly-uninstalled machines still get
actionable feedback.
Verified end-to-end: the actual installed venv at
\%APPDATA%/uv/tools/hermes-agent/Scripts/python.exe\ runs
\rom tools.lazy_deps import LAZY_DEPS\ cleanly and reports 25 features.