fix(hermes): ship stock Hermes default soul + move env info to env-hint#4524
Conversation
The default SOUL.md was a generic placeholder. SOUL.md is the Hermes agent *identity* slot; it should carry the stock Hermes default soul verbatim (hermes_cli/default_soul.py DEFAULT_SOUL_MD), not a hand-written blurb. Execution-environment facts (OpenShell sandbox, NemoClaw routing, L7 proxy credential rewriting, mount layout) belong in Hermes's environment-hints block, not the identity slot. They now flow through HERMES_ENVIRONMENT_HINT, which Hermes appends to the system prompt's environment slot and reads once at prompt-build time (cache-safe).
📝 WalkthroughWalkthroughThis PR updates the Hermes agent's initialization configuration in Docker. It replaces the SOUL.md default identity text with stock Hermes defaults and introduces a new ChangesHermes Agent Identity and Environment Setup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
agents/hermes/Dockerfile (1)
130-145: Run the Hermes E2E subset before merge.This change affects identity/environment prompt wiring, so run the recommended Hermes onboarding/health/inference E2Es on this branch.
As per coding guidelines: "E2E test recommendation:
hermes-e2e,hermes-inference-switch-e2e,hermes-discord-e2e,hermes-slack-e2e,hermes-onboard-security-posture-e2e,rebuild-hermes-e2e,rebuild-hermes-stale-base-e2e."🤖 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 `@agents/hermes/Dockerfile` around lines 130 - 145, This change touches Hermes identity and environment wiring (the /sandbox/.hermes/SOUL.md write and the HERMES_ENVIRONMENT_HINT ENV), so before merging run the recommended Hermes E2E suites to validate onboarding, health, and inference flows: execute hermes-e2e, hermes-inference-switch-e2e, hermes-discord-e2e, hermes-slack-e2e, hermes-onboard-security-posture-e2e, rebuild-hermes-e2e, and rebuild-hermes-stale-base-e2e (ensure tests exercise the SOUL.md content and HERMES_ENVIRONMENT_HINT behavior in prompt_builder.build_environment_hints and the sandbox runtime).
🤖 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.
Nitpick comments:
In `@agents/hermes/Dockerfile`:
- Around line 130-145: This change touches Hermes identity and environment
wiring (the /sandbox/.hermes/SOUL.md write and the HERMES_ENVIRONMENT_HINT ENV),
so before merging run the recommended Hermes E2E suites to validate onboarding,
health, and inference flows: execute hermes-e2e, hermes-inference-switch-e2e,
hermes-discord-e2e, hermes-slack-e2e, hermes-onboard-security-posture-e2e,
rebuild-hermes-e2e, and rebuild-hermes-stale-base-e2e (ensure tests exercise the
SOUL.md content and HERMES_ENVIRONMENT_HINT behavior in
prompt_builder.build_environment_hints and the sandbox runtime).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ff47ae43-a854-4d78-a7a8-2c32e9a78268
📒 Files selected for processing (1)
agents/hermes/Dockerfile
|
The
Hermes reads To take effect, the |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Selective E2E Results — ✅ All requested jobs passedRun: 26650633562
|
Selective E2E Results — ✅ All requested jobs passedRun: 26650737978
|
ericksoa
left a comment
There was a problem hiding this comment.
Approved after merging current main into the PR branch, confirming DCO on the PR body, and validating the Hermes-focused nightly slice on head 22ec125. The selected Hermes E2Es all passed in https://github.com/NVIDIA/NemoClaw/actions/runs/26650737978, and current PR checks/review threads are clean.
Summary
Ship the stock Hermes default soul in
agents/hermes/Dockerfileand move the OpenShell/NemoClaw environment description into Hermes's dedicated environment-hint slot.The default
SOUL.mdwas a hand-written placeholder. In Hermes,SOUL.mdis the agent identity slot (slot # 1 of the system prompt) — it should carry the stock Hermes default soul verbatim, not a custom blurb. Execution-environment facts (sandbox, proxy, credential handling, mount layout) belong in Hermes's environment-hints block instead.Changes
SOUL.mdnow contains Hermes'sDEFAULT_SOUL_MD(hermes_cli/default_soul.py) verbatim — the same identity every Hermes install ships with.ENV HERMES_ENVIRONMENT_HINT=.... Hermes appends this to the system prompt's environment-hints block (agent/prompt_builder.py:build_environment_hints), reading it once at prompt-build time so it stays in the cache-safe portion of the prompt.Why
Dependency note
HERMES_ENVIRONMENT_HINTis introduced upstream in NousResearch/hermes-agent#34574. Until the sandbox base image includes that build, the env var is simply ignored (unknown env vars are a no-op), so this change is safe to merge ahead of the base-image bump — the environment text just won't appear in the prompt until Hermes ships the hook. Once the base image picks up the upstream release, the hint takes effect automatically.Validation
printf '%s' '<DEFAULT_SOUL_MD>'rendered end-to-end through bash: clean output, no quoting breakage (single-quoted, no embedded apostrophes).hermes_cli/default_soul.pyDEFAULT_SOUL_MDbyte-for-byte.Summary by CodeRabbit
Signed-off-by: Aaron Erickson aerickson@nvidia.com