Skip to content

The agent that grows with you

fix(test): deterministic delivery-spawn sentinel + fold bot_mode into agent config tab

kshitijk4poora07ada235c52
diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py
index 0ab623ad48d..75cf956df7a 100644
--- a/hermes_cli/web_server.py
+++ b/hermes_cli/web_server.py
@@ -1211,8 +1211,8 @@ _CATEGORY_MERGE: Dict[str, str] = {
"dashboard": "display",
"code_execution": "agent",
"prompt_caching": "agent",
- # bot_mode currently surfaces a single field (envelope_ttl_seconds) —
- # fold it into agent until the section grows.
+ # bot_mode holds a couple of relay tuning knobs — keep it folded into the
+ # agent tab rather than spawning a tiny standalone category.
"bot_mode": "agent",
"goals": "agent",
"updates": "general",
diff --git a/tests/tools/test_bot_turn_lock.py b/tests/tools/test_bot_turn_lock.py
index bbf0fa437a7..0f55a8beddb 100644
--- a/tests/tools/test_bot_turn_lock.py
+++ b/tests/tools/test_bot_turn_lock.py
@@ -250,8 +250,25 @@ def test_relay_deliver_returns_target_busy_error(tmp_path, monkeypatch):
spawned = {}
- def _fake_run(argv, **kwargs): # pragma: no cover — must not be reached
- spawned["argv"] = argv
+ # Deterministic spawn detection: sentinel argv from the exact factory the
+ # deliver handler uses. A global subprocess.run patch also intercepts
+ # unrelated gateway-init calls (git rev-parse / ls-remote in CI), so
+ # never fuzzy-match argv — mark the delivery command itself.
+ monkeypatch.setattr(
+ bot_relay, "local_delivery_command", lambda prof, tmp: ["__delivery__", prof]
+ )
+
+ def _fake_run(argv, **kwargs):
+ argv = list(argv or [])
+ if argv and argv[0] == "__delivery__":
+ spawned["argv"] = argv
+
+ class _Done:
+ returncode = 0
+ stdout = ""
+ stderr = ""
+
+ return _Done()
monkeypatch.setattr("subprocess.run", _fake_run)