From fe5b4c6b2e7fadbdb2308507afc81f3f87ac8384 Mon Sep 17 00:00:00 2001 From: ethernet Date: Tue, 21 Jul 2026 16:30:58 -0400 Subject: [PATCH] test(mcp): make session reconnect probe uptime-independent --- hermes_cli/web_server.py | 10 +++++----- tests/tools/test_mcp_tool_session_expired.py | 7 ++++++- .../current/getting-started/installation.md | 3 --- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index c98951098535..08d82c0a2ed0 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -4060,18 +4060,18 @@ async def check_hermes_update(force: bool = False): ``POST /api/hermes/update`` actually runs ``hermes update``. Returns: - install_method: 'git' | 'pip' | 'docker' | 'nixos' | 'homebrew' | ... + install_method: 'git' | 'docker' | 'nixos' | 'unknown' current_version: installed Hermes version string behind: commits behind upstream (>=1), 0 if up to date, - -1 if behind by an unknown count (nix/pypi), or null if the + -1 if behind by an unknown count, or null if the check could not run (offline, no remote, etc.) update_available: convenience bool (behind is non-zero and not null) can_apply: True when the dashboard's update button can apply it - in place (git/pip); False for docker/nix/homebrew where the + in place (git); False for other install methods where the user must update out-of-band update_command: the recommended command for this install method message: human-readable guidance for non-applyable methods - commits: for git/pip installs that are behind, a list of the commits + commits: for git installs that are behind, a list of the commits the local checkout is behind upstream by — each {sha, summary, author, at}. Absent/empty otherwise. The desktop's remote update overlay renders this as "what's @@ -4108,7 +4108,7 @@ async def check_hermes_update(force: bool = False): payload["message"] = format_docker_update_message() return payload - # banner.check_for_updates() handles git / pypi / nix-revision paths and + # banner.check_for_updates() handles git / nix-revision paths and # caches the result for 6h. ``force`` busts the cache so the "Check now" # button reflects reality immediately. try: diff --git a/tests/tools/test_mcp_tool_session_expired.py b/tests/tools/test_mcp_tool_session_expired.py index 6957c3ce6a8a..1c72c93d66d6 100644 --- a/tests/tools/test_mcp_tool_session_expired.py +++ b/tests/tools/test_mcp_tool_session_expired.py @@ -13,6 +13,7 @@ affected MCP server failed until the gateway was manually restarted. import asyncio import json import threading +import time from unittest.mock import MagicMock import pytest @@ -507,7 +508,11 @@ def test_session_expired_retry_waits_for_new_session(monkeypatch, tmp_path): server._reconnect_event = _ReconnectAdapter() mcp_tool._servers["hindsight"] = server mcp_tool._server_error_counts["hindsight"] = 7 - mcp_tool._server_breaker_opened_at["hindsight"] = 123.0 + # Make this a half-open probe regardless of the runner's uptime. A fixed + # timestamp can still be inside the cooldown on a freshly booted CI host. + mcp_tool._server_breaker_opened_at["hindsight"] = ( + time.monotonic() - mcp_tool._CIRCUIT_BREAKER_COOLDOWN_SEC - 1 + ) try: handler = _make_tool_handler("hindsight", "get_bank", 10.0) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/getting-started/installation.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/getting-started/installation.md index c2bf14764a2a..87804be07ce5 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/getting-started/installation.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/getting-started/installation.md @@ -85,7 +85,6 @@ curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash | 安装方式 | 代码位置 | `hermes` 二进制 | 数据目录 | | --------------------------------------- | ------------------------------ | ---------------------------------------- | ------------------------------------- | -| pip install | Python site-packages | `~/.local/bin/hermes`(console_scripts) | `~/.hermes/` | | 用户级(git 安装程序) | `~/.hermes/hermes-agent/` | `~/.local/bin/hermes`(符号链接) | `~/.hermes/` | | Root 模式(`sudo curl … \| sudo bash`) | `/usr/local/lib/hermes-agent/` | `/usr/local/bin/hermes` | `/root/.hermes/`(或 `$HERMES_HOME`) | @@ -124,8 +123,6 @@ hermes setup --portal ## 前置条件 -**pip install:** 除 Python 3.11+ 外无其他前置条件,其余均自动处理。 - **Git 安装程序:** 唯一的前置条件是 **Git**。安装程序自动处理其余一切: - **uv**(快速 Python 包管理器)