fix(docs): standardize terminology and CLI formatting - #168
Merged
Conversation
This was referenced Jun 3, 2026
Eynzof
referenced
this pull request
in Eynzof/Hermes-CN-Core
Jun 7, 2026
…flict-issue168 fix(desktop): 处理已存在其它 Hermes Agent 时桌面端无法启动飞书网关 (#168)
nicezic
pushed a commit
to nicezic/hermes-agent
that referenced
this pull request
Aug 26, 2026
当 Windows 上已存在另一个 Hermes Agent(已安装的网关服务,或运行在 WSL/第二个安装中、通过共享 localhost 可达的实例)时,桌面端完成飞书扫码、 保存参数后点击「保存并启动飞书消息服务」会失败:真正(没)跑起来的网关并不 是桌面端托管的那个,用户停留在“参数已存但服务起不来”的状态。 根因(两种触发源,本质相同): - Windows 已装网关服务:`hermes gateway restart` 会优先 `gateway_windows.restart()` 重启那个外部服务网关,它跑在自己的 HERMES_HOME 下,永远看不到桌面端刚存的参数。 - WSL/第二安装:重复实例守卫按 HERMES_HOME 隔离看不到对方,冲突通过共享 localhost 暴露(飞书 webhook 8765 端口 EADDRINUSE 被吞成模糊错误)。 方案:检测 + 清晰提示 + 一键接管 - 桌面端 spawn dashboard 时注入 HERMES_DESKTOP_MANAGED=1,让 Python 侧能判定 “应由桌面端托管网关”。 - 桌面端发起的网关重启不再静默重启外部 Windows 服务:未带 force 时记录结构化冲突 (gateway_conflict_service)并拒绝;带 force(用户点击「强制接管」)时停掉外部服务/ 其它本机网关并以 --replace 跑桌面端托管网关。desktop-managed 的手动重启统一用 --replace。 - 飞书 connect 对 EADDRINUSE 分类为 gateway_conflict_port,并用 psutil 解析占用者 是否为本机可接管进程(WSL/跨 VM 不可接管)。 - 经 gateway_state.json -> /api/messaging/platforms 透出结构化 error_detail; 桌面消息页渲染冲突面板:「强制由桌面端接管并重启」(同机可点)/「查看如何停止其他实例」。 - POST /api/gateway/restart 新增 force 参数透传一次性 HERMES_GATEWAY_FORCE_TAKEOVER。 非 desktop-managed 行为完全不变(零回归);跨 VM(WSL)不做破坏性操作,仅给指引。 新增 tests/gateway/test_gateway_conflict.py 覆盖状态往返、端口冲突分类、EADDRINUSE 识别与重启分支三种路径。 Ref: Eynzof/Hermes-CN-Desktop#168 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs-only changes. No code modifications.