feat(nemo-agents-plugin): add hermes adapter to nemo-agents plugin#500
Conversation
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
2c040a1 to
52a55a7
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughAdds a vendored Hermes workflow adapter, registers ChangesHermes Agent Adapter Integration
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
plugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.py (1)
19-22: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winLoad the entry point in this test.
entry_points(group="nat.components")only checks metadata;ep.load()catches import failures that runtime discovery would skip.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.py` around lines 19 - 22, The test only verifies entry point metadata via entry_points(group="nat.components"), so it can miss import/load failures. Update test_hermes_adapter_nat_components_entry_point_registered to also call ep.load() on the nat_hermes_agent_adapter entry point, using the same entry point lookup, so packaging/import issues are caught during the test.plugins/nemo-agents/examples/hermes-agent/README.md (1)
1-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep this page as one HOW-TO and add the required sections.
This mixes explanation with task steps and omits the required Python SDK/CLI tab set and
Next Stepssection. Split the packaging note into a separate explanation/reference page, keep this README task-focused, and end with cross-links. As per coding guidelines, "Each documentation page should fit ONE Diataxis quadrant; do not mix tutorials with reference tables or how-tos with architecture explanations; use cross-links instead", "Provide both Python SDK and CLI examples in tab-sets for consistency and to support multiple user workflows", and "Include 'Next Steps' section at the end with cross-links to related documentation content".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/nemo-agents/examples/hermes-agent/README.md` around lines 1 - 57, This README mixes a how-to with explanatory/reference content, so split the Hermes packaging note into a separate reference/explanation page and keep this page focused on task steps. Update the Hermes Agent README to include the required Python SDK and CLI tab-set examples in the main workflow sections, then add a closing Next Steps section with cross-links to related docs. Make sure the content stays aligned with the existing Hermes Agent instructions and the deployment/invocation flow while removing non-actionable architecture-style explanation.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/nemo-agents/examples/hermes-agent/README.md`:
- Around line 22-33: The NeMo Relay install snippet is not runnable as written
because `cargo install --root .venv` only drops binaries into `.venv/bin` and
does not create an activatable virtualenv. Update the README in the
`hermes-agent` setup section so the install path is either explicitly tied to an
existing `VIRTUAL_ENV` or the snippet exports the bin directory onto `PATH`
before running `nemo-relay --help`. Make sure the `cargo install` and smoke-test
commands in the `nemo-relay` setup flow are consistent with the environment they
actually create.
In
`@plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py`:
- Around line 155-173: The relay ATOF config in _relay_plugin_config currently
hardcodes the same events.jsonl target with overwrite mode, so concurrent calls
to register/inject_atof_jsonl can collide. Update _relay_plugin_config (and the
call sites that pass relay_atof_output_dir) to create a unique per-invocation
subdirectory or filename for each request, then point the ATOF
output_directory/filename at that unique path so each run writes and reads its
own file.
- Around line 194-203: The launcher hint in _diagnose_empty_output is using the
Relay wrapper prefix from command[:4], which can mislead operators when command
or command_args are overridden. Update this helper to derive the displayed
prefix from the configured Hermes launcher command instead of the nemo-relay
invocation, so the message references the actual executable the user should
test.
---
Nitpick comments:
In `@plugins/nemo-agents/examples/hermes-agent/README.md`:
- Around line 1-57: This README mixes a how-to with explanatory/reference
content, so split the Hermes packaging note into a separate
reference/explanation page and keep this page focused on task steps. Update the
Hermes Agent README to include the required Python SDK and CLI tab-set examples
in the main workflow sections, then add a closing Next Steps section with
cross-links to related docs. Make sure the content stays aligned with the
existing Hermes Agent instructions and the deployment/invocation flow while
removing non-actionable architecture-style explanation.
In `@plugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.py`:
- Around line 19-22: The test only verifies entry point metadata via
entry_points(group="nat.components"), so it can miss import/load failures.
Update test_hermes_adapter_nat_components_entry_point_registered to also call
ep.load() on the nat_hermes_agent_adapter entry point, using the same entry
point lookup, so packaging/import issues are caught during the test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1fa95eab-8e8f-4585-b4fc-7a6a24e6a36a
📒 Files selected for processing (10)
packages/nemo_platform/pyproject.tomlplugins/nemo-agents/examples/hermes-agent/README.mdplugins/nemo-agents/examples/hermes-agent/hermes-agent.ymlplugins/nemo-agents/pyproject.tomlplugins/nemo-agents/src/nemo_agents_plugin/container/validator.pyplugins/nemo-agents/tests/unit/test_container.pyplugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.pyplugins/nemo-agents/vendor/hermes_agent_adapter/README.mdplugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/__init__.pyplugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py (1)
299-304: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winUse the two-argument
AsyncGeneratorform here.AsyncGenerator[ChatResponseChunk]raisesTypeErroron this repo’s Python 3.11 target; change it toAsyncGenerator[ChatResponseChunk, None]to match the other annotation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py` around lines 299 - 304, The _stream_fn return annotation uses the one-argument AsyncGenerator form, which is invalid on the Python 3.11 target used here. Update the _stream_fn signature in nat_hermes_agent_adapter/register.py to use AsyncGenerator[ChatResponseChunk, None] so it matches the repo’s other generator annotations and avoids the TypeError.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py`:
- Around line 247-256: The timeout handling around
asyncio.wait_for(process.communicate(), timeout=config.timeout_seconds) in the
Hermes CLI runner only catches TimeoutError, so a CancelledError can leave the
subprocess running and skip cleanup. Update the try/except in the register.py
flow to also handle asyncio.CancelledError alongside the existing timeout path,
ensuring process.kill(), await process.wait(),
_inject_relay_events(relay_atof_path), and relay_temp_dir.cleanup() still run
before re-raising the cancellation.
- Around line 141-147: The prompt is currently being passed through
_build_hermes_args into the chat command argv, which exposes user content in
process listings and logs. Update the Hermes invocation path in
_build_hermes_args/register.py to avoid placing the prompt on the command line;
instead route it through stdin or a prompt file if Hermes supports it, or add
clear documentation/explicit handling of the privacy tradeoff if no safer input
path exists. Keep the provider/model argument handling intact.
---
Nitpick comments:
In
`@plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py`:
- Around line 299-304: The _stream_fn return annotation uses the one-argument
AsyncGenerator form, which is invalid on the Python 3.11 target used here.
Update the _stream_fn signature in nat_hermes_agent_adapter/register.py to use
AsyncGenerator[ChatResponseChunk, None] so it matches the repo’s other generator
annotations and avoids the TypeError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2f4d033d-4741-4abd-a5eb-378c46d17255
📒 Files selected for processing (10)
packages/nemo_platform/pyproject.tomlplugins/nemo-agents/examples/hermes-agent/README.mdplugins/nemo-agents/examples/hermes-agent/hermes-agent.ymlplugins/nemo-agents/pyproject.tomlplugins/nemo-agents/src/nemo_agents_plugin/container/validator.pyplugins/nemo-agents/tests/unit/test_container.pyplugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.pyplugins/nemo-agents/vendor/hermes_agent_adapter/README.mdplugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/__init__.pyplugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/register.py
✅ Files skipped from review due to trivial changes (5)
- plugins/nemo-agents/vendor/hermes_agent_adapter/src/nat_hermes_agent_adapter/init.py
- plugins/nemo-agents/examples/hermes-agent/hermes-agent.yml
- plugins/nemo-agents/vendor/hermes_agent_adapter/README.md
- plugins/nemo-agents/tests/unit/test_container.py
- plugins/nemo-agents/examples/hermes-agent/README.md
🚧 Files skipped from review as they are similar to previous changes (4)
- plugins/nemo-agents/pyproject.toml
- plugins/nemo-agents/tests/unit/test_hermes_adapter_packaging.py
- plugins/nemo-agents/src/nemo_agents_plugin/container/validator.py
- packages/nemo_platform/pyproject.toml
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
|
Summary
Adds experimental Hermes agent support to
nemo-agentsby vendoring the NATHermes adapter and wiring it into the plugin package, following the same pattern
used for the Codex, Cursor, and Claude Code adapters.
This PR:
plugins/nemo-agentsnat.componentsentry pointhermes_agentin nemo-agents config validationexisting vendoring approach
User Flow
Users install/use
nemo-agentsas usual, then provide a config with:The included example is:
The Hermes adapter requires
uvxandnemo-relayto be installed onPATH,with Hermes Agent authentication/model configuration already set up. Relay is
used internally by the adapter to run Hermes and bridge Hermes events into NAT
telemetry.
The example config uses:
Model Passthrough Note
The spike called out that Hermes owns provider/model configuration outside of
NAT's normal
llms:primitive. That concern is still valid: the Hermes adapterdoes not use
llm_nameto resolve a NAT LLM.There is, however, a practical passthrough path. The adapter accepts
Hermes-specific
providerandmodelfields and forwards them to the HermesCLI as
--providerand--model.For example:
If those fields are omitted, Hermes falls back to its own local auth/model
configuration. So platform/NAT model capabilities still cannot be attached
uniformly through the standard NAT
llms:path, but users can override theHermes provider/model through adapter-level passthrough fields.
Validation
Focused tests:
Result:
Additional checks:
Manual smoke tests:
uvx --from hermes-agent hermes setupuvx --from hermes-agent hermes authuvx --from hermes-agent hermes modeluvx --from hermes-agent hermes statusnemo agents create --name hermes-agent --agent-config plugins/nemo-agents/examples/hermes-agent/hermes-agent.ymlnemo agents deploy --agent hermes-agentnemo agents invoke --agent hermes-agent --input "Read pyproject.toml and say only the project name. Do not edit files."Invoke returned:
Summary by CodeRabbit
hermes_agent) for agent runs.hermes_agent, preventing “unknown type” warnings.PATHbehavior.