Skip to content

fix(messaging): reject channel adds on agents that do not support messaging - #5743

Merged
cv merged 15 commits into
mainfrom
fix/deepagents-messaging-agent-coercion
Jun 24, 2026
Merged

fix(messaging): reject channel adds on agents that do not support messaging#5743
cv merged 15 commits into
mainfrom
fix/deepagents-messaging-agent-coercion

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

nemoclaw <sandbox> channels add <channel> refuses messaging-channel mutations on agents whose manifest declares no supported messaging platforms, before any sandbox mutation. Previously the channel-add path tore down the sandbox before failing in patchStagedDockerfile, because the messaging utils silently coerced unknown agents to "openclaw" and treated an explicit empty platform allowlist as "no restriction".

Related Issue

Refs #5729 — this PR intentionally addresses the destructive late rebuild failure with a safe early rejection/no-mutation contract for DeepAgents. It does not claim functional DeepAgents Discord/Telegram/Slack channel-ready support until a DeepAgents messaging bridge and health path exist.

Changes

  • src/lib/messaging/utils.ts: add tryGetMessagingAgentId, MessagingAgentNotSupportedError, isMessagingSupportedAgent. toMessagingAgentId throws on explicit unknown agents; null/undefined/empty still falls back to "openclaw". getMessagingManifestAvailabilityContext distinguishes messagingPlatforms: undefined (no restriction) from [] (explicit empty allowlist) and propagates a nullable agent id.
  • src/lib/messaging/manifest/registry.ts: listAvailable treats supportedChannelIds: [] as "no channels available".
  • src/lib/messaging/compiler/workflow-planner.ts: supportedChannelIds() mirrors the same Array.isArray(...) semantics so an explicit empty allowlist denies every configured channel at the planner boundary.
  • src/lib/actions/sandbox/policy-channel.ts: addSandboxChannel gates with isMessagingSupportedAgent before resolving presets, planning, or any sandbox mutation.
  • src/lib/actions/sandbox/rebuild.ts: stageMessagingManifestPlanForRebuild clears the staged plan env and returns null for non-messaging agents instead of throwing late in the patch step. Function is now exported for regression coverage.
  • src/lib/messaging/utils.test.ts: 15 cases covering all new helpers.
  • src/lib/messaging/manifest/registry.test.ts: explicit [] vs omitted / null supportedChannelIds cases.
  • src/lib/messaging/compiler/workflow-planner.test.ts: planner deny-all case for supportedChannelIds: [].
  • src/lib/actions/sandbox/policy-channel-agent-gate.test.ts: action-level regression; addSandboxChannel exits non-zero for langchain-deepagents-code and for any agent with messagingPlatforms: [], with no preset / policy / provider / registry / credential / rebuild call before exit.
  • src/lib/actions/sandbox/rebuild-messaging-stage.test.ts: stageMessagingManifestPlanForRebuild clears the plan env and returns null for non-messaging agents.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • 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)
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Messaging channel setup now blocks non-messaging agents earlier with a clearer error, before making any changes.
    • Rebuilds skip messaging manifest planning when messaging isn’t supported, and previously stored messaging plans are cleared accordingly.
    • Messaging allowlist handling now correctly treats an explicit empty allowlist ([]) as “allow none” for availability, compilation, and rebuild filtering.
  • Tests
    • Added/expanded regression coverage for messaging allowlist filtering (including []) and rebuild/plan skip behavior for messaging vs non-messaging agents.

…saging

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@github-code-quality

github-code-quality Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix/deepagents-messa... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/deepagents-messa... 4b6a0a4 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the fix/deepagents-messa... branch is 47%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/deepagents-messa... 4b6a0a4 +/-
src/lib/state/o...oard-session.ts 91%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 70%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 60%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/policy/index.ts 49%
src/lib/onboard.ts 18%

Updated June 24, 2026 22:27 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds messaging-agent support checks, treats empty channel allowlists as active filters, updates policy-channel persistence for non-messaging agents, and skips rebuild messaging plan staging for unsupported agents.

Changes

Messaging agent gate and registry update

Layer / File(s) Summary
Messaging utilities and availability context
src/lib/messaging/utils.ts, src/lib/messaging/utils.test.ts
Adds supported-agent validation, nullable agent resolution, and updated availability-context handling for missing, unsupported, and empty-allowlist inputs.
Manifest registry allowlist filtering
src/lib/messaging/manifest/registry.ts, src/lib/messaging/manifest/registry.test.ts
Treats array-valued supportedChannelIds as an active filter, including the empty-array case, and updates coverage for empty, null, and undefined inputs.
Sandbox channel add gate
src/lib/actions/sandbox/policy-channel.ts, src/lib/actions/sandbox/policy-channel-agent-gate.test.ts
Adds an early messaging-support check in addSandboxChannel and verifies unsupported agents exit before preset loading, policy mutation, or rebuild work.
Policy-channel plan persistence
src/lib/actions/sandbox/policy-channel.ts, src/lib/actions/sandbox/policy-channel-cleanup.test.ts
Changes manifest-channel plan persistence to use nullable messaging-agent ids, clears stale messaging state for non-messaging agents during remove, returns false for disabled plans when no messaging agent id exists, and adds regression coverage for stale-plan cleanup and non-messaging behavior.
Rebuild messaging plan skip
src/lib/actions/sandbox/rebuild.ts, src/lib/actions/sandbox/rebuild-messaging-stage.test.ts, src/lib/actions/sandbox/rebuild-flow.test.ts
Exports stageMessagingManifestPlanForRebuild, switches rebuild staging to nullable agent resolution, clears the plan environment for unsupported agents, and updates tests and harness data for supported and unsupported rebuild paths.
Workflow planner allowlist behavior
src/lib/messaging/compiler/workflow-planner.ts, src/lib/messaging/compiler/workflow-planner.test.ts
Filters rebuild plans against supportedChannelIds, treats empty arrays as active filters, and adds coverage for narrowed, empty, and rejected channel sets.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • jyaunches

Poem

🐇 I hopped through gates both old and new,
Empty lists now mean “none for you.”
The plan gets cleared, the path stays tight,
And messaging bounces on just right.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The fix prevents the rebuild error by rejecting unsupported agents, but it does not let DeepAgents add messaging channels successfully as the issue expects. Implement DeepAgents messaging support in the rebuild path, or update its manifest/Dockerfile so channels can be added without early rejection.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: rejecting channel adds on agents without messaging support.
Out of Scope Changes check ✅ Passed The changes stay focused on messaging-agent gating, rebuild handling, and related registry/planner tests; no unrelated scope is evident.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deepagents-messaging-agent-coercion

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: onboard-resume-e2e, onboard-repair-e2e, cloud-onboard-e2e, channels-add-remove-e2e, channels-stop-start-openclaw-e2e, channels-stop-start-hermes-e2e, rebuild-openclaw-e2e, messaging-providers-e2e, network-policy-e2e
Optional E2E: messaging-compatible-endpoint-e2e, runtime-overrides-e2e

Dispatch hint: onboard-resume-e2e,onboard-repair-e2e,cloud-onboard-e2e,channels-add-remove-e2e,channels-stop-start-openclaw-e2e,channels-stop-start-hermes-e2e,rebuild-openclaw-e2e,messaging-providers-e2e,network-policy-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • onboard-resume-e2e (medium): Required by the onboarding resume compatibility rule because the PR touches src/lib/onboard/machine sandbox handler/state-transition-adjacent code and onboard.ts. This must not rely only on unit/runtime-boundary tests.
  • onboard-repair-e2e (medium): Required by the onboarding resume compatibility rule because the PR changes machine/onboarding state paths that can affect repair and resume recovery from partial sessions.
  • cloud-onboard-e2e (medium): The onboard.ts, sandbox handler, messaging setup/state, and agent selection changes can affect the full hosted onboarding path that creates a real sandbox and routes inference through OpenShell.
  • channels-add-remove-e2e (medium): policy-channel.ts changes the agent messaging gate, stale-plan cleanup, policy preset mutation ordering, credential/provider behavior, and rebuild trigger path for channel add/remove. This job exercises the real OpenClaw channel add/remove lifecycle, rebuild, gateway credential reuse, policy-list, and cleanup boundaries.
  • channels-stop-start-openclaw-e2e (medium): persistManifestChannelDisabledPlan and related messaging plan logic changed. The OpenClaw stop/start job exercises real channel pause/resume, registry state, policy-list, provider reuse, and rebuild behavior for a messaging-capable runtime.
  • channels-stop-start-hermes-e2e (medium): The same stop/start messaging plan changes should be validated against Hermes because the agent capability allowlist and channel lifecycle code explicitly branches over messaging-capable agents openclaw and hermes.
  • rebuild-openclaw-e2e (medium): rebuild.ts now stages messaging manifest plans and clears stale plan environment during rebuilds. A real OpenClaw rebuild validates sandbox lifecycle, registry/state restore, and messaging-placeholder behavior through Docker/OpenShell.
  • messaging-providers-e2e (medium): Messaging manifests, manifest metadata, workflow planning, and build applier code changed. This job validates the live messaging credential provider/placeholder/L7 proxy chain for Telegram, Discord, and Slack with fake tokens.
  • network-policy-e2e (medium): Channel add/remove code controls policy preset loading and policy mutation ordering. This job gives required confidence that real sandbox network policy allow/deny behavior still works after policy-channel changes.

Optional E2E

  • messaging-compatible-endpoint-e2e (medium): Useful adjacent coverage because onboarding messaging setup and docs mention Telegram plus compatible endpoint inference.local smoke behavior; this validates messaging plus routed inference through a hermetic OpenAI-compatible mock.
  • runtime-overrides-e2e (medium): Optional confidence for sandbox image/startup entrypoint boundaries after changes to the Deep Agents Code Dockerfile and start.sh, though it does not directly exercise the Deep Agents agent image.

New E2E recommendations

  • agent-runtime-deepagents (high): No existing live E2E job appears to onboard or rebuild a LangChain Deep Agents Code sandbox. This PR changes that agent's Dockerfile, manifest, startup env loading, and messaging build-applier integration, so unit image tests do not cover the real user flow.
    • Suggested test: Add a langchain-deepagents-code onboard/rebuild live E2E that runs nemoclaw onboard --agent langchain-deepagents-code, verifies dcode/config startup, inference.local routing, and rebuild state migration.
  • messaging-channel-lifecycle (high): The PR intentionally gates messaging for agents with an empty messaging platform allowlist, including Deep Agents Code. Existing channel E2Es cover OpenClaw/Hermes success paths but not a live non-messaging-agent rejection before policy/provider/credential mutation.
    • Suggested test: Add a channels add rejection E2E for a Deep Agents Code sandbox that verifies channels add telegram fails before preset application, registry mutation, credential prompt/provider upsert, or rebuild.
  • sandbox-rebuild-lifecycle (medium): The new rebuild guard clears stale NEMOCLAW_MESSAGING_PLAN_B64 for non-messaging agents. Existing rebuild E2Es focus on OpenClaw/Hermes; there is no live stale messaging-plan rebuild test for a non-messaging agent.
    • Suggested test: Add a non-messaging-agent stale messaging plan rebuild E2E that seeds registry messaging state, rebuilds the sandbox, and asserts no messaging plan reaches Dockerfile build/apply phases.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: onboard-resume-e2e,onboard-repair-e2e,cloud-onboard-e2e,channels-add-remove-e2e,channels-stop-start-openclaw-e2e,channels-stop-start-hermes-e2e,rebuild-openclaw-e2e,messaging-providers-e2e,network-policy-e2e

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: onboard-resume-vitest, onboard-repair-vitest, cloud-onboard-vitest, rebuild-openclaw-vitest, channels-add-remove-vitest, channels-stop-start-vitest, messaging-providers-vitest
Optional Vitest E2E scenarios: messaging-compatible-endpoint-vitest

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=cloud-onboard-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=rebuild-openclaw-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-add-remove-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-stop-start-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=messaging-providers-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • onboard-resume-vitest: Changes touch onboard state/session flow and sandbox machine handling; the resume compatibility rule requires the dedicated live onboard resume job.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • onboard-repair-vitest: The same onboard state-machine and persisted-session surfaces can affect repair/backstop execution, so repair coverage is required alongside resume.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest
  • cloud-onboard-vitest: Baseline cloud onboarding can be affected by src/lib/onboard.ts, sandbox machine handler, and messaging setup/state changes.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=cloud-onboard-vitest
  • rebuild-openclaw-vitest: src/lib/actions/sandbox/rebuild.ts changes messaging-plan staging and rebuild behavior; run the live OpenClaw rebuild job.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=rebuild-openclaw-vitest
  • channels-add-remove-vitest: policy-channel and messaging planner changes affect channel add/remove, provider registration, policy mutation, rebuild, and cleanup paths.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-add-remove-vitest
  • channels-stop-start-vitest: Changes to persisted disabled-channel planning and messaging-agent support gates affect pause/resume behavior for channels.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-stop-start-vitest
  • messaging-providers-vitest: Messaging channel manifests, metadata, workflow planning, setup, and state handling changed; run live provider/placeholder/channel contract coverage.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=messaging-providers-vitest

Optional Vitest E2E scenarios

  • messaging-compatible-endpoint-vitest: Adjacent coverage for Telegram messaging with a compatible endpoint and inference.local routing; useful because messaging setup/state and channel planning changed.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=messaging-compatible-endpoint-vitest

Relevant changed files

  • agents/langchain-deepagents-code/Dockerfile
  • agents/langchain-deepagents-code/manifest.yaml
  • agents/langchain-deepagents-code/start.sh
  • src/lib/actions/sandbox/policy-channel.ts
  • src/lib/actions/sandbox/rebuild.ts
  • src/lib/messaging/applier/build/messaging-build-applier.mts
  • src/lib/messaging/channels/discord/manifest.ts
  • src/lib/messaging/channels/metadata.ts
  • src/lib/messaging/channels/slack/manifest.ts
  • src/lib/messaging/channels/telegram/manifest.ts
  • src/lib/messaging/compiler/workflow-planner.ts
  • src/lib/messaging/manifest/types.ts
  • src/lib/messaging/utils.ts
  • src/lib/onboard.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/messaging-channel-setup.ts
  • src/lib/onboard/messaging-state.ts

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocked

Merge posture: Do not merge until addressed
Primary next action: Fix PRA-3: Known empty-allowlist agents cannot remove stale messaging plans; then add or justify PRA-T1.
Open items: 1 required · 3 warnings · 0 suggestions · 5 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 2 new items found

Action checklist

  • PRA-3 Fix: Known empty-allowlist agents cannot remove stale messaging plans in src/lib/actions/sandbox/policy-channel.ts:782
  • PRA-1 Resolve or justify: Source-of-truth review needed: Unsupported-agent messaging plan cleanup
  • PRA-2 Resolve or justify: Source-of-truth review needed: DeepAgents startup `.env` tolerant parsing
  • PRA-4 Resolve or justify: Malformed DeepAgents messaging env lines can be echoed with secret material in agents/langchain-deepagents-code/start.sh:68
  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Acceptance clause
  • PRA-T4 Add or justify test follow-up: Unsupported-agent messaging plan cleanup
  • PRA-T5 Add or justify test follow-up: DeepAgents startup `.env` tolerant parsing

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-3 Required correctness src/lib/actions/sandbox/policy-channel.ts:782 Treat `!isMessagingSupportedAgent(agent)` the same as the unknown-agent cleanup branch for channel remove: if `entry.messaging?.plan` exists, clear `messaging` from the registry and return that update result; otherwise return `true`. Keep pause/resume fail-closed behavior separate.
PRA-4 Resolve/justify security agents/langchain-deepagents-code/start.sh:68 Do not print the raw parsed key for invalid lines. Log a fixed redacted message, or only log after validating the key against a safe identifier regex and the allowlist; never include the value or whole line.

🚨 Required before merge

Address these before merging unless a maintainer explicitly overrides the advisor with rationale.

PRA-3 Required — Known empty-allowlist agents cannot remove stale messaging plans

  • Location: src/lib/actions/sandbox/policy-channel.ts:782
  • Category: correctness
  • Problem: `persistManifestChannelRemovePlan()` only strips stale registry messaging state when `tryGetMessagingAgentId(agent)` returns `null`. DeepAgents is now a known `MessagingAgentId`, but its manifest deliberately declares `messagingPlatforms: []`, so a stale OpenClaw/Hermes messaging plan on a DeepAgents sandbox falls through to the planner with `supportedChannelIds: []`; the planner returns `null`, and this function returns `false` without clearing `entry.messaging`.
  • Impact: A user with stale messaging state on a DeepAgents or other known deny-all agent cannot use the remove cleanup path to make the invalid state disappear. That leaves the registry/session source of truth inconsistent with the manifest and contradicts the PR's safe stale-plan cleanup contract for non-messaging agents.
  • Required action: Treat `!isMessagingSupportedAgent(agent)` the same as the unknown-agent cleanup branch for channel remove: if `entry.messaging?.plan` exists, clear `messaging` from the registry and return that update result; otherwise return `true`. Keep pause/resume fail-closed behavior separate.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read `persistManifestChannelRemovePlan()` and verify the cleanup branch is keyed only on `agentId === null`, then compare with `isMessagingSupportedAgent()` where known agents with `messagingPlatforms: []` return false.
  • Missing regression test: Add a `persistManifestChannelRemovePlan` regression where `loadAgent()` returns `{ name: "langchain-deepagents-code", messagingPlatforms: [] }` and `getSandbox()` returns an entry with a stale plan; assert it returns `true` and calls `updateSandbox("da-test", { messaging: undefined })`.
  • Done when: The required change is committed and verification passes: Read `persistManifestChannelRemovePlan()` and verify the cleanup branch is keyed only on `agentId === null`, then compare with `isMessagingSupportedAgent()` where known agents with `messagingPlatforms: []` return false.
  • Evidence: The new cleanup tests cover `custom-agent` with `messagingPlatforms: []`, but not a known deny-all runtime. `src/lib/messaging/utils.ts` makes DeepAgents known while `agents/langchain-deepagents-code/manifest.yaml` keeps `messaging_platforms.supported: []`.
Review findings by urgency: 1 required fix, 3 items to resolve/justify, 0 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — Source-of-truth review needed: Unsupported-agent messaging plan cleanup

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Existing tests cover unknown-agent cleanup, rebuild skip, and onboard filtering, but the known empty-allowlist cleanup case is missing.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `persistManifestChannelRemovePlan()` clears only when `agentId === null`; DeepAgents is a known messaging build ID with an explicit empty platform allowlist.

PRA-2 Resolve/justify — Source-of-truth review needed: DeepAgents startup `.env` tolerant parsing

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Existing tests prove values are literal and untrusted keys are not exported, but no test proves malformed invalid lines are redacted from stderr.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `load_messaging_env()` logs the raw `key` value for invalid lines; when the line lacks `=`, that key is the whole line.

PRA-4 Resolve/justify — Malformed DeepAgents messaging env lines can be echoed with secret material

  • Location: agents/langchain-deepagents-code/start.sh:68
  • Category: security
  • Problem: `load_messaging_env()` logs `Skipping invalid Deep Agents Code messaging env line for key %s` using `key="${line%%=*}"`. For malformed lines without `=`, `key` is the entire line, so a malformed token-bearing line in `/sandbox/.deepagents/.env` can be emitted to stderr during sandbox startup.
  • Impact: A generated, restored, or user-edited `.deepagents/.env` containing a malformed secret line such as a pasted bot token without `KEY=` can leak that secret into startup logs. This is especially sensitive because the changed startup script now handles messaging token names.
  • Recommended action: Do not print the raw parsed key for invalid lines. Log a fixed redacted message, or only log after validating the key against a safe identifier regex and the allowlist; never include the value or whole line.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect `load_messaging_env()` in `agents/langchain-deepagents-code/start.sh` and note that the no-`=` branch passes the whole line to the warning message.
  • Missing regression test: Extend the start.sh fixture test with a malformed line such as `xoxb-secret-without-equals` or `SLACK_BOT_TOKEN xoxb-secret`; assert stderr and `/tmp/nemoclaw-proxy-env.sh` do not contain the secret string.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect `load_messaging_env()` in `agents/langchain-deepagents-code/start.sh` and note that the no-`=` branch passes the whole line to the warning message.
  • Evidence: The existing test proves command substitutions are not executed and untrusted keys are not exported, but it does not assert that malformed invalid lines are redacted from stderr.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Add `persistManifestChannelRemovePlan clears stale messaging for langchain-deepagents-code with messagingPlatforms: []` and assert registry `messaging` is removed.. The PR has strong unit/spawn coverage for planner/action/rebuild/build-applier boundaries, but it changes Dockerfile, sandbox startup, and stale lifecycle cleanup paths where behavior depends on runtime state. The concrete missing tests are tied to the current findings.
  • PRA-T2 Runtime validation — Add `DeepAgents start.sh redacts malformed token-bearing env lines without equals` and assert stderr plus `/tmp/nemoclaw-proxy-env.sh` omit the token string.. The PR has strong unit/spawn coverage for planner/action/rebuild/build-applier boundaries, but it changes Dockerfile, sandbox startup, and stale lifecycle cleanup paths where behavior depends on runtime state. The concrete missing tests are tied to the current findings.
  • PRA-T3 Acceptance clause — `channels remove` should strip the stored messaging plan from the registry, `channels pause/resume` should fail closed (no throw, no plan mutation). — add test evidence or identify existing coverage. `persistManifestChannelRemovePlan()` strips stale state for unknown agents, and pause/resume returns null without mutation for unsupported agents. It does not strip stale state for known agents with `messagingPlatforms: []`, including DeepAgents, because only the `agentId === null` branch clears registry messaging.
  • PRA-T4 Unsupported-agent messaging plan cleanup — Existing tests cover unknown-agent cleanup, rebuild skip, and onboard filtering, but the known empty-allowlist cleanup case is missing.. `persistManifestChannelRemovePlan()` clears only when `agentId === null`; DeepAgents is a known messaging build ID with an explicit empty platform allowlist.
  • PRA-T5 DeepAgents startup `.env` tolerant parsing — Existing tests prove values are literal and untrusted keys are not exported, but no test proves malformed invalid lines are redacted from stderr.. `load_messaging_env()` logs the raw `key` value for invalid lines; when the line lacks `=`, that key is the whole line.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: Unsupported-agent messaging plan cleanup

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Existing tests cover unknown-agent cleanup, rebuild skip, and onboard filtering, but the known empty-allowlist cleanup case is missing.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `persistManifestChannelRemovePlan()` clears only when `agentId === null`; DeepAgents is a known messaging build ID with an explicit empty platform allowlist.

PRA-2 Resolve/justify — Source-of-truth review needed: DeepAgents startup `.env` tolerant parsing

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Existing tests prove values are literal and untrusted keys are not exported, but no test proves malformed invalid lines are redacted from stderr.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `load_messaging_env()` logs the raw `key` value for invalid lines; when the line lacks `=`, that key is the whole line.

PRA-3 Required — Known empty-allowlist agents cannot remove stale messaging plans

  • Location: src/lib/actions/sandbox/policy-channel.ts:782
  • Category: correctness
  • Problem: `persistManifestChannelRemovePlan()` only strips stale registry messaging state when `tryGetMessagingAgentId(agent)` returns `null`. DeepAgents is now a known `MessagingAgentId`, but its manifest deliberately declares `messagingPlatforms: []`, so a stale OpenClaw/Hermes messaging plan on a DeepAgents sandbox falls through to the planner with `supportedChannelIds: []`; the planner returns `null`, and this function returns `false` without clearing `entry.messaging`.
  • Impact: A user with stale messaging state on a DeepAgents or other known deny-all agent cannot use the remove cleanup path to make the invalid state disappear. That leaves the registry/session source of truth inconsistent with the manifest and contradicts the PR's safe stale-plan cleanup contract for non-messaging agents.
  • Required action: Treat `!isMessagingSupportedAgent(agent)` the same as the unknown-agent cleanup branch for channel remove: if `entry.messaging?.plan` exists, clear `messaging` from the registry and return that update result; otherwise return `true`. Keep pause/resume fail-closed behavior separate.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read `persistManifestChannelRemovePlan()` and verify the cleanup branch is keyed only on `agentId === null`, then compare with `isMessagingSupportedAgent()` where known agents with `messagingPlatforms: []` return false.
  • Missing regression test: Add a `persistManifestChannelRemovePlan` regression where `loadAgent()` returns `{ name: "langchain-deepagents-code", messagingPlatforms: [] }` and `getSandbox()` returns an entry with a stale plan; assert it returns `true` and calls `updateSandbox("da-test", { messaging: undefined })`.
  • Done when: The required change is committed and verification passes: Read `persistManifestChannelRemovePlan()` and verify the cleanup branch is keyed only on `agentId === null`, then compare with `isMessagingSupportedAgent()` where known agents with `messagingPlatforms: []` return false.
  • Evidence: The new cleanup tests cover `custom-agent` with `messagingPlatforms: []`, but not a known deny-all runtime. `src/lib/messaging/utils.ts` makes DeepAgents known while `agents/langchain-deepagents-code/manifest.yaml` keeps `messaging_platforms.supported: []`.

PRA-4 Resolve/justify — Malformed DeepAgents messaging env lines can be echoed with secret material

  • Location: agents/langchain-deepagents-code/start.sh:68
  • Category: security
  • Problem: `load_messaging_env()` logs `Skipping invalid Deep Agents Code messaging env line for key %s` using `key="${line%%=*}"`. For malformed lines without `=`, `key` is the entire line, so a malformed token-bearing line in `/sandbox/.deepagents/.env` can be emitted to stderr during sandbox startup.
  • Impact: A generated, restored, or user-edited `.deepagents/.env` containing a malformed secret line such as a pasted bot token without `KEY=` can leak that secret into startup logs. This is especially sensitive because the changed startup script now handles messaging token names.
  • Recommended action: Do not print the raw parsed key for invalid lines. Log a fixed redacted message, or only log after validating the key against a safe identifier regex and the allowlist; never include the value or whole line.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect `load_messaging_env()` in `agents/langchain-deepagents-code/start.sh` and note that the no-`=` branch passes the whole line to the warning message.
  • Missing regression test: Extend the start.sh fixture test with a malformed line such as `xoxb-secret-without-equals` or `SLACK_BOT_TOKEN xoxb-secret`; assert stderr and `/tmp/nemoclaw-proxy-env.sh` do not contain the secret string.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect `load_messaging_env()` in `agents/langchain-deepagents-code/start.sh` and note that the no-`=` branch passes the whole line to the warning message.
  • Evidence: The existing test proves command substitutions are not executed and untrusted keys are not exported, but it does not assert that malformed invalid lines are redacted from stderr.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/messaging/utils.test.ts (1)

96-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add an explicit null/undefined availability-context test.

getMessagingManifestAvailabilityContext() now has two distinct nullable cases: unknown agent names and no agent provided. This suite locks the first one, but the second is also a real caller path via setupMessagingChannels(..., agent = null), so it’s worth pinning separately.

Suggested test case
 describe("getMessagingManifestAvailabilityContext", () => {
+  it("returns a null agent when no agent is provided", () => {
+    expect(getMessagingManifestAvailabilityContext(null)).toEqual({
+      agent: null,
+      supportedChannelIds: null,
+    });
+    expect(getMessagingManifestAvailabilityContext(undefined)).toEqual({
+      agent: null,
+      supportedChannelIds: null,
+    });
+  });
+
   it("returns the resolved messaging agent id and an explicit allowlist when present", () => {
🤖 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/messaging/utils.test.ts` around lines 96 - 136, Add a dedicated test
for the no-agent case in getMessagingManifestAvailabilityContext, since
null/undefined input is distinct from an unknown agent name. In
src/lib/messaging/utils.test.ts, extend the existing
getMessagingManifestAvailabilityContext describe block with an assertion that
calling it without an agent (or with null) returns agent: null and the expected
supportedChannelIds value, matching the setupMessagingChannels default path.
Keep the unknown-agent test separate so both nullable cases are explicitly
covered.
🤖 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/messaging/utils.test.ts`:
- Around line 96-136: Add a dedicated test for the no-agent case in
getMessagingManifestAvailabilityContext, since null/undefined input is distinct
from an unknown agent name. In src/lib/messaging/utils.test.ts, extend the
existing getMessagingManifestAvailabilityContext describe block with an
assertion that calling it without an agent (or with null) returns agent: null
and the expected supportedChannelIds value, matching the setupMessagingChannels
default path. Keep the unknown-agent test separate so both nullable cases are
explicitly covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 96e5bcd3-2c2d-404d-a891-baca47331b19

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb9754 and b977fe4.

📒 Files selected for processing (6)
  • src/lib/actions/sandbox/policy-channel.ts
  • src/lib/actions/sandbox/rebuild.ts
  • src/lib/messaging/manifest/registry.test.ts
  • src/lib/messaging/manifest/registry.ts
  • src/lib/messaging/utils.test.ts
  • src/lib/messaging/utils.ts

…reach rebuild

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…ing allowlist

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@src/lib/actions/sandbox/rebuild-messaging-stage.test.ts`:
- Around line 121-132: The empty-allowlist case in
stageMessagingManifestPlanForRebuild is not being distinguished from the
unsupported-agent path, so tighten the test to assert the specific log message
emitted via the message callback when an allowlisted agent has no available
channels. Update the test around stageMessagingManifestPlanForRebuild to capture
the callback output in messages and add an assertion that proves the
empty-allowlist branch was taken, while keeping the existing clearPlanEnvSpy,
writePlanEnvSpy, and result checks intact.
🪄 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: 8b09601b-6ab2-43ec-920a-3d06c6c58ef4

📥 Commits

Reviewing files that changed from the base of the PR and between ae0e554 and 9597381.

📒 Files selected for processing (3)
  • src/lib/actions/sandbox/rebuild-flow.test.ts
  • src/lib/actions/sandbox/rebuild-messaging-stage.test.ts
  • src/lib/actions/sandbox/rebuild.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/actions/sandbox/rebuild.ts

Comment thread src/lib/actions/sandbox/rebuild-messaging-stage.test.ts
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: messaging Messaging channels, bridges, manifests, or channel lifecycle bug-fix PR fixes a bug or regression labels Jun 24, 2026
@wscurran

Copy link
Copy Markdown
Contributor

…ebuild

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…out throwing

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
… on rebuild

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…ing-agent-coercion

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

# Conflicts:
#	src/lib/actions/sandbox/policy-channel.ts
#	src/lib/actions/sandbox/rebuild.ts
#	src/lib/messaging/compiler/workflow-planner.ts
…ction test

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…ing-agent-coercion

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…artup

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@cv cv added the v0.0.68 label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv enabled auto-merge (squash) June 24, 2026 22:34

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after follow-up fixes: CI is green, PR Review Advisor is passing after narrowing the #5729 linkage to the safe early-rejection/no-mutation contract, and DeepAgents channel support remains gated until a bridge/health path exists.

@cv
cv merged commit bfc3824 into main Jun 24, 2026
59 of 62 checks passed
@cv
cv deleted the fix/deepagents-messaging-agent-coercion branch June 24, 2026 22:34
@sandl99

sandl99 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

FYI @cv @laitingsheng
I missed this PR, but this PR introduced some redundant code and separate source of truth of messaging channels.
Here are some points.

  1. Treat each channel manifest’s supportedAgents as the source of truth for messaging support, not messaging_platforms in deep_agent manifest.
  2. Remove the DeepAgents render entries added inside the existing Telegram/Discord/Slack manifests; there is no dedicated DeepAgents channel manifest.
  3. Do not add DeepAgents-specific startup or Dockerfile messaging plumbing while no channel manifest lists langchain-deepagents-code.

I'll create a new PR to reframe.

@miyoungc miyoungc mentioned this pull request Jun 25, 2026
21 tasks
cv pushed a commit that referenced this pull request Jun 25, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the v0.0.68 docs with release notes, Microsoft Teams messaging
guidance, and generated support-matrix coverage.
Also corrects the Hermes generated command reference so `sessions
export` examples match Hermes-only behavior while keeping the shared
command heading compatible with CLI parity checks.

## Changes
- #5585 -> `docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/platform-support.mdx`: Documents experimental Microsoft
Teams channel setup, Bot Framework credentials, webhook forwarding,
local `MSTEAMS_PORT` conflicts, and the generated integration support
row.
- #5526 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`: Keeps Hermes `sessions export`
examples on the supported single-JSONL export path while preserving the
canonical shared CLI heading.
- #5044 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for installer onboarding failure propagation.
- #5641 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for fresh recovery after pre-sandbox installer interruption.
- #5673 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for explicit deny-all messaging manifests.
- #5743 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for unsupported-agent channel-add rejection.
- #5252 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Hermes `gateway-token` dashboard guidance.
- #5659 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for local OpenClaw `agent` wrapper help.
- #5661 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for default extra-agent paths.
- #5669 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code branding.
- #5672 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for hosted-compatible default model ID preservation.
- #5725 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code sandbox liveness.
- #5644 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for DGX Spark managed-vLLM express install defaults.
- #5712 -> `docs/about/release-notes.mdx`,
`docs/reference/platform-support.mdx`: Adds v0.0.68 release-note
coverage for the canonical support matrix and updates the matrix source
with Teams.

## 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)

## 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: docs-only release refresh;
no runtime code changed.
- [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) — `npm
run docs` passed with 0 errors; Fern reported the existing light-mode
accent contrast warning.
- [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)

Additional verification:
- `python3 scripts/generate-platform-docs.py --check` passed.
- `npm run docs:sync-agent-variants` passed.
- `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli`
passed.
- `npm run docs` passed with 0 errors and one Fern theme warning:
light-mode accent contrast ratio is 2.41:1 and should be at least 3:1.
- `npm run build:cli` refreshed local untracked `dist/` artifacts after
rebase; no tracked files changed.
- `npm run typecheck:cli` passed.
- Normal commit and push hooks passed after the local CLI rebuild.

---
<!-- 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: Miyoung Choi <miyoungc@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added **Microsoft Teams** as an experimental messaging channel,
including manifest-first onboarding, local port routing/conflict
handling, sandbox delivery controls, and policy preset support.

* **Documentation**
* Expanded messaging-channel setup for Teams (prerequisites,
credential/webhook setup, wizard flow, and add/remove commands).
* Updated reference docs for **agent-specific** session export examples
(OpenClaw vs Hermes).
* Refreshed platform support guidance and added the latest release-notes
entry.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
cv added a commit that referenced this pull request Jun 26, 2026
## Summary
Derive supported messaging agents and channels from channel manifests
instead of agent manifests, so `supportedAgents` is the source of truth.
This also removes artifact-only DeepAgents messaging wiring and rejects
unsupported channel/agent pairs before policy, provider, credential,
registry, or rebuild mutation.

## Related Issue
Related PRs: #5743, #5673. Stacked on #5768, Fixes #5729

## Acceptance Note
DeepAgents messaging is intentionally fail-closed in this PR. NemoClaw
does not claim Discord, Telegram, Slack, or other channel delivery for
LangChain Deep Agents Code until a real DeepAgents messaging bridge
exists. The fix for #5729 is to reject unsupported DeepAgents channel
setup before policy, credential, registry, rebuild, or Dockerfile
mutation, instead of injecting a stale messaging plan into a sandbox
that cannot consume inbound channel traffic.

## Changes
- Remove `messaging_platforms` parsing from agent manifests and derive
available channels from channel manifest `supportedAgents`.
- Remove DeepAgents messaging build/runtime artifacts until a real
messaging bridge exists.
- Gate `channels add`, `channels list`, onboard filtering, and rebuild
staging from manifest-derived channel support.
- Update regression tests for DeepAgents rejection, stale messaging
cleanup, rebuild skipping, and manifest helper behavior.
- Update platform-support docs to reference channel manifest
`supportedAgents`.

## 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)

## Verification
- [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] 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
- [ ] `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)

---
<!-- 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: San Dang <sdang@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Messaging channel availability is now derived from each channel
manifest’s `supportedAgents`, improving enable/disable, rebuild
planning, and channel status matching.
* DeepAgents startup and rebuild no longer include unsupported messaging
runtime wiring, env handling, or messaging artifacts.
* Channel add/cleanup gates now reject unsupported agent/channel pairs
earlier with clearer “channel-supported agents” guidance.
* **Documentation**
* Updated platform support and DeepAgents eligibility guidance to make
`supportedAgents` the single source of truth for messaging support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: San Dang <sdang@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…saging (NVIDIA#5743)

## Summary

`nemoclaw <sandbox> channels add <channel>` refuses messaging-channel
mutations on agents whose manifest declares no supported messaging
platforms, before any sandbox mutation. Previously the channel-add path
tore down the sandbox before failing in `patchStagedDockerfile`, because
the messaging utils silently coerced unknown agents to `"openclaw"` and
treated an explicit empty platform allowlist as "no restriction".

## Related Issue

Refs NVIDIA#5729 — this PR intentionally addresses the destructive late
rebuild failure with a safe early rejection/no-mutation contract for
DeepAgents. It does not claim functional DeepAgents
Discord/Telegram/Slack channel-ready support until a DeepAgents
messaging bridge and health path exist.

## Changes

- `src/lib/messaging/utils.ts`: add `tryGetMessagingAgentId`,
`MessagingAgentNotSupportedError`, `isMessagingSupportedAgent`.
`toMessagingAgentId` throws on explicit unknown agents;
null/undefined/empty still falls back to `"openclaw"`.
`getMessagingManifestAvailabilityContext` distinguishes
`messagingPlatforms: undefined` (no restriction) from `[]` (explicit
empty allowlist) and propagates a nullable agent id.
- `src/lib/messaging/manifest/registry.ts`: `listAvailable` treats
`supportedChannelIds: []` as "no channels available".
- `src/lib/messaging/compiler/workflow-planner.ts`:
`supportedChannelIds()` mirrors the same `Array.isArray(...)` semantics
so an explicit empty allowlist denies every configured channel at the
planner boundary.
- `src/lib/actions/sandbox/policy-channel.ts`: `addSandboxChannel` gates
with `isMessagingSupportedAgent` before resolving presets, planning, or
any sandbox mutation.
- `src/lib/actions/sandbox/rebuild.ts`:
`stageMessagingManifestPlanForRebuild` clears the staged plan env and
returns `null` for non-messaging agents instead of throwing late in the
patch step. Function is now exported for regression coverage.
- `src/lib/messaging/utils.test.ts`: 15 cases covering all new helpers.
- `src/lib/messaging/manifest/registry.test.ts`: explicit `[]` vs
omitted / null `supportedChannelIds` cases.
- `src/lib/messaging/compiler/workflow-planner.test.ts`: planner
deny-all case for `supportedChannelIds: []`.
- `src/lib/actions/sandbox/policy-channel-agent-gate.test.ts`:
action-level regression; `addSandboxChannel` exits non-zero for
`langchain-deepagents-code` and for any agent with `messagingPlatforms:
[]`, with no preset / policy / provider / registry / credential /
rebuild call before exit.
- `src/lib/actions/sandbox/rebuild-messaging-stage.test.ts`:
`stageMessagingManifestPlanForRebuild` clears the plan env and returns
`null` for non-messaging agents.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [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] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes
- [ ] `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 setup now blocks non-messaging agents earlier with a
clearer error, before making any changes.
* Rebuilds skip messaging manifest planning when messaging isn’t
supported, and previously stored messaging plans are cleared
accordingly.
* Messaging allowlist handling now correctly treats an explicit empty
allowlist (`[]`) as “allow none” for availability, compilation, and
rebuild filtering.
* **Tests**
* Added/expanded regression coverage for messaging allowlist filtering
(including `[]`) and rebuild/plan skip behavior for messaging vs
non-messaging agents.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the v0.0.68 docs with release notes, Microsoft Teams messaging
guidance, and generated support-matrix coverage.
Also corrects the Hermes generated command reference so `sessions
export` examples match Hermes-only behavior while keeping the shared
command heading compatible with CLI parity checks.

## Changes
- NVIDIA#5585 -> `docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/platform-support.mdx`: Documents experimental Microsoft
Teams channel setup, Bot Framework credentials, webhook forwarding,
local `MSTEAMS_PORT` conflicts, and the generated integration support
row.
- NVIDIA#5526 -> `docs/reference/commands.mdx`,
`docs/reference/commands-nemohermes.mdx`: Keeps Hermes `sessions export`
examples on the supported single-JSONL export path while preserving the
canonical shared CLI heading.
- NVIDIA#5044 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for installer onboarding failure propagation.
- NVIDIA#5641 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for fresh recovery after pre-sandbox installer interruption.
- NVIDIA#5673 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for explicit deny-all messaging manifests.
- NVIDIA#5743 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for unsupported-agent channel-add rejection.
- NVIDIA#5252 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Hermes `gateway-token` dashboard guidance.
- NVIDIA#5659 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for local OpenClaw `agent` wrapper help.
- NVIDIA#5661 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for default extra-agent paths.
- NVIDIA#5669 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code branding.
- NVIDIA#5672 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for hosted-compatible default model ID preservation.
- NVIDIA#5725 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for Deep Agents Code sandbox liveness.
- NVIDIA#5644 -> `docs/about/release-notes.mdx`: Adds v0.0.68 release-note
coverage for DGX Spark managed-vLLM express install defaults.
- NVIDIA#5712 -> `docs/about/release-notes.mdx`,
`docs/reference/platform-support.mdx`: Adds v0.0.68 release-note
coverage for the canonical support matrix and updates the matrix source
with Teams.

## 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)

## 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: docs-only release refresh;
no runtime code changed.
- [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) — `npm
run docs` passed with 0 errors; Fern reported the existing light-mode
accent contrast warning.
- [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)

Additional verification:
- `python3 scripts/generate-platform-docs.py --check` passed.
- `npm run docs:sync-agent-variants` passed.
- `bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-cli`
passed.
- `npm run docs` passed with 0 errors and one Fern theme warning:
light-mode accent contrast ratio is 2.41:1 and should be at least 3:1.
- `npm run build:cli` refreshed local untracked `dist/` artifacts after
rebase; no tracked files changed.
- `npm run typecheck:cli` passed.
- Normal commit and push hooks passed after the local CLI rebuild.

---
<!-- 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: Miyoung Choi <miyoungc@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added **Microsoft Teams** as an experimental messaging channel,
including manifest-first onboarding, local port routing/conflict
handling, sandbox delivery controls, and policy preset support.

* **Documentation**
* Expanded messaging-channel setup for Teams (prerequisites,
credential/webhook setup, wizard flow, and add/remove commands).
* Updated reference docs for **agent-specific** session export examples
(OpenClaw vs Hermes).
* Refreshed platform support guidance and added the latest release-notes
entry.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Derive supported messaging agents and channels from channel manifests
instead of agent manifests, so `supportedAgents` is the source of truth.
This also removes artifact-only DeepAgents messaging wiring and rejects
unsupported channel/agent pairs before policy, provider, credential,
registry, or rebuild mutation.

## Related Issue
Related PRs: NVIDIA#5743, NVIDIA#5673. Stacked on NVIDIA#5768, Fixes NVIDIA#5729

## Acceptance Note
DeepAgents messaging is intentionally fail-closed in this PR. NemoClaw
does not claim Discord, Telegram, Slack, or other channel delivery for
LangChain Deep Agents Code until a real DeepAgents messaging bridge
exists. The fix for NVIDIA#5729 is to reject unsupported DeepAgents channel
setup before policy, credential, registry, rebuild, or Dockerfile
mutation, instead of injecting a stale messaging plan into a sandbox
that cannot consume inbound channel traffic.

## Changes
- Remove `messaging_platforms` parsing from agent manifests and derive
available channels from channel manifest `supportedAgents`.
- Remove DeepAgents messaging build/runtime artifacts until a real
messaging bridge exists.
- Gate `channels add`, `channels list`, onboard filtering, and rebuild
staging from manifest-derived channel support.
- Update regression tests for DeepAgents rejection, stale messaging
cleanup, rebuild skipping, and manifest helper behavior.
- Update platform-support docs to reference channel manifest
`supportedAgents`.

## 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)

## Verification
- [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] 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
- [ ] `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)

---
<!-- 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: San Dang <sdang@nvidia.com>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Messaging channel availability is now derived from each channel
manifest’s `supportedAgents`, improving enable/disable, rebuild
planning, and channel status matching.
* DeepAgents startup and rebuild no longer include unsupported messaging
runtime wiring, env handling, or messaging artifacts.
* Channel add/cleanup gates now reject unsupported agent/channel pairs
earlier with clearer “channel-supported agents” guidance.
* **Documentation**
* Updated platform support and DeepAgents eligibility guidance to make
`supportedAgents` the single source of truth for messaging support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: San Dang <sdang@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: messaging Messaging channels, bridges, manifests, or channel lifecycle bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants