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 -->
Audit found the v0.0.49 release notes promised behaviors that did not ship or were never implemented. Realign to the actual code on main. - Drop the EXDEV runtime-deps claim: #3820 was reverted by #4051 in this release window, so the behavior is not present. - Drop the "skip broad permission repair" claim: no corresponding commit in v0.0.48..v0.0.49. - Rewrite the gateway probe classifier list in release-notes.mdx and commands.mdx to match the real states emitted by src/lib/status-command-deps.ts (named gateway unreachable / present but not Connected / pointing at a different name / not configured). The previous "non-JSON health response" example did not exist in code. - Expand the channel-removal bullet to describe #4001's user-visible teardown (durable QR-paired state wipe, abort-on-failure, config.json re-sync) in addition to the existing #4013 sync. - Add bullets for user-visible PRs that were merged in the release window but missing from the notes: #3854 (restricted dmesg in debug output), #3866 (shields status and logs --tail UX), #3984 (Hermes messaging policy scoping), and #4011 (Docker group security note). Regenerated nemoclaw-user-overview and nemoclaw-user-reference skills from the updated docs via scripts/docs-to-skills.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary Refreshes the NemoClaw docs for the v0.0.49 hardening release, including release notes, command reference updates, troubleshooting guidance, version metadata, and regenerated user skills. ## Changes - #3796, #3854, #3863, #3866, #3984, #4001, #4011, #4013, #4020, #4022, #4023, #4060, #4062 -> `docs/about/release-notes.mdx`: Adds the v0.0.49 hardening release summary covering gateway reliability, status/doctor/shields and debug UX, OpenClaw compatibility, messaging channel teardown, Hermes policy scoping, snapshots, source installs and Docker group security note, GPU preflight, CLI usage, E2E, and CI improvements. - #3796 -> `docs/manage-sandboxes/backup-restore.mdx` and `docs/reference/commands.mdx`: Documents `snapshot restore --to` overwrite protection and the `--force` opt-in. - #3863, #4013, #4020, #4023 -> `docs/reference/commands.mdx`: Documents missing channel argument usage, sandbox-scoped custom preset matching, session policy preset sync, and gateway failure classification (uses the real probe states from `src/lib/status-command-deps.ts`). - #4022, #4060, #4062 -> `docs/reference/troubleshooting.mdx`: Adds guidance for gateway-down `connect`, source checkout OpenShell bootstrapping, WDDM placeholder GPU names, and Jetson sandbox GPU passthrough. - Release prep -> `docs/project.json`, `docs/versions1.json`, `.agents/skills/nemoclaw-user-*`: Bumps docs metadata to 0.0.49 and refreshes generated user skills from the Fern docs. ## 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 locally but did not complete because \`npm\` returned \`403 Forbidden\` while fetching \`fern-api\` from \`registry.npmjs.org\` in the sandboxed environment. --- Signed-off-by: Miyoung Choi <miyoungc@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Released v0.0.49 with reliability and compatibility improvements including faster gateway failure diagnostics and safer snapshot restore behavior * Enhanced snapshot restore documentation with `--to` cloning and `--force` overwrite requirements * Expanded troubleshooting guides for source installs, GPU setup, and gateway recovery * Clarified Docker group access requirements and improved CLI command reference * **Chores** * Version bumped to 0.0.49 <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4078?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 --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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