Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(hermes-plugin): upgrade Quick Local to OpenViking 0.5 (#6114)

z1gon5b96302de20b
diff --git a/.github/workflows/hermes-plugin-tests.yml b/.github/workflows/hermes-plugin-tests.yml
index a226c1960..52db1a8fd 100644
--- a/.github/workflows/hermes-plugin-tests.yml
+++ b/.github/workflows/hermes-plugin-tests.yml
@@ -121,6 +121,7 @@ jobs:
cache-dependency-glob: |
.ci/hermes-agent/uv.lock
.ci/hermes-agent/pm/lock.json
+ examples/hermes-plugin/local_packages.py
- name: Install the reviewed host and test dependencies
run: |
if [ '${{ matrix.host }}' = release ]; then
diff --git a/docs/en/agent-integrations/05-hermes.md b/docs/en/agent-integrations/05-hermes.md
index da4bc0318..742b17a58 100644
--- a/docs/en/agent-integrations/05-hermes.md
+++ b/docs/en/agent-integrations/05-hermes.md
@@ -42,7 +42,7 @@ available after OpenViking finishes extraction. Existing server data is kept.
Quick Local keeps its server running after Hermes exits. See the
[plugin guide](https://hermes-agent.nousresearch.com/docs/plugins/openviking)
-for model support, server controls and the known local embedding issue.
+for model support, server controls and runtime upgrade instructions.
## Check status
diff --git a/docs/zh/agent-integrations/05-hermes.md b/docs/zh/agent-integrations/05-hermes.md
index 1cdf594e3..e2d4afabf 100644
--- a/docs/zh/agent-integrations/05-hermes.md
+++ b/docs/zh/agent-integrations/05-hermes.md
@@ -34,8 +34,8 @@ hermes
配置后正常聊天即可。插件默认在待提交内容达到 20,000 tokens、会话结束或切换时
请求提交。OpenViking 完成抽取后,记忆才能被召回。已有服务端数据会保留。
-Quick Local 服务在 Hermes 退出后仍会运行。支持的模型、服务控制命令和已知本地
-embedding 问题见[插件指南](https://hermes-agent.nousresearch.com/docs/plugins/openviking)。
+Quick Local 服务在 Hermes 退出后仍会运行。支持的模型、服务控制命令和运行环境
+升级说明见[插件指南](https://hermes-agent.nousresearch.com/docs/plugins/openviking)。
## 查看状态
diff --git a/examples/hermes-plugin/DEVELOPMENT.md b/examples/hermes-plugin/DEVELOPMENT.md
index fecca6ac7..12287d090 100644
--- a/examples/hermes-plugin/DEVELOPMENT.md
+++ b/examples/hermes-plugin/DEVELOPMENT.md
@@ -51,8 +51,8 @@ Quick Local adapts [Hermes PR #94851](https://github.com/NousResearch/hermes-age
(head `d15e0e65d67a2dd6d3f3ab09a382c1f1684e2560`). Provisioning remains separate
from the setup UI. The port uses current Hermes PM, authenticated server reuse,
and paths derived from the provider's bound home. On Python 3.14, the private
-server uses LiteLLM 1.83.7, within OpenViking's supported range; later LiteLLM
-releases exclude that Python version. The profile server controller verifies
+server uses LiteLLM 1.83.7, within OpenViking's supported range; some other
+releases in that range exclude Python 3.14. The profile server controller verifies
the PID, creation time, executable and config path before stopping a process.
It repairs permissions on plugin-owned private files after backup restoration;
no Hermes backup changes are required.
@@ -110,12 +110,19 @@ those helpers require compatibility checks. The plugin uses HTTP. Quick Local in
profile runtime through Hermes PM, or the earlier Hermes uv installer on the
tested release baseline. It does not add server dependencies to Hermes.
Explicit Quick Local setup resolves the latest stable, Python/platform-compatible
-OpenViking 0.4 release from PyPI and verifies the wheel against PyPI's download
+OpenViking 0.5 release from PyPI and verifies the wheel against PyPI's download
hash. The native embedding package remains pinned and hash-verified. The resolved
requirements are recorded per profile; unchanged requirements reuse the runtime,
while a new release follows the existing validation and restart path. Chat and
recovery do not resolve or upgrade packages.
+Installation records a runtime-validation-pending marker that only setup consumes.
+After validation passes, setup uses the existing server controller to request a
+restart and clears the validation marker. Chat therefore keeps using a healthy
+existing server while it keeps running. If that process stops, recovery can start
+the installed runtime without clearing pending validation. Local status reports
+`runtime_validation_pending` separately from readiness and `restart_required`.
+
## Validation
The `Hermes Plugin Tests` workflow runs this directory's complete external-provider
diff --git a/examples/hermes-plugin/README.md b/examples/hermes-plugin/README.md
index eca0dfb9f..d07172c5c 100644
--- a/examples/hermes-plugin/README.md
+++ b/examples/hermes-plugin/README.md
@@ -84,12 +84,11 @@ Each Hermes profile has its own server, data and port. If the saved port is
occupied, Quick Local selects a free port. Run setup again after changing the
Hermes model or API key. Your data and downloaded model are kept.
-**Known issue:** OpenViking 0.4.22 and 0.4.23 can crash when local embedding
-calls overlap, such as during indexing and recall. This affects Quick Local
-and Custom servers using that local backend. It does not affect connections
-using remote embedding APIs. The [fix](https://github.com/volcengine/OpenViking/pull/5548)
-is merged and is expected in OpenViking 0.4.24. After that release, run Quick
-Local setup again to upgrade.
+Quick Local installs the latest compatible OpenViking 0.5 release. Version
+0.5.0 includes the [fix](https://github.com/volcengine/OpenViking/pull/5548)
+for overlapping local embedding calls that could crash 0.4.22 and 0.4.23.
+Run Quick Local setup again to upgrade an existing private runtime. This
+does not upgrade a separately managed Custom or OpenViking Service server.
The server keeps running after Hermes exits. These commands are optional:
@@ -144,10 +143,18 @@ data are kept. Updates use the version reviewed in the Hermes catalog.
For direct source installs, use the [source update command](CONFIGURATION.md#pinned-source-installation).
To update a Quick Local server, run `hermes memory setup openviking` again and
-choose Quick Local. Setup selects the latest compatible OpenViking 0.4 release
+choose Quick Local. Setup selects the latest compatible OpenViking 0.5 release
and restarts the server if needed. Normal chat and recovery use the installed
server without checking for updates.
+If validation fails after installing a runtime update, chat keeps using the healthy
+existing server while it keeps running. If that process stops, recovery can start
+the installed runtime before setup validation has passed. The update still needs
+validation, even if the server is ready. `hermes openviking local status` reports
+this pending state. Correct the reported problem and run
+`hermes memory setup openviking` again, then choose Quick Local. Setup validates
+the update before requesting a restart.
+
## Existing users
If a Hermes update removes its built-in OpenViking provider, it attempts to
diff --git a/examples/hermes-plugin/cli.py b/examples/hermes-plugin/cli.py
index f725d3117..990ea25fb 100644
--- a/examples/hermes-plugin/cli.py
+++ b/examples/hermes-plugin/cli.py
@@ -41,6 +41,11 @@ def _run(args):
)
status = server.status()
print(f"Quick Local: {status['state']} at {status['endpoint']}")
+ if status["runtime_validation_pending"]:
+ print(
+ "Runtime update needs validation: run hermes memory setup openviking "
+ "and choose Quick Local."
+ )
if status["restart_required"]:
print("Saved settings require a restart: hermes openviking local restart")
except QuickLocalSetupError as exc:
diff --git a/examples/hermes-plugin/local_server.py b/examples/hermes-plugin/local_server.py
index 88b98191f..b1a34acf7 100644
--- a/examples/hermes-plugin/local_server.py
+++ b/examples/hermes-plugin/local_server.py
@@ -415,4 +415,5 @@ class LocalServer:
"pid": process.pid if process else None,
"state": "ready" if ready else "starting" if process else "stopped",
"restart_required": self.paths.restart_required_marker.is_file(),
+ "runtime_validation_pending": self.paths.runtime_validation_pending_marker.is_file(),
}
diff --git a/examples/hermes-plugin/plugin.yaml b/examples/hermes-plugin/plugin.yaml
index 07fa401f1..3848ec53d 100644
--- a/examples/hermes-plugin/plugin.yaml
+++ b/examples/hermes-plugin/plugin.yaml
@@ -1,5 +1,5 @@
name: openviking
-version: 2.1.1
+version: 2.1.2
description: "Long-term memory for Hermes with automatic capture, recall and tools to search and manage knowledge."
pip_dependencies:
- httpx
diff --git a/examples/hermes-plugin/pyproject.toml b/examples/hermes-plugin/pyproject.toml
index b78eda7e6..78c03924a 100644
--- a/examples/hermes-plugin/pyproject.toml
+++ b/examples/hermes-plugin/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "hermes-plugin-openviking"
-version = "2.1.1"
+version = "2.1.2"
description = "Hermes Agent memory provider plugin: openviking"
requires-python = ">=3.11"
license = { text = "MIT" }
diff --git a/examples/hermes-plugin/quick_local.py b/examples/hermes-plugin/quick_local.py
index 4bd250b2f..d44e4cb94 100644
--- a/examples/hermes-plugin/quick_local.py
+++ b/examples/hermes-plugin/quick_local.py
@@ -31,8 +31,8 @@ DEPLOYMENT = "quick_local"
EMBEDDING_MODEL = "bge-small-zh-v1.5-f16"
EMBEDDING_DIMENSION = 512
# Accept new releases in the server API series; resolve only in explicit setup.
-OPENVIKING_REQUIREMENT = "openviking[local-embed]>=0.4.22,<0.5"
-# Later LiteLLM releases exclude Python 3.14. OpenViking supports this version.
+OPENVIKING_REQUIREMENT = "openviking[local-embed]>=0.5.0,<0.6"
+# Some LiteLLM releases in OpenViking's supported range exclude Python 3.14.
# This restriction applies only to the private server, never Hermes's dependencies.
_OPENVIKING_REQUIREMENT = Requirement(OPENVIKING_REQUIREMENT)
@@ -41,6 +41,7 @@ _ROOT_DIRNAME = "openviking"
_SERVER_CONFIG_FILENAME = "ov.conf"
_OVCLI_CONFIG_FILENAME = "ovcli.conf"
_RESTART_REQUIRED_FILENAME = ".restart-required"
+_RUNTIME_VALIDATION_PENDING_FILENAME = ".runtime-validation-pending"
_WORKSPACE_DIRNAME = "data"
_MODEL_CACHE_DIRNAME = "models"
# Leave OpenViking's default 1933 available for independently managed servers.
@@ -108,6 +109,10 @@ class QuickLocalPaths:
def restart_required_marker(self) -> Path:
return self.root / _RESTART_REQUIRED_FILENAME
+ @property
+ def runtime_validation_pending_marker(self) -> Path:
+ return self.root / _RUNTIME_VALIDATION_PENDING_FILENAME
+
@dataclass(frozen=True)
class QuickLocalPreflight:
@@ -387,7 +392,10 @@ class QuickLocalSetup:
"Quick Local preflight belongs to a different Hermes profile."
)
vlm = resolve_hermes_vlm_config()
- runtime_changed = self._ensure_openviking_installed(preflight.paths)
+ runtime_changed = (
+ self._ensure_openviking_installed(preflight.paths)
+ or preflight.paths.runtime_validation_pending_marker.is_file()
+ )
reusable_endpoint = find_reusable_endpoint(preflight.paths, self._health_check)
if reusable_endpoint:
@@ -398,11 +406,12 @@ class QuickLocalSetup:
)
server_config = build_server_config(preflight.paths, vlm, port=port)
config_changed = not _stored_server_config_matches(preflight.paths, server_config)
- if (
+ restart_required = (
runtime_changed
or config_changed
or preflight.paths.restart_required_marker.is_file()
- ):
+ )
+ if restart_required:
# Validate in disposable storage before changing the live service.
validation_port = find_available_port()
if validation_port is None:
@@ -417,6 +426,7 @@ class QuickLocalSetup:
from .local_server import LocalServer
LocalServer(hermes_home).configure(server_config, runtime_changed=runtime_changed)
+ preflight.paths.runtime_validation_pending_marker.unlink(missing_ok=True)
self._emit(
QuickLocalStage.WRITE_CONFIG,
"Restarting Quick Local with the updated settings...",
@@ -425,7 +435,7 @@ class QuickLocalSetup:
self._emit(
QuickLocalStage.COMPLETE,
"Quick Local is ready with the updated settings."
- if runtime_changed or config_changed
+ if restart_required
else "Existing Quick Local server is reachable; reusing it.",
)
return QuickLocalSetupResult(
@@ -454,6 +464,7 @@ class QuickLocalSetup:
preflight.paths.workspace.mkdir(parents=True, exist_ok=True)
LocalServer(hermes_home).configure(server_config, runtime_changed=runtime_changed)
+ preflight.paths.runtime_validation_pending_marker.unlink(missing_ok=True)
endpoint = self._start_managed_server(preflight.paths, endpoint)
self._emit(
QuickLocalStage.WRITE_CONFIG,
@@ -524,6 +535,10 @@ class QuickLocalSetup:
raise QuickLocalSetupError(
"Could not install a compatible OpenViking local embedding runtime."
)
+ # Installation alone must not authorize chat to restart a healthy server.
+ atomic_json_write(
+ paths.runtime_validation_pending_marker, {"validation_pending": True}, mode=0o600
+ )
atomic_json_write(receipt, requirements, mode=0o600)
return True
@@ -1187,6 +1202,7 @@ def repair_private_paths(paths: QuickLocalPaths) -> None:
paths.server_config,
paths.ovcli_config,
paths.restart_required_marker,
+ paths.runtime_validation_pending_marker,
paths.root / "server-process.json",
paths.root / "server.lock",
paths.root / "runtime-requirements.json",
diff --git a/examples/hermes-plugin/tests/test_local_lifecycle.py b/examples/hermes-plugin/tests/test_local_lifecycle.py
index eddae4c13..8f9325f1a 100644
--- a/examples/hermes-plugin/tests/test_local_lifecycle.py
+++ b/examples/hermes-plugin/tests/test_local_lifecycle.py
@@ -74,7 +74,7 @@ class Handler(BaseHTTPRequestHandler):
def do_GET(self):
ok=self.path=='/health' or self.headers.get('X-API-Key')==key
self.send_response(200 if ok else 401);self.end_headers()
- self.wfile.write(json.dumps({'status':'ok','healthy':True,'version':'0.4.22','auth_mode':'trusted','root_api_key_required':True}).encode())
+ self.wfile.write(json.dumps({'status':'ok','healthy':True,'version':'0.5.0','auth_mode':'trusted','root_api_key_required':True}).encode())
# Match asyncio/Uvicorn: Windows listeners do not share an active address.
HTTPServer.allow_reuse_address = os.name != 'nt'
HTTPServer((a.host,a.port),Handler).serve_forever()
@@ -178,6 +178,102 @@ def test_restart_keeps_data_and_changes_only_owned_process(servers):
assert not a.paths.restart_required_marker.exists()
[email protected]("failure_stage", ["validation", "port"])
+def test_runtime_upgrade_retries_restart_after_failed_setup(
+ servers, modules, monkeypatch, capsys, failure_stage
+):
+ from argparse import Namespace
+
+ _home, provider, _module, ql, _lifecycle, packages = modules
+ server = servers("upgrade-retry")
+ ready(server)
+ home = server.paths.root.parent
+ cli = importlib.import_module(ql.__package__ + ".cli")
+ monkeypatch.setattr(cli, "get_hermes_home", lambda: home)
+ old_pid = server.status()["pid"]
+ assert server.status()["runtime_validation_pending"] is False
+ endpoint = server.status()["endpoint"]
+ saved = {
+ path: path.read_bytes() for path in (server.paths.server_config, server.paths.ovcli_config)
+ }
+ server.paths.workspace.mkdir()
+ data = server.paths.workspace / "retained-memory"
+ data.write_text("keep")
+ monkeypatch.setattr(ql, "resolve_hermes_vlm_config", lambda: server._config()["vlm"])
+ monkeypatch.setattr(ql, "openviking_install_satisfies_requirement", lambda _paths: True)
+ monkeypatch.setattr(packages, "verified_requirements", lambda values, _cache: values)
+ monkeypatch.setattr(
+ packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.5.0"
+ )
+ install = MagicMock()
+ validate = MagicMock()
+ monkeypatch.setattr(ql.QuickLocalSetup, "_install_with_uv", install)
+ monkeypatch.setattr(ql.QuickLocalSetup, "_validate_generated_config", validate)
+
+ with monkeypatch.context() as failed:
+ if failure_stage == "validation":
+ validate.side_effect = ql.QuickLocalSetupError("validation failed")
+ error = "validation failed"
+ else:
+ failed.setattr(ql, "find_available_port", lambda: None)
+ error = "No free port"
+ setup = ql.QuickLocalSetup(health_check=lambda _url: (True, ""))
+ with pytest.raises(ql.QuickLocalSetupError, match=error):
+ setup.provision(hermes_home=home)
+
+ status = server.status()
+ assert status["pid"] == old_pid
+ assert status["state"] == "ready"
+ assert status["runtime_validation_pending"] is True
+ assert status["restart_required"] is False
+ cli._run(Namespace(local_action="status"))
+ output = capsys.readouterr().out
+ assert "Quick Local: ready" in output
+ assert "Runtime update needs validation" in output
+ assert "hermes memory setup openviking" in output
+ assert "choose Quick Local" in output
+ assert "hermes openviking local restart" not in output
+ assert server.status()["pid"] == old_pid
+ assert all(path.read_bytes() == value for path, value in saved.items())
+ assert (server.paths.root / "runtime-requirements.json").is_file()
+ provider._profile_config_and_env = lambda: ({"deployment": ql.DEPLOYMENT}, {})
+ provider.initialize("after-failed-setup", hermes_home=str(home), platform="cli")
+ assert server.status()["pid"] == old_pid
+ assert provider._ensure_client() is not None
+ assert server.paths.runtime_validation_pending_marker.is_file()
+ assert not server.paths.restart_required_marker.exists()
+
+ def validate_pending_runtime(**_kwargs):
+ assert server.paths.runtime_validation_pending_marker.is_file()
+ assert not server.paths.restart_required_marker.exists()
+ assert provider._ensure_client() is not None
+ assert server.status()["pid"] == old_pid
+
+ validate.side_effect = validate_pending_runtime
+ validate.reset_mock()
+ progress = []
+ retry = ql.QuickLocalSetup(health_check=lambda _url: (True, ""), progress=progress.append)
+ assert retry.provision(hermes_home=home).endpoint == endpoint
+ assert progress[-1].message == "Quick Local is ready with the updated settings."
+ validate.assert_called_once()
+ assert install.call_count == 1
+ new_pid = server.status()["pid"]
+ assert new_pid != old_pid
+ assert not server.paths.restart_required_marker.exists()
+ assert not server.paths.runtime_validation_pending_marker.exists()
+ assert server.status()["runtime_validation_pending"] is False
+ cli._run(Namespace(local_action="status"))
+ output = capsys.readouterr().out
+ assert "Quick Local: ready" in output
+ assert "Runtime update needs validation" not in output
+ assert all(path.read_bytes() == value for path, value in saved.items())
+ assert data.read_text() == "keep"
+ retry.provision(hermes_home=home)
+ assert server.status()["pid"] == new_pid
+ assert install.call_count == 1
+ validate.assert_called_once()
+
+
def test_foreign_saved_port_moves_endpoint_without_stopping_foreign_server(servers):
a, b = servers("a"), servers("b")
ready(a)
@@ -655,7 +751,7 @@ def test_changed_native_pins_reinstall_an_existing_runtime(modules, monkeypatch)
monkeypatch.setattr(ql, "_pm_available", lambda: False)
monkeypatch.setattr(packages, "verified_requirements", lambda values, _cache: values)
monkeypatch.setattr(
- packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.4.23"
+ packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.5.0"
)
engine = ql.QuickLocalSetup(health_check=lambda _url: (False, ""))
install = MagicMock()
diff --git a/examples/hermes-plugin/tests/test_local_packages.py b/examples/hermes-plugin/tests/test_local_packages.py
index 87ce9997a..65a0f7aeb 100644
--- a/examples/hermes-plugin/tests/test_local_packages.py
+++ b/examples/hermes-plugin/tests/test_local_packages.py
@@ -89,7 +89,7 @@ def test_bad_hash_never_reaches_pm(external_provider, tmp_path, wheel_source, mo
lambda **_kw: [ql.OPENVIKING_REQUIREMENT, f"probe @ {url}#sha256={'0' * 64}"],
)
monkeypatch.setattr(
- packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.4.23"
+ packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.5.0"
)
install = MagicMock()
monkeypatch.setattr(pm, "ensure_python_tool", install)
@@ -119,11 +119,12 @@ def test_server_selection_uses_latest_compatible_stable_wheel(external_provider)
releases = {
"0.4.21": [_distribution("0.4.21")],
"0.4.22": [_distribution("0.4.22")],
- "0.4.24": [_distribution("0.4.24", tag="cp310-abi3-manylinux_2_31_x86_64")],
- "0.4.25": [_distribution("0.4.25", requires_python="<3.14")],
- "0.4.26": [_distribution("0.4.26", yanked=True)],
- "0.4.27rc1": [_distribution("0.4.27rc1")],
- "0.5.0": [_distribution("0.5.0")],
+ "0.4.23": [_distribution("0.4.23")],
+ "0.5.0": [_distribution("0.5.0", tag="cp310-abi3-manylinux_2_31_x86_64")],
+ "0.5.1": [_distribution("0.5.1", requires_python="<3.14")],
+ "0.5.2": [_distribution("0.5.2", yanked=True)],
+ "0.5.3rc1": [_distribution("0.5.3rc1")],
+ "0.6.0": [_distribution("0.6.0")],
}
selected = packages._select_server_requirement(
releases,
@@ -132,7 +133,7 @@ def test_server_selection_uses_latest_compatible_stable_wheel(external_provider)
)
assert selected == (
"openviking[local-embed] @ https://files.pythonhosted.org/packages/"
- "openviking-0.4.24-cp310-abi3-manylinux_2_31_x86_64.whl#sha256=" + "a" * 64
+ "openviking-0.5.0-cp310-abi3-manylinux_2_31_x86_64.whl#sha256=" + "a" * 64
)
@@ -140,14 +141,14 @@ def test_source_build_requires_explicit_consent(external_provider):
_h, _p, module, _s = external_provider("releases")
packages = importlib.import_module(module.__name__ + ".local_packages")
ql = importlib.import_module(module.__name__ + ".quick_local")
- releases = {"0.4.24": [_distribution("0.4.24", packagetype="sdist")]}
+ releases = {"0.5.0": [_distribution("0.5.0", packagetype="sdist")]}
with pytest.raises(ql.QuickLocalSetupError, match="No compatible"):
packages._select_server_requirement(releases, python_version="3.14", tags=[])
assert (
packages._select_server_requirement(
releases, python_version="3.14", tags=[], allow_source_build=True
)
- == "openviking[local-embed]==0.4.24"
+ == "openviking[local-embed]==0.5.0"
)
@@ -171,7 +172,7 @@ def test_each_setup_resolves_new_pypi_release(external_provider, monkeypatch):
_h, _p, module, _s = external_provider("releases")
packages = importlib.import_module(module.__name__ + ".local_packages")
- versions = iter(["0.4.23", "0.4.24"])
+ versions = iter(["0.5.0", "0.5.1"])
requests = []
def respond(url, **kwargs):
@@ -184,6 +185,6 @@ def test_each_setup_resolves_new_pypi_release(external_provider, monkeypatch):
)
monkeypatch.setattr(packages.httpx, "get", respond)
- assert "openviking-0.4.23-" in packages.resolve_server_requirement()
- assert "openviking-0.4.24-" in packages.resolve_server_requirement()
+ assert "openviking-0.5.0-" in packages.resolve_server_requirement()
+ assert "openviking-0.5.1-" in packages.resolve_server_requirement()
assert requests == [("https://pypi.org/pypi/openviking/json", {"timeout": 30})] * 2
diff --git a/examples/hermes-plugin/tests/test_quick_local.py b/examples/hermes-plugin/tests/test_quick_local.py
index af79b0d1e..d40f61b86 100644
--- a/examples/hermes-plugin/tests/test_quick_local.py
+++ b/examples/hermes-plugin/tests/test_quick_local.py
@@ -27,7 +27,7 @@ def plugin_modules(external_provider, monkeypatch):
monkeypatch.setattr(quick_local, "_validate_vlm", MagicMock())
packages = importlib.import_module(openviking_module.__name__ + ".local_packages")
monkeypatch.setattr(
- packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.4.23"
+ packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.5.0"
)
@@ -438,9 +438,14 @@ def test_existing_openviking_without_local_embedding_runtime_is_not_reused(
assert "import llama_cpp" in run.call_args.args[0][2]
-def test_existing_openviking_with_local_embedding_runtime_is_reused(
+ ("version", "reusable"), [("0.4.22", False), ("0.4.23", False), ("0.5.0", True), ("0.6.0", False)]
+)
+def test_only_supported_openviking_with_local_embedding_runtime_is_reused(
tmp_path,
monkeypatch,
+ version,
+ reusable,
):
paths = quick_local.managed_paths(tmp_path)
paths.runtime_python.parent.mkdir(parents=True)
@@ -451,12 +456,12 @@ def test_existing_openviking_with_local_embedding_runtime_is_reused(
"run",
lambda *_args, **_kwargs: SimpleNamespace(
returncode=0,
- stdout="0.4.22\n",
+ stdout=version + "\n",
stderr="",
),
)
- assert quick_local.openviking_install_satisfies_requirement(paths) is True
+ assert quick_local.openviking_install_satisfies_requirement(paths) is reusable
def test_validation_server_does_not_inherit_stdin(tmp_path, monkeypatch):
@@ -975,6 +980,8 @@ def test_current_installer_uses_pm_and_private_root(tmp_path, monkeypatch):
explicit=True,
timeout=1800,
)
+ assert paths.runtime_validation_pending_marker.is_file()
+ assert not paths.restart_required_marker.exists()
def test_pm_failure_does_not_activate_profile(tmp_path, monkeypatch):
@@ -1018,8 +1025,11 @@ def test_setup_checks_new_release_even_with_a_compatible_installed_runtime(tmp_p
paths = quick_local.managed_paths(tmp_path)
paths.root.mkdir()
requirements = packages.install_requirements()
- requirements[0] = "openviking[local-embed]==0.4.22"
+ requirements[0] = "openviking[local-embed]==0.5.0"
(paths.root / "runtime-requirements.json").write_text(json.dumps(requirements))
+ monkeypatch.setattr(
+ packages, "resolve_server_requirement", lambda **_kw: "openviking[local-embed]==0.5.1"
+ )
monkeypatch.setattr(quick_local, "openviking_install_satisfies_requirement", lambda _p: True)
monkeypatch.setattr(packages, "verified_requirements", lambda values, _cache: values)
install = MagicMock()
@@ -1027,9 +1037,9 @@ def test_setup_checks_new_release_even_with_a_compatible_installed_runtime(tmp_p
engine = quick_local.QuickLocalSetup(health_check=lambda _url: (False, ""))
assert engine._ensure_openviking_installed(paths) is True
- assert install.call_args.args[1][0] == "openviking[local-embed]==0.4.23"
+ assert install.call_args.args[1][0] == "openviking[local-embed]==0.5.1"
assert json.loads((paths.root / "runtime-requirements.json").read_text())[0] == (
- "openviking[local-embed]==0.4.23"
+ "openviking[local-embed]==0.5.1"
)
diff --git a/scripts/check-hermes-quick-local.py b/scripts/check-hermes-quick-local.py
index 9b51f7efd..61c5c9a51 100644
--- a/scripts/check-hermes-quick-local.py
+++ b/scripts/check-hermes-quick-local.py
@@ -318,14 +318,30 @@ def main():
> 0
)
probe = (
- "from openviking.models.embedder.local_embedders import LocalDenseEmbedder; import math; e=LocalDenseEmbedder(model_name='bge-small-zh-v1.5-f16',cache_dir="
+ "from concurrent.futures import ThreadPoolExecutor; "
+ "from openviking.models.embedder.local_embedders import LocalDenseEmbedder; "
+ "import math; e=LocalDenseEmbedder(model_name='bge-small-zh-v1.5-f16',cache_dir="
+ repr(str(server.paths.model_cache))
- + "); v=e.embed('local embedding validation').dense_vector; assert len(v)==512 and all(math.isfinite(x) for x in v) and any(v)"
+ + "); "
+ "pool=ThreadPoolExecutor(max_workers=4); "
+ "vectors=list(pool.map(lambda i: e.embed(f'local embedding validation {i}').dense_vector, range(8))); "
+ "pool.shutdown(); "
+ "assert all(len(v)==512 and all(math.isfinite(x) for x in v) and any(v) for v in vectors); "
+ "e.close()"
)
subprocess.run(
[str(server.paths.runtime_python), "-c", probe], check=True, timeout=120
)
- evidence["profiles"].append(server.status())
+ versions = json.loads(subprocess.check_output(
+ [str(server.paths.runtime_python), "-c",
+ "import json; from importlib.metadata import version; "
+ "print(json.dumps({k:version(k) for k in ('openviking','volcengine-python-sdk','litellm','llama-cpp-python')}))"],
+ text=True, timeout=30,
+ ))
+ from packaging.requirements import Requirement
+
+ assert versions["openviking"] in Requirement(ql.OPENVIKING_REQUIREMENT).specifier
+ evidence["profiles"].append({**server.status(), "versions": versions})
finally:
reset_hermes_home_override(token)
assert servers[0].status()["endpoint"] != servers[1].status()["endpoint"]
@@ -352,6 +368,7 @@ def main():
evidence.update(
external_loader=True,
real_embeddings=True,
+ concurrent_embeddings=True,
captured_turns=True,
restart_preserved_data=True,
foreign_port_recovery=True,