diff --git a/agent/relay_runtime.py b/agent/relay_runtime.py index 080f5161ddbe..0b1c341d34c9 100644 --- a/agent/relay_runtime.py +++ b/agent/relay_runtime.py @@ -66,7 +66,7 @@ class RelayRuntime: self._execution_consumers.discard(consumer) def managed_execution_enabled(self) -> bool: - """Return whether an active interceptor or subscriber needs the pipeline.""" + """Return whether a Hermes-managed consumer needs the Relay pipeline.""" with self._execution_consumers_lock: return bool(self._execution_consumers) diff --git a/plugins/observability/nemo_relay/README.md b/plugins/observability/nemo_relay/README.md index 8dd838908a69..85f7d039031f 100644 --- a/plugins/observability/nemo_relay/README.md +++ b/plugins/observability/nemo_relay/README.md @@ -443,9 +443,11 @@ separate trajectories. ## Adaptive Execution Example -Hermes core always hands LLM and tool calls to NeMo Relay managed execution. -The `observability/nemo_relay` plugin can install adaptive components on those -boundaries. +Hermes core owns the LLM and tool boundaries and enters NeMo Relay managed +execution while a Hermes-managed Relay consumer is active. With no shared +metrics subscriber or explicitly configured Relay plugin, Hermes calls the +provider or tool directly. The `observability/nemo_relay` plugin retains the +managed path while its adaptive components are installed on those boundaries. Minimal `plugins.toml`: diff --git a/tests/agent/test_auxiliary_relay.py b/tests/agent/test_auxiliary_relay.py index a69387a35573..0c9e8cc51388 100644 --- a/tests/agent/test_auxiliary_relay.py +++ b/tests/agent/test_auxiliary_relay.py @@ -185,6 +185,8 @@ def test_auxiliary_stream_uses_streaming_relay_primitive(monkeypatch): def test_auxiliary_attempt_uses_real_relay_request_intercepts(relay_turn): relay, turn = relay_turn + consumer = "test.auxiliary-request-intercept" + turn.lease.host.retain_managed_execution(consumer) captured_requests = [] client = SimpleNamespace( chat=SimpleNamespace( @@ -228,6 +230,7 @@ def test_auxiliary_attempt_uses_real_relay_request_intercepts(relay_turn): result = run("compression") finally: relay.intercepts.deregister_llm_request("hermes-auxiliary-request") + turn.lease.host.release_managed_execution(consumer) assert result.choices[0].message.content == "ok" assert captured_requests[0]["temperature"] == 0.25