Skip to content

feat(channels): canonicalise channel name and hint missing preset#3448

Merged
cv merged 2 commits into
mainfrom
feat/sandbox-channels-add-remove-ux
May 14, 2026
Merged

feat(channels): canonicalise channel name and hint missing preset#3448
cv merged 2 commits into
mainfrom
feat/sandbox-channels-add-remove-ux

Conversation

@laitingsheng

@laitingsheng laitingsheng commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Two follow-up UX improvements to channels add / channels remove that were originally part of #3392 but are independent of WhatsApp and so can land first: lowercase + trim the channel name once after lookup so the canonical form is used everywhere downstream, and after a successful add, print a one-line hint when the matching network preset exists but has not been applied yet.

Related Issue

Carved out of #3392 to keep the WhatsApp PR focused on the QR-paired flow.

Changes

  • src/lib/actions/sandbox/policy-channel.ts:
    • addSandboxChannel and removeSandboxChannel compute const canonical = channelArg.trim().toLowerCase(); right after getChannelDef resolves the channel, then use canonical in every downstream log line, registry write, gateway provider name, and rebuild reason. Previously channels add Telegram and channels add telegram produced mismatched strings.
    • New maybeHintPolicyPresetForChannel helper. Runs after the gateway upsert in addSandboxChannel. When a builtin preset with the same name as the channel exists (policies.listPresets()) but is not in policies.getAppliedPresets(sandboxName), print a one-line hint pointing at policy-add <channel>. Without the preset the rebuilt sandbox cannot reach the channel service, which is currently a silent failure mode.
  • test/cli.test.ts: extend the existing channels mutation dry-run paths dispatch through oclif test with two assertions that channels add Telegram --dry-run and channels remove Telegram --dry-run print the lowercased 'telegram' in the dry-run message.

No behaviour change for the gateway/registry data path; canonicalisation only affects user-visible strings and the bridge provider name (which getChannelDef already canonicalised internally for lookup).

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

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make 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

    • Channel names are now normalized to lowercase for consistent handling across add/remove, validation, messaging, and registry updates.
  • New Features

    • Post-registration hints now suggest applicable network presets when adding channels, helping you discover and apply relevant sandbox configurations.
  • Tests

    • CLI dry-run tests extended to cover mixed-case channel input, verifying normalization and expected messaging.

Review Change Stack

`channels add` and `channels remove` previously echoed the raw
`channelArg` back into log lines, registry writes, and rebuild reasons,
so `channels add Telegram` and `channels add telegram` left mismatched
strings behind. Lowercase + trim the arg once after `getChannelDef`
narrows it, then use the canonical form everywhere downstream.

After a successful `channels add`, also print a one-line hint when the
matching network preset (telegram/discord/slack) exists in the builtin
list but is not yet applied to the sandbox, pointing the user at the
`policy-add <channel>` command. Without the preset the rebuilt sandbox
cannot reach the channel service, which is currently a silent failure
mode.

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

copy-pr-bot Bot commented May 13, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8979fb5c-b5cf-450f-929f-53350a20f24d

📥 Commits

Reviewing files that changed from the base of the PR and between 02394be and df9276e.

📒 Files selected for processing (1)
  • test/cli.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/cli.test.ts

📝 Walkthrough

Walkthrough

Channel arguments are now normalized to lowercase canonical form across add and remove operations. The add flow includes a new preset hint that logs policy-add instructions when a matching network preset exists but isn't applied. Test coverage validates mixed-case channel names.

Changes

Channel argument normalization

Layer / File(s) Summary
Add channel normalization and messaging
src/lib/actions/sandbox/policy-channel.ts
addSandboxChannel normalizes channel argument to canonical lowercase, using it in dry-run output, validation error messages, gateway/registry updates, and rebuild queuing. New maybeHintPolicyPresetForChannel() helper logs a policy-add instruction when a matching preset exists but is not yet applied.
Remove channel normalization and messaging
src/lib/actions/sandbox/policy-channel.ts
removeSandboxChannel normalizes channel argument to canonical lowercase, using it in dry-run output, gateway/registry deletion, success logging, and rebuild queuing.
Case-insensitive channel name test coverage
test/cli.test.ts
CLI test suite extended to verify mixed-case Telegram channel names for both add and remove commands in --dry-run mode, asserting normalized lowercase output.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 Channel names now speak in whispers,
Lowercase canonical, through all the gates,
A preset hint hops softly into place,
And tests confirm the rabbit's careful trace! 🌙

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(channels): canonicalise channel name and hint missing preset' directly and accurately describes the two main changes in the pull request: canonicalisation of channel names and the new hint for missing policy presets.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feat/sandbox-channels-add-remove-ux

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: messaging-providers-e2e
Optional E2E: network-policy-e2e

Dispatch hint: messaging-providers-e2e

Auto-dispatched E2E: messaging-providers-e2e via nightly-e2e.yaml at df9276eb6ba1eb3f979b6c16eb0448228205289f

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • messaging-providers-e2e (medium (~45 min timeout)): Best existing coverage for messaging credential provider creation, sandbox attachment, credential isolation, channel config patching, network reachability, and L7 token rewriting for Telegram/Discord/Slack. The PR changes channel add/remove provider/registry behavior and should be validated against the real OpenShell gateway/provider pipeline.

Optional E2E

  • network-policy-e2e (medium/high (~60 min timeout)): Optional confidence for the new channel-to-policy-preset hint adjacency: this job exercises policy presets, dry-run, live policy-add, hot reload, and sandbox network reachability. The PR does not change policy enforcement itself, so this is useful but not merge-blocking.

New E2E recommendations

  • post-onboard messaging channel lifecycle (high): Existing E2E coverage validates messaging providers during install/onboard, but no inspected E2E directly exercises nemoclaw <sandbox> channels add <channel> and channels remove <channel> after a sandbox already exists. The changed code specifically affects that lifecycle, including mixed-case canonicalization, OpenShell provider create/delete names, registry updates, and deferred rebuild prompts.
    • Suggested test: Add a lightweight E2E that onboards a sandbox without messaging channels, runs channels add Telegram with fake credentials in non-interactive mode, asserts canonical telegram registry/provider state and the network-preset hint when the preset is absent, then runs channels remove Telegram and verifies providers and registry entries are removed.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: messaging-providers-e2e

@laitingsheng laitingsheng removed the fix label May 13, 2026
@laitingsheng laitingsheng marked this pull request as ready for review May 13, 2026 08:51
@cv cv added v0.0.42 and removed v0.0.41 labels May 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 25876106446
Target ref: df9276eb6ba1eb3f979b6c16eb0448228205289f
Workflow ref: main
Requested jobs: messaging-providers-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
messaging-providers-e2e ✅ success

@cv cv merged commit e646b8d into main May 14, 2026
28 checks passed
@miyoungc miyoungc mentioned this pull request May 14, 2026
12 tasks
miyoungc added a commit that referenced this pull request May 14, 2026
## Summary
Refreshes the NemoClaw documentation for the local `main` changes
included in the 0.0.42 release. The update adds release notes, updates
the affected user-facing setup and troubleshooting pages, bumps docs
metadata to 0.0.42, and regenerates the matching user skills.

## Changes
- #3537 -> `docs/reference/commands.md`,
`docs/reference/troubleshooting.md`: Documented host-level status
fields, cloudflared state-specific recovery hints, and Local Ollama auth
proxy status diagnostics.
- #3454 -> `docs/get-started/prerequisites.md`,
`docs/get-started/quickstart.md`: Documented macOS Docker-driver
onboarding and removed the expectation that standard macOS setup needs a
VM driver helper.
- #3514 -> `docs/inference/use-local-inference.md`: Documented
compatible-endpoint retry behavior for reasoning-only smoke responses.
- #3448 -> `docs/reference/commands.md`,
`docs/manage-sandboxes/messaging-channels.md`: Documented canonical
channel names and policy preset hints after `channels add`.
- #3520 -> `docs/about/release-notes.md`: Captured clearer GPU recovery
and uninstall wording in the 0.0.42 release notes.
- #3313 -> `docs/get-started/quickstart.md`,
`docs/reference/troubleshooting.md`: Documented stronger dashboard port
detection and rollback when a forward cannot start.
- #3502 -> `docs/about/release-notes.md`: Captured batched onboarding
policy preset application in the 0.0.42 release notes.
- #3505 -> `docs/reference/troubleshooting.md`: Documented the top-level
Colima socket path.
- #3421 -> `docs/about/release-notes.md`: Captured idempotent installer
shim logging in the 0.0.42 release notes.
- Updated `docs/project.json`, `docs/versions1.json`, and regenerated
`.agents/skills/nemoclaw-user-*` outputs.

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

## Verification
- [ ] `npx prek run --all-files` passes
- [ ] `npm test` passes
- [ ] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [x] `make docs` builds without warnings (doc changes only)
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>

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

## Summary by CodeRabbit

## Release Notes - v0.0.42

* **Documentation**
  * Enhanced macOS onboarding guidance for Docker gateway setup
  * Improved dashboard port conflict handling with automatic rollback
* Better local Ollama inference diagnostics and authentication proxy
checks
  * Clarified status command output and recovery procedures
  * Refined messaging channel setup documentation

* **Chores**
  * Version bump to 0.0.42

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3540)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added the integration: whatsapp WhatsApp integration or channel behavior label May 30, 2026
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output feature PR adds or expands user-visible functionality and removed NemoClaw CLI labels Jun 3, 2026
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 feature PR adds or expands user-visible functionality integration: whatsapp WhatsApp integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants