fix(policy): reject messaging channel presets on terminal-runtime agents - #6197
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Target RecommendationRequired E2E targets: Dispatch required E2E targets:
Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor (Nemotron Ultra) — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
PR Review Advisor — Changes requestedMerge posture: Do not merge yet Action checklist
Findings index
Review findings by urgency: 0 required fixes, 4 items to resolve/justify, 0 in-scope improvements
|
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds agent compatibility rejection for messaging presets in Changespolicy-add channel-agent gate
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-6197.docs.buildwithfern.com/nemoclaw |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@docs/reference/commands-nemohermes.mdx`:
- Around line 824-825: The rejection flow described here matches the behavior of
channels add, not channels list. Update the sentence in the documentation near
the policy-add/channel preset description to reference channels add as the
command that performs the supported-agent check and clear rejection before any
endpoint disclosure or prompt.
🪄 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: ca002f6c-a4bd-4bef-82b2-e79c543281e1
📒 Files selected for processing (5)
docs/reference/commands-nemohermes.mdxdocs/reference/commands.mdxsrc/lib/actions/sandbox/policy-add-agent-gate.test.tssrc/lib/actions/sandbox/policy-channel.tstest/policy-add-deepagents-rejection.test.ts
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/lib/actions/sandbox/policy-channel.ts (1)
373-395: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffMisplaced layer: messaging-channel classification helper lives in the actions file.
unsupportedMessagingChannelForPresetContentis pure decision/classification logic (parses preset content, matches against messaging preset metadata, returns a manifest) with no host/process/network calls. Per thesrc/liblayering guidance, this should live insrc/lib/messaging/**as a messaging-channel/policy classification helper, alongsidelistMessagingPolicyPresetMetadataandisMessagingChannelSupportedByAgent, rather than insrc/lib/actions/sandbox/policy-channel.ts. Keeping it here duplicates the classification concern that's supposed to be centralized in the messaging module and blurs the actions/domain boundary.As per path instructions, "actions orchestrate, domain modules make pure decisions... For this PR's area, place/extend logic in the existing transitional clusters: ...
src/lib/messaging/**for messaging-channel/policy classification helpers."🤖 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 `@src/lib/actions/sandbox/policy-channel.ts` around lines 373 - 395, The helper unsupportedMessagingChannelForPresetContent is pure messaging-channel classification logic, but it currently lives in the sandbox actions layer. Move this decision code into src/lib/messaging/** alongside listMessagingPolicyPresetMetadata and isMessagingChannelSupportedByAgent, then update the actions file to call the centralized helper instead of owning the parsing/matching logic. Keep the behavior the same: parse preset policy keys, match against messaging preset metadata, resolve the manifest, and apply the agent-support gate from the messaging module.Source: Path instructions
src/lib/actions/sandbox/policy-add-agent-gate.test.ts (1)
32-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
MESSAGING_POLICY_KEYSfixture across two test files.The same tuple array (
telegram_bot/discord/slack/wechat_bridge/teamswith hosts) is redefined identically intest/policy-add-deepagents-rejection.test.ts. Extracting it to a small shared test fixture would prevent the two suites from drifting apart if a policy key/host is added or renamed.🤖 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 `@src/lib/actions/sandbox/policy-add-agent-gate.test.ts` around lines 32 - 39, The MESSAGING_POLICY_KEYS tuple is duplicated in this test suite and the deepagents rejection test, so the fixture can drift if policy names or hosts change. Extract the shared array into a common test fixture/helper and import it in both policy-add-agent-gate.test.ts and policy-add-deepagents-rejection.test.ts, keeping the existing tuple contents centralized under the MESSAGING_POLICY_KEYS symbol.test/policy-add-deepagents-rejection.test.ts (1)
139-146: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
MESSAGING_POLICY_KEYSfixture (see companion file).Identical to the array added in
src/lib/actions/sandbox/policy-add-agent-gate.test.ts(Lines 32-39). Consider sharing this fixture between the two suites.Also applies to: 184-207
🤖 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 `@test/policy-add-deepagents-rejection.test.ts` around lines 139 - 146, The MESSAGING_POLICY_KEYS test fixture is duplicated between this suite and the companion sandbox policy test, so it should be shared instead of maintained in two places. Move the array to a common test helper or shared constant module and update the affected tests to import and reuse it from both suites, keeping the existing references in this file and in policy-add-agent-gate.test in sync.
🤖 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 `@src/lib/actions/sandbox/policy-add-agent-gate.test.ts`:
- Around line 32-39: The MESSAGING_POLICY_KEYS tuple is duplicated in this test
suite and the deepagents rejection test, so the fixture can drift if policy
names or hosts change. Extract the shared array into a common test
fixture/helper and import it in both policy-add-agent-gate.test.ts and
policy-add-deepagents-rejection.test.ts, keeping the existing tuple contents
centralized under the MESSAGING_POLICY_KEYS symbol.
In `@src/lib/actions/sandbox/policy-channel.ts`:
- Around line 373-395: The helper unsupportedMessagingChannelForPresetContent is
pure messaging-channel classification logic, but it currently lives in the
sandbox actions layer. Move this decision code into src/lib/messaging/**
alongside listMessagingPolicyPresetMetadata and
isMessagingChannelSupportedByAgent, then update the actions file to call the
centralized helper instead of owning the parsing/matching logic. Keep the
behavior the same: parse preset policy keys, match against messaging preset
metadata, resolve the manifest, and apply the agent-support gate from the
messaging module.
In `@test/policy-add-deepagents-rejection.test.ts`:
- Around line 139-146: The MESSAGING_POLICY_KEYS test fixture is duplicated
between this suite and the companion sandbox policy test, so it should be shared
instead of maintained in two places. Move the array to a common test helper or
shared constant module and update the affected tests to import and reuse it from
both suites, keeping the existing references in this file and in
policy-add-agent-gate.test in sync.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2af0cdd6-4ea3-4430-9bf7-090231697cae
📒 Files selected for processing (3)
src/lib/actions/sandbox/policy-add-agent-gate.test.tssrc/lib/actions/sandbox/policy-channel.tstest/policy-add-deepagents-rejection.test.ts
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary This PR prepares the user-facing documentation for v0.0.73 before the release plan is frozen. It adds release notes for the merged runtime changes and closes documentation gaps around DNS-backed HTTPS endpoint validation and LangChain Deep Agents Code proxy recovery. ## Changes - Add the `v0.0.73` release-note section with links to the detailed command, inference, recovery, lifecycle, platform, and setup documentation. - Correct the custom endpoint guidance so DNS-backed HTTPS rejection and the supported alternatives match the fail-closed runtime behavior. - Document the managed `inference.local` proxy boundary and rebuild requirement for existing LangChain Deep Agents Code sandboxes. - Add troubleshooting guidance for the DNS-backed HTTPS validation error. - Validate with `npm run docs:sync-agent-variants` and `npm run docs`; Fern completed with 0 errors and 2 existing warnings. - Source summary: - [#6139](#6139) -> `docs/about/release-notes.mdx`, `docs/inference/inference-options.mdx`, `docs/reference/commands.mdx`, `docs/reference/commands-nemohermes.mdx`, and `docs/reference/troubleshooting.mdx`: Document fail-closed DNS-backed HTTPS endpoint handling and recovery options. - [#6142](#6142) -> `docs/about/release-notes.mdx`: Summarize native OpenShell GPU injection and compatibility-path diagnostics. - [#6197](#6197) -> `docs/about/release-notes.mdx`: Summarize agent-aware messaging preset rejection. - [#6199](#6199) -> `docs/about/release-notes.mdx`: Summarize the unreachable-sandbox backup opt-in, restore behavior, and data-loss boundary. - [#6204](#6204) and [#6206](#6206) -> `docs/about/release-notes.mdx` and `docs/get-started/quickstart-langchain-deepagents-code.mdx`: Document the corrected managed proxy contract and required sandbox rebuild. - [#6213](#6213) -> `docs/about/release-notes.mdx`: Summarize the merged setup, recovery, and host-state documentation. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: documentation-only release preparation; the Fern docs build validates the changed pages and routes. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [ ] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run 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) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new **v0.0.73** release notes section with six highlights at the top of the changelog. * Expanded **Custom Endpoint URL Validation** guidance in inference option docs, including explicit acceptance/rejection rules for HTTP vs DNS-backed HTTPS and how validated IPs are stored. * Updated command references (`nemohermes inference set`, `$$nemoclaw inference set`) to match the new validation behavior. * Added troubleshooting documentation for unsupported **DNS-backed HTTPS endpoints**, plus clarified Deep Agents Code routing and post-upgrade sandbox rebuild guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…nts (NVIDIA#6197) ## Summary `policy-add` accepted the five messaging channel presets (`telegram`, `discord`, `slack`, `wechat`, `whatsapp`) on terminal-runtime DeepAgents sandboxes, which have no inbound messaging gateway. It now rejects an unsupported channel preset up front, mirroring the existing `channels add` agent gate. ## Related Issue Fixes NVIDIA#6185 ## Changes - `addSandboxPolicy` resolves the sandbox agent and rejects a messaging channel preset the agent's channel manifests do not support, before any endpoint disclosure or confirmation prompt, exiting non-zero. - Unsupported channel presets are dropped from the interactive picker and the valid-presets list. - Reuses the same message and `supportedAgents` source as `channels add`; non-messaging presets and messaging-capable agents (openclaw, hermes) are unaffected. - Docs: note the terminal-runtime rejection in the `policy-add` reference. - Tests: action-boundary unit coverage for all five channels, plus a spawned-process behaviour test asserting non-zero exit, no endpoint disclosure, and no prompt. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] 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) --- Signed-off-by: Tinson Lai <tinsonl@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Messaging-channel presets (Telegram/Discord/Slack/WeChat/WhatsApp) are now rejected when an agent doesn’t support the channel, with a clear error before any confirmation or endpoint disclosure. * `--from-file/--from-dir` custom presets containing messaging policy keys are refused early for unsupported terminal-runtime agents; supported agents still apply them. * **Documentation** * Updated `policy-add` reference docs to clarify messaging-preset applicability and the early-rejection behavior for terminal-runtime agents. * **Tests** * Added/extended tests to verify early rejection, no prompting, and no preset loading/applying. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary This PR prepares the user-facing documentation for v0.0.73 before the release plan is frozen. It adds release notes for the merged runtime changes and closes documentation gaps around DNS-backed HTTPS endpoint validation and LangChain Deep Agents Code proxy recovery. ## Changes - Add the `v0.0.73` release-note section with links to the detailed command, inference, recovery, lifecycle, platform, and setup documentation. - Correct the custom endpoint guidance so DNS-backed HTTPS rejection and the supported alternatives match the fail-closed runtime behavior. - Document the managed `inference.local` proxy boundary and rebuild requirement for existing LangChain Deep Agents Code sandboxes. - Add troubleshooting guidance for the DNS-backed HTTPS validation error. - Validate with `npm run docs:sync-agent-variants` and `npm run docs`; Fern completed with 0 errors and 2 existing warnings. - Source summary: - [NVIDIA#6139](NVIDIA#6139) -> `docs/about/release-notes.mdx`, `docs/inference/inference-options.mdx`, `docs/reference/commands.mdx`, `docs/reference/commands-nemohermes.mdx`, and `docs/reference/troubleshooting.mdx`: Document fail-closed DNS-backed HTTPS endpoint handling and recovery options. - [NVIDIA#6142](NVIDIA#6142) -> `docs/about/release-notes.mdx`: Summarize native OpenShell GPU injection and compatibility-path diagnostics. - [NVIDIA#6197](NVIDIA#6197) -> `docs/about/release-notes.mdx`: Summarize agent-aware messaging preset rejection. - [NVIDIA#6199](NVIDIA#6199) -> `docs/about/release-notes.mdx`: Summarize the unreachable-sandbox backup opt-in, restore behavior, and data-loss boundary. - [NVIDIA#6204](NVIDIA#6204) and [NVIDIA#6206](NVIDIA#6206) -> `docs/about/release-notes.mdx` and `docs/get-started/quickstart-langchain-deepagents-code.mdx`: Document the corrected managed proxy contract and required sandbox rebuild. - [NVIDIA#6213](NVIDIA#6213) -> `docs/about/release-notes.mdx`: Summarize the merged setup, recovery, and host-state documentation. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: documentation-only release preparation; the Fern docs build validates the changed pages and routes. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub - [x] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [ ] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run 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) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new **v0.0.73** release notes section with six highlights at the top of the changelog. * Expanded **Custom Endpoint URL Validation** guidance in inference option docs, including explicit acceptance/rejection rules for HTTP vs DNS-backed HTTPS and how validated IPs are stored. * Updated command references (`nemohermes inference set`, `$$nemoclaw inference set`) to match the new validation behavior. * Added troubleshooting documentation for unsupported **DNS-backed HTTPS endpoints**, plus clarified Deep Agents Code routing and post-upgrade sandbox rebuild guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
policy-addaccepted the five messaging channel presets (telegram,discord,slack,wechat,whatsapp) on terminal-runtime DeepAgents sandboxes, which have no inbound messaging gateway. It now rejects an unsupported channel preset up front, mirroring the existingchannels addagent gate.Related Issue
Fixes #6185
Changes
addSandboxPolicyresolves the sandbox agent and rejects a messaging channel preset the agent's channel manifests do not support, before any endpoint disclosure or confirmation prompt, exiting non-zero.supportedAgentssource aschannels add; non-messaging presets and messaging-capable agents (openclaw, hermes) are unaffected.policy-addreference.Type of Change
Quality Gates
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
--from-file/--from-dircustom presets containing messaging policy keys are refused early for unsupported terminal-runtime agents; supported agents still apply them.policy-addreference docs to clarify messaging-preset applicability and the early-rejection behavior for terminal-runtime agents.