Skip to content

[Bug] Studio.app 覆写 gateway launchd plist 的 Python 路径,导致 gateway 运行旧版 hermes-agent #1690

@Jeepbright

Description

@Jeepbright

问题描述

Studio.app 在某些操作(如更新、重启 gateway)时,会将 ~/Library/LaunchAgents/ai.hermes.gateway.plist 中的 Python 可执行路径覆写为 Studio.app 自带的 desktop-runtime Python,覆盖用户独立安装的 hermes-agent venv Python。

复现步骤

  1. 通过 hermes CLI 或 pip 安装 hermes-agent 到独立 venv(如 ~/.hermes/hermes-agent/venv/bin/python),版本 0.17.0
  2. hermes gateway install 生成 plist,Python 路径正确指向 venv
  3. 打开 Studio.app(内置 desktop-runtime/hermes/0.16.0)
  4. 通过 Dashboard 更新 hermes-agent 到 0.17.0
  5. 重启 Studio.app 或 gateway
  6. 检查 gateway 进程——可能跑的是 desktop-runtime/0.16.0 的 Python,而非 venv 0.17.0

实际行为

plist 中 Python 路径被覆写为:

/Users/<user>/.hermes-web-ui/desktop-runtime/hermes/0.16.0/mac-arm64/python/bin/python3

hermes gateway install 正确生成的是:

/Users/<user>/.hermes/hermes-agent/venv/bin/python

Desktop-runtime 的 hermes 版本滞后于用户通过 Dashboard 更新的 venv 版本,导致 gateway 跑旧版代码。

期望行为

Studio.app 不应覆写已由 hermes gateway install 生成的 plist。如果 Studio.app 需要管理 gateway,应:

  1. 检测是否存在用户独立安装的 hermes-agent venv,优先使用其 Python 路径
  2. 或尊重已有的 plist 配置,不覆盖 Python 路径字段
  3. 或至少在 plist 中增加 environment variable override 支持(如 HERMES_PYTHON_PATH

环境信息

  • macOS 26.5 (Apple Silicon)
  • Hermes Agent: 0.17.0 (venv)
  • Studio.app: 0.6.15
  • Desktop-runtime bundled: 0.16.0
  • Gateway plist: ~/Library/LaunchAgents/ai.hermes.gateway.plist

当前 workaround

~/.hermes/.env 中设置 HERMES_PYTHON_PATH=/Users/<user>/.hermes/hermes-agent/venv/bin/python,并在 gateway.py 的 get_python_path() 中增加该 env override 逻辑。但这是手动补丁,每次 Studio.app 更新后需检查是否被再次覆写。

频率

每次 Studio.app 重启或 gateway 管理操作后均会复现。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions