Skip to content

fix(scripts): allow CLI clients in auto-pair watcher#1496

Closed
stevenrick wants to merge 2 commits into
NVIDIA:mainfrom
stevenrick:fix/auto-pair-cli-clients
Closed

fix(scripts): allow CLI clients in auto-pair watcher#1496
stevenrick wants to merge 2 commits into
NVIDIA:mainfrom
stevenrick:fix/auto-pair-cli-clients

Conversation

@stevenrick

@stevenrick stevenrick commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary

The auto-pair watcher in nemoclaw-start.sh rejects CLI device-pairing requests, making the OpenClaw gateway unreachable for all openclaw CLI commands inside the sandbox (channels, status, tui, devices, etc.). Adding 'cli' to ALLOWED_MODES fixes this.

Related Issue

Fixes #1310

Related: #1310

Changes

  • Add 'cli' to ALLOWED_MODES in the auto-pair watcher embedded in scripts/nemoclaw-start.sh

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

Tested on a Brev instance with a fresh nemoclaw onboard:

Before: openclaw channels statusgateway connect failed: GatewayClientRequestError: pairing required

After: openclaw channels statusGateway reachable.

openclaw devices list --json confirms the CLI client is paired with full operator scopes. The existing security comment notes this allowlist is "defense-in-depth, not a trust boundary" — the sandbox user can already execute openclaw agent --local without gateway access.

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Signed-off-by: Steven Rick srick@nvidia.com

Summary by CodeRabbit

  • New Features
    • Expanded device support to include CLI mode in auto-pairing functionality.

Add 'cli' to ALLOWED_MODES so sandbox-internal CLI commands can
connect to the gateway.

Related: #1310

Signed-off-by: Steven Rick <srick@nvidia.com>
@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The auto-pair watcher's client-mode allowlist is expanded to accept both 'webchat' and 'cli' client modes, replacing the single-mode condition. All other control flow, security checks, and validation logic remain unchanged.

Changes

Cohort / File(s) Summary
Client-mode allowlist expansion
scripts/nemoclaw-start.sh
Expanded client-mode condition from exclusively accepting clientMode == 'webchat' to also approving clientMode == 'cli', enabling CLI clients to pass the auto-pair watcher validation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A CLI hops in through the gate,
Where webchat once stood tall and great—
Now both modes dance in harmony,
The watcher smiles, "You're welcome, see?" 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: allowing CLI clients in the auto-pair watcher functionality.
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 unit tests (beta)
  • Create PR with unit tests

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

ericksoa added a commit that referenced this pull request Apr 5, 2026
## Summary

Use the OpenShell provider system for messaging credential injection
instead of raw env var passthrough. Discord, Slack, and Telegram tokens
now flow through the placeholder/proxy pipeline — sandbox processes
never see real values. The host-side Telegram bridge is removed;
messaging channels are baked into `openclaw.json` at image build time
via `NEMOCLAW_MESSAGING_CHANNELS_B64`, and the L7 proxy rewrites
placeholders with real secrets at egress — no runtime config patching
needed.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

## Related Issues

Fixes #1109
Fixes #616
Fixes #1310
Supersedes #617

## Changes

- **`bin/lib/onboard.js`** — Create `generic` providers for Discord,
Slack, and Telegram tokens via `upsertProvider()`. Attach to sandbox via
`--provider` flags. Replace individual env var deletes with a
comprehensive blocklist. Bake messaging channel config into
`openclaw.json` at build time. Collect Telegram user ID for DM
allowlisting.
- **`Dockerfile`** — Accept `NEMOCLAW_MESSAGING_CHANNELS_B64` build arg
and inject channel config into `openclaw.json` at image build time.
- **`scripts/nemoclaw-start.sh`** — Remove dead runtime `openclaw.json`
patching from `configure_messaging_channels`. Allow CLI clients in
auto-pair watcher.
- **`nemoclaw/src/lib/services.ts`** — Remove stale `telegram-bridge`
spawn.
- **`scripts/telegram-bridge.js`** — Removed (replaced by native
OpenClaw channels via providers).
- **`test/onboard.test.js`** — Verify provider create commands,
`--provider` flags on sandbox create, and that real token values never
appear in the sandbox create command.
- **`test/credential-exposure.test.js`** — Updated for expanded
blocklist coverage.
- **`test/e2e/messaging-providers.test.sh`** — New E2E test: provider
creation, sandbox attachment, DM allowlisting.

