fix(policy): scope Hermes messaging policies#3984
Conversation
Signed-off-by: San Dang <sdang@nvidia.com>
📝 WalkthroughWalkthroughAdds Hermes messaging-channel filtering during initial sandbox policy preparation (producing a temporary filtered policy when creating Hermes sandboxes) and introduces sandbox-aware preset loading so preset application/removal uses agent-provided preset variants when available. ChangesHermes messaging policy filtering and agent-aware presets
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
PR Review AdvisorRecommendation: blocked This is an automated advisory review. A human maintainer must make the final merge decision. Limitations: No commands, package-manager operations, tests, or PR scripts were executed by this advisory review.; The supplied diff is truncated; conclusions rely on trusted deterministic context plus the visible diff excerpts.; CI and E2E status is not final for head SHA 6024262.; E2E Advisor recommendations were found, but required job pass/fail results for the current head SHA were not supplied.; Linked issue #3981 has zero comments in the supplied trusted context; acceptance mapping uses the issue body clauses only.; Human maintainer review is required for final merge decisions, especially because this PR changes sandbox policy and network egress behavior. Full advisor summaryPR Review AdvisorBase: Do not merge yet: GitHub mergeability is BLOCKED, CI/E2E are still pending for 6024262, required Hermes/network-policy E2E evidence is missing, and src/lib/policy/index.ts grew as a current monolith hotspot. Gate status
🔴 Blockers
🟡 Warnings
🔵 Suggestions
Acceptance coverage
Security review
Test / E2E status
✅ What looks good
Review completeness
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/lib/onboard/initial-policy.ts`:
- Around line 203-206: isHermesPolicyPath currently only matches when the
normalized path ends with "/agents/hermes/policy-additions.yaml", so relative
variants like "agents/hermes/policy-additions.yaml" are missed; update
isHermesPolicyPath to normalize separators and then compare against a target
fragment (e.g., "agents/hermes/policy-additions.yaml") using either equality or
endsWith on the normalized string (for example check normalized === target ||
normalized.endsWith("/" + target) or simply normalized.endsWith(target)) to
correctly detect both relative and absolute paths; refer to the function name
isHermesPolicyPath and the parameter policyPath when making the change.
In `@src/lib/policy/index.ts`:
- Around line 108-128: selectAgentPolicyKeys fails to resolve Hermes presets
when built-in presetName (e.g., "wechat") doesn't match the Hermes policy key
(e.g., "wechat_bridge"); add an alias mapping lookup before the final fallback
so known mismatches map to the correct agent policy key(s). In
selectAgentPolicyKeys, after checking builtinKeys and direct presetName key, add
logic to consult a small alias map (e.g., { "wechat": ["wechat_bridge"] }) and
return any matching keys present in agentPolicies; keep the existing fallback
that matches value.name === presetName for other cases. Ensure you reference
selectAgentPolicyKeys, agentPolicies, presetName and builtinPresetContent when
implementing the alias lookup.
🪄 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: 5f790ed3-a5a8-4ca5-bdb9-1ed7d55c4264
📒 Files selected for processing (5)
agents/hermes/policy-additions.yamlsrc/lib/onboard/initial-policy.test.tssrc/lib/onboard/initial-policy.tssrc/lib/policy/index.tstest/policies.test.ts
Signed-off-by: San Dang <sdang@nvidia.com>
Selective E2E Results — ✅ All requested jobs passedRun: 26218614241
|
On-device verification — DGX Spark (aarch64, GB10)Validated Setup
Before (v0.0.48 — broken)After (this PR — fixed)Verification checklist
LGTM — the Hermes-specific policy resolution fixes the Discord breakage we reported. Ready to merge. |
## Summary Refreshes NemoClaw release notes for v0.0.47 and v0.0.48, then regenerates the corresponding user-skill references so agent-facing docs match the source pages. Preview: https://nvidia-preview-docs-release-notes-47-48.docs.buildwithfern.com/nemoclaw/about/release-notes ## Changes - Adds explicit v0.0.47 and v0.0.48 sections to `docs/about/release-notes.mdx`. - Documents follow-up WSL Ollama, sandbox image, share mount, and troubleshooting updates from recent release changes. - Regenerates `nemoclaw-user-*` skill references from the Fern MDX source docs. ## Source Summary - #4003 -> `docs/about/release-notes.mdx`: Notes the messaging manifest registry work as part of v0.0.48 release coverage. - #3984 -> `docs/about/release-notes.mdx`: Captures Hermes messaging policy scoping in the v0.0.48 release notes. - #3963 -> `docs/about/release-notes.mdx`: Captures DGX Spark Hermes GPU recreation startup recovery in the v0.0.48 release notes. - #3961 -> `docs/about/release-notes.mdx`: Captures Discord loopback proxy routing in the v0.0.48 release notes. - #3940 -> `docs/about/release-notes.mdx`: Captures installer prompt clarification and express-install behavior in the v0.0.48 release notes. - #3946 -> `docs/about/release-notes.mdx`: Carries forward the Homebrew preinstall clarification in release coverage. - #3937 -> `docs/about/release-notes.mdx`: Carries forward the dashboard URL command and post-install next steps coverage. - #3921 -> `docs/about/release-notes.mdx`: Carries forward managed vLLM default behavior for DGX Spark and DGX Station. - #3931 -> `docs/about/release-notes.mdx`, `docs/reference/architecture.mdx`: Documents the sandbox `python` to `python3` compatibility symlink. - #1485 -> `docs/about/release-notes.mdx`, `docs/reference/architecture.mdx`: Documents the sandbox image Docker health check. - #3784 -> `docs/about/release-notes.mdx`: Captures VM-driver snapshot health-check reliability in release notes. - #3917 -> `docs/about/release-notes.mdx`: Captures package-based workspace template resolution in release notes. - #3170 -> `docs/about/release-notes.mdx`: Captures installer checksum compatibility from preferring `sha256sum`. - #3898 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage for messaging provider scenario validation. - #3897 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage for baseline onboarding scenario validation. - #3834 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage for PR review advisor automation. - #3838 -> `docs/about/release-notes.mdx`: Adds v0.0.47 release coverage for CLI display registry refactoring. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [x] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [ ] `npm test` passes - [ ] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [x] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) `make docs` was attempted but could not complete because `npx fern-api` failed with `403 Forbidden` from `https://registry.npmjs.org/fern-api` in this environment. Pre-commit and pre-push hooks passed after refreshing the local CLI build output with `npm run build:cli`; no build artifacts were committed. --- Signed-off-by: Miyoung Choi <miyoungc@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added WSL onboarding notes for Windows-host Ollama detection, restart guidance, and PowerShell checks. * Clarified express-install behavior (non-interactive, sudo prompts) and default sandbox policy selection. * Added Windows preparation guidance when installer tooling is missing (winget/App Installer or Docker Desktop). * Expanded sandbox docs with Docker health checks, Homebrew/python compatibility helpers, share-mount path validation, Discord troubleshooting, and new v0.0.48/v0.0.47 release notes. * **Chores** * Improved docs preview workflow error handling. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4007?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
This PR scopes Hermes messaging policy so selected channels are applied without pre-enabling every Hermes messaging provider. It also makes dynamic preset application use Hermes-specific policy content, preventing Discord from falling back to generic Node-oriented allowlists on Hermes sandboxes.

Related Issue
Fixes #3981
Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Additional checks run:
npm run build:clinpm run typecheck:clinpm run source-shape:checknpx vitest run src/lib/onboard/initial-policy.test.ts test/policies.test.tsgit commitgit push(including TypeScript CLI, CLI tests, and source-shape budget)Signed-off-by: San Dang sdang@nvidia.com
Summary by CodeRabbit
New Features
Refactor
Documentation
Tests