The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: isolate plugin publication and update windows
ethernet9326458caded
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex d638ae574ea..a5e7138ac99 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -95,6 +95,10 @@ jobs:# size. The remaining time is the slowest files plus the setup.# Workers above the core count only add contention.HERMES_TEST_WORKERS: 96+ # A healthy 44-test compression file takes ~197s alone and can exceed+ # the 300s default under 96-worker load before its duration is cached.+ # Match the runner's 3x known-slow headroom on the first PR run too.+ HERMES_TEST_FILE_TIMEOUT: 600# Ensure tests don't accidentally call real APIsOPENROUTER_API_KEY: ""OPENAI_API_KEY: ""diff --git a/tests/gateway/test_session_hygiene.py b/tests/gateway/test_session_hygiene.pyindex a2abe81d770..adb527b12b5 100644--- a/tests/gateway/test_session_hygiene.py+++ b/tests/gateway/test_session_hygiene.py@@ -1813,7 +1813,7 @@ async def test_hygiene_unwind_records_cooldown(monkeypatch, tmp_path):monkeypatch, tmp_path, SlowCompressAgent, db, session_id)task = asyncio.create_task(runner._handle_message(event))- assert await asyncio.to_thread(worker_started.wait, 2)+ assert await asyncio.to_thread(worker_started.wait, 10)task.cancel()with pytest.raises(asyncio.CancelledError):await taskdiff --git a/tests/hermes_cli/test_plugin_install_manifest_version.py b/tests/hermes_cli/test_plugin_install_manifest_version.pyindex 252fe830c4d..51d35aa0604 100644--- a/tests/hermes_cli/test_plugin_install_manifest_version.py+++ b/tests/hermes_cli/test_plugin_install_manifest_version.py@@ -15,6 +15,7 @@ import pytestimport hermes_yaml as yamlfrom hermes_cli.plugins import SUPPORTED_MANIFEST_VERSION+from tests.pm._fixtures import client, isolated_python # noqa: F401def _git(repo: Path, *args: str) -> str:@@ -40,10 +41,11 @@ def _plugin_repo(root: Path, manifest: dict) -> Path:"manifest_version", list(range(1, SUPPORTED_MANIFEST_VERSION + 1)))def test_install_accepts_every_loader_supported_manifest_version(- monkeypatch, tmp_path, manifest_version+ client, monkeypatch, tmp_path, manifest_version):- from hermes_cli.plugins_cmd import _install_plugin_core+ from hermes_cli import plugins_cmd+ monkeypatch.setattr(plugins_cmd, "_scan_on_install_enabled", lambda: False)repo = _plugin_repo(tmp_path,{"name": "demo", "version": "1.0.0", "manifest_version": manifest_version},@@ -51,7 +53,7 @@ def test_install_accepts_every_loader_supported_manifest_version(home = tmp_path / "home"monkeypatch.setenv("HERMES_HOME", str(home))- target, manifest, name = _install_plugin_core(repo.as_uri(), force=False)+ target, manifest, name = plugins_cmd._install_plugin_core(repo.as_uri(), force=False)assert name == "demo"assert target.exists()@@ -59,10 +61,11 @@ def test_install_accepts_every_loader_supported_manifest_version(def test_manifest_version_above_shared_support_is_refused_cleanly(- monkeypatch, tmp_path+ client, monkeypatch, tmp_path):- from hermes_cli.plugins_cmd import PluginOperationError, _install_plugin_core+ from hermes_cli import plugins_cmd+ monkeypatch.setattr(plugins_cmd, "_scan_on_install_enabled", lambda: False)repo = _plugin_repo(tmp_path,{@@ -75,10 +78,10 @@ def test_manifest_version_above_shared_support_is_refused_cleanly(monkeypatch.setenv("HERMES_HOME", str(home))with pytest.raises(- PluginOperationError,+ plugins_cmd.PluginOperationError,match=rf"supports up to {SUPPORTED_MANIFEST_VERSION}\b",):- _install_plugin_core(repo.as_uri(), force=False)+ plugins_cmd._install_plugin_core(repo.as_uri(), force=False)assert not (home / "plugins" / "demo").exists()assert not (home / "plugins" / ".install-metadata.json").exists()diff --git a/tests/hermes_cli/test_plugins_cmd.py b/tests/hermes_cli/test_plugins_cmd.pyindex 71e98ea9bfa..1cb4fec8079 100644--- a/tests/hermes_cli/test_plugins_cmd.py+++ b/tests/hermes_cli/test_plugins_cmd.py@@ -648,6 +648,10 @@ def test_default_compressor_does_not_activate_an_offered_plugin(monkeypatch):class TestSubdirInstallE2E:"""Install a plugin that lives in a subdirectory of a real local git repo."""+ @pytest.fixture(autouse=True)+ def _isolated_publication(self, client):+ """Publish through an isolated PM home, not the developer's active environment."""+@staticmethoddef _make_repo_with_subdir_plugin(repo_root: Path) -> None:"""Create a git repo where the plugin lives in ``./my-plugin/`` and thediff --git a/tests/hermes_cli/test_plugins_cmd_catalog.py b/tests/hermes_cli/test_plugins_cmd_catalog.pyindex 71ef71d7cae..e5a8ba9601e 100644--- a/tests/hermes_cli/test_plugins_cmd_catalog.py+++ b/tests/hermes_cli/test_plugins_cmd_catalog.py@@ -15,6 +15,7 @@ import pytestfrom hermes_cli import plugin_catalog as pc_catfrom hermes_cli import plugins_cmd as pcfrom hermes_cli import plugins_cmd_catalog as cat+from tests.pm._fixtures import client, isolated_python # noqa: F401pytestmark = pytest.mark.skipif(shutil.which("git") is None, reason="git not available")@@ -29,7 +30,7 @@ def _commit(repo: Path, msg: str) -> str:@pytest.fixture-def world(tmp_path, monkeypatch):+def world(client, tmp_path, monkeypatch):"""A file:// plugin repo with two commits, a catalog pinned to the FIRST, an isolated plugins dir."""repo = tmp_path / "repo"repo.mkdir()@@ -48,6 +49,25 @@ def world(tmp_path, monkeypatch):monkeypatch.setattr(pc, "_scan_on_install_enabled", lambda: False)monkeypatch.setattr(pc, "_console", lambda: type("C", (), {"print": lambda *a, **k: None})())+ def publish_without_environment(+ *_args, staged_plugin=None, selection=None, **_kwargs+ ):+ from hermes_cli.runtime_state import finish_publication+ from pm import paths+ from pm.publication import PluginSelection, StagedPlugin++ assert (staged_plugin is None) != (selection is None)+ if staged_plugin is not None:+ change = StagedPlugin(staged_plugin)+ else:+ assert selection is not None+ change = PluginSelection(selection)+ change.publish(paths.repo_root())+ finish_publication(paths.repo_root())++ # Catalog behavior is independent of dependency-environment construction.+ monkeypatch.setattr("pm.client.sync_venv", publish_without_environment)+# Catalog: one entry pinned to sha1, mutable via state["pin"]; kill list via state["removed"]. The# real loader is https-only, so the fixture entry is built directly (file:// repo).state = {"pin": sha1, "removed": []}diff --git a/tests/install/e2e-assets/drive-update.cjs b/tests/install/e2e-assets/drive-update.cjsindex d3d8e68480a..33e4e85af02 100644--- a/tests/install/e2e-assets/drive-update.cjs+++ b/tests/install/e2e-assets/drive-update.cjs@@ -61,19 +61,21 @@ killer.unref()async function main() {const { runUpdateWindowChat } = await import('./update-window-chat.mjs')- const { updateWindowEnvironment } = await import('./smoke-env.mjs')+ const { isolateUpdateWindowEnvironment, isolatedElectronArgs, updateWindowEnvironment } = await import('./smoke-env.mjs')const origin = nativeHandoff ? 'bundled' : 'source'const root = nativeHandoff ? path.join(path.dirname(exePath), 'resources', 'agent-payload') : path.join(process.env.HERMES_HOME, 'hermes-agent')+ const launchEnv = isolateUpdateWindowEnvironment(updateWindowEnvironment(process.env, root, origin))+ const userData = launchEnv.HERMES_DESKTOP_USER_DATA_DIRlog(`launching ${exePath}`)const app = await _electron.launch({executablePath: exePath,- args: ['--disable-gpu', '--no-sandbox', '--force-renderer-accessibility'],+ args: isolatedElectronArgs(['--disable-gpu', '--no-sandbox', '--force-renderer-accessibility'], userData),cwd: path.dirname(exePath),// Inherit the driver's env: HERMES_HOME (isolated install) and// GIT_CONFIG_GLOBAL (URL redirect to the staged serve repo) MUST reach// the main process so its update check fetches from the staged repo.- env: updateWindowEnvironment(process.env, root, origin),+ env: launchEnv,timeout: 120_000})const child = app.process()@@ -91,7 +93,7 @@ async function main() {await runUpdateWindowChat(app, page, {mockUrl: process.env.HERMES_E2E_MOCK_URL, outDir: proofDir,expectCommit: oldSha,- origin, root, executable: exePath,+ origin, root, executable: exePath, userData,})await shot(page, '01-app-booted')