## Thanks

- @sayalinvidia — tested Discord end-to-end, diagnosed that Landlock
makes `openclaw.json` immutable at runtime in non-root mode, and
proposed the build-time bake approach via
`NEMOCLAW_MESSAGING_CHANNELS_B64` that made this work (PR #1501)
- @mercl-lau — found the stale `telegram-bridge` spawn in `services.ts`
that silently crashed after the bridge script was removed
- @stevenrick — tested Telegram on Brev, independently confirmed the
Landlock issue, and found that the auto-pair watcher rejected CLI
clients (also opened #1496)

## Type of Change

- [x] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing

- [x] `npx prek run --all-files` passes (or equivalently `make check`).
- [x] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)
- [x] E2E validated with real bot tokens on Brev instance

## Checklist

### General

- [x] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes

- [x] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [x] Tests added or updated for new or changed behavior.
- [x] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes

N/A

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: sayalinvidia <sayalinvidia@users.noreply.github.com>
@ericksoa

ericksoa commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Superseded by PR #1081, which cherry picked this into the overall fix on messaging. Thanks for the contribution @stevenrick !

@ericksoa ericksoa closed this Apr 5, 2026
tranzmatt pushed a commit to tranzmatt/NemoClaw that referenced this pull request Apr 6, 2026
…IA#1081)

## Summary

Use the OpenShell provider system for messaging credential injection
instead of raw env var passthrough. Discord, Slack, and Telegram tokens
now flow through the placeholder/proxy pipeline — sandbox processes
never see real values. The host-side Telegram bridge is removed;
messaging channels are baked into `openclaw.json` at image build time
via `NEMOCLAW_MESSAGING_CHANNELS_B64`, and the L7 proxy rewrites
placeholders with real secrets at egress — no runtime config patching
needed.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

## Related Issues

Fixes NVIDIA#1109
Fixes NVIDIA#616
Fixes NVIDIA#1310
Supersedes NVIDIA#617

## Changes

- **`bin/lib/onboard.js`** — Create `generic` providers for Discord,
Slack, and Telegram tokens via `upsertProvider()`. Attach to sandbox via
`--provider` flags. Replace individual env var deletes with a
comprehensive blocklist. Bake messaging channel config into
`openclaw.json` at build time. Collect Telegram user ID for DM
allowlisting.
- **`Dockerfile`** — Accept `NEMOCLAW_MESSAGING_CHANNELS_B64` build arg
and inject channel config into `openclaw.json` at image build time.
- **`scripts/nemoclaw-start.sh`** — Remove dead runtime `openclaw.json`
patching from `configure_messaging_channels`. Allow CLI clients in
auto-pair watcher.
- **`nemoclaw/src/lib/services.ts`** — Remove stale `telegram-bridge`
spawn.
- **`scripts/telegram-bridge.js`** — Removed (replaced by native
OpenClaw channels via providers).
- **`test/onboard.test.js`** — Verify provider create commands,
`--provider` flags on sandbox create, and that real token values never
appear in the sandbox create command.
- **`test/credential-exposure.test.js`** — Updated for expanded
blocklist coverage.
- **`test/e2e/messaging-providers.test.sh`** — New E2E test: provider
creation, sandbox attachment, DM allowlisting.

## Thanks

- @sayalinvidia — tested Discord end-to-end, diagnosed that Landlock
makes `openclaw.json` immutable at runtime in non-root mode, and
proposed the build-time bake approach via
`NEMOCLAW_MESSAGING_CHANNELS_B64` that made this work (PR NVIDIA#1501)
- @mercl-lau — found the stale `telegram-bridge` spawn in `services.ts`
that silently crashed after the bridge script was removed
- @stevenrick — tested Telegram on Brev, independently confirmed the
Landlock issue, and found that the auto-pair watcher rejected CLI
clients (also opened NVIDIA#1496)

## Type of Change

- [x] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing

- [x] `npx prek run --all-files` passes (or equivalently `make check`).
- [x] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)
- [x] E2E validated with real bot tokens on Brev instance

## Checklist

### General

- [x] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes

- [x] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [x] Tests added or updated for new or changed behavior.
- [x] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes

N/A

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: sayalinvidia <sayalinvidia@users.noreply.github.com>
gemini2026 pushed a commit to gemini2026/NemoClaw that referenced this pull request Apr 14, 2026
…IA#1081)

## Summary

Use the OpenShell provider system for messaging credential injection
instead of raw env var passthrough. Discord, Slack, and Telegram tokens
now flow through the placeholder/proxy pipeline — sandbox processes
never see real values. The host-side Telegram bridge is removed;
messaging channels are baked into `openclaw.json` at image build time
via `NEMOCLAW_MESSAGING_CHANNELS_B64`, and the L7 proxy rewrites
placeholders with real secrets at egress — no runtime config patching
needed.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

## Related Issues

Fixes NVIDIA#1109
Fixes NVIDIA#616
Fixes NVIDIA#1310
Supersedes NVIDIA#617

## Changes

- **`bin/lib/onboard.js`** — Create `generic` providers for Discord,
Slack, and Telegram tokens via `upsertProvider()`. Attach to sandbox via
`--provider` flags. Replace individual env var deletes with a
comprehensive blocklist. Bake messaging channel config into
`openclaw.json` at build time. Collect Telegram user ID for DM
allowlisting.
- **`Dockerfile`** — Accept `NEMOCLAW_MESSAGING_CHANNELS_B64` build arg
and inject channel config into `openclaw.json` at image build time.
- **`scripts/nemoclaw-start.sh`** — Remove dead runtime `openclaw.json`
patching from `configure_messaging_channels`. Allow CLI clients in
auto-pair watcher.
- **`nemoclaw/src/lib/services.ts`** — Remove stale `telegram-bridge`
spawn.
- **`scripts/telegram-bridge.js`** — Removed (replaced by native
OpenClaw channels via providers).
- **`test/onboard.test.js`** — Verify provider create commands,
`--provider` flags on sandbox create, and that real token values never
appear in the sandbox create command.
- **`test/credential-exposure.test.js`** — Updated for expanded
blocklist coverage.
- **`test/e2e/messaging-providers.test.sh`** — New E2E test: provider
creation, sandbox attachment, DM allowlisting.

## Thanks

- @sayalinvidia — tested Discord end-to-end, diagnosed that Landlock
makes `openclaw.json` immutable at runtime in non-root mode, and
proposed the build-time bake approach via
`NEMOCLAW_MESSAGING_CHANNELS_B64` that made this work (PR NVIDIA#1501)
- @mercl-lau — found the stale `telegram-bridge` spawn in `services.ts`
that silently crashed after the bridge script was removed
- @stevenrick — tested Telegram on Brev, independently confirmed the
Landlock issue, and found that the auto-pair watcher rejected CLI
clients (also opened NVIDIA#1496)

## Type of Change

- [x] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing

- [x] `npx prek run --all-files` passes (or equivalently `make check`).
- [x] `npm test` passes.
- [ ] `make docs` builds without warnings. (for doc-only changes)
- [x] E2E validated with real bot tokens on Brev instance

## Checklist

### General

- [x] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes)

### Code Changes

- [x] Formatters applied — `npx prek run --all-files` auto-fixes
formatting (or `make format` for targeted runs).
- [x] Tests added or updated for new or changed behavior.
- [x] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes (new
commands, changed defaults, new features, bug fixes that contradict
existing docs).

### Doc Changes

N/A

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: sayalinvidia <sayalinvidia@users.noreply.github.com>
@stevenrick stevenrick deleted the fix/auto-pair-cli-clients branch May 13, 2026 06:20
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[All Platforms] after onboarded, openclaw tui shows "Pairing required. Run openclaw devices list, approve your request ID, then reconnect."

3 participants