Skip to content

fix(onboard): bake messaging channels into openclaw.json at build time#1501

Closed
sayalinvidia wants to merge 1 commit intoNVIDIA:feat/messaging-credential-providersfrom
sayalinvidia:test/discord-channel-fix
Closed

fix(onboard): bake messaging channels into openclaw.json at build time#1501
sayalinvidia wants to merge 1 commit intoNVIDIA:feat/messaging-credential-providersfrom
sayalinvidia:test/discord-channel-fix

Conversation

@sayalinvidia
Copy link
Copy Markdown
Contributor

@sayalinvidia sayalinvidia commented Apr 5, 2026

In non-root mode (OpenShell no-new-privileges), the entrypoint cannot patch the immutable openclaw.json to add messaging channel config. This caused "Channel is required (no configured channels detected)" when the agent tried to send Discord messages.

Bake channel entries with placeholder tokens into openclaw.json at image build time via NEMOCLAW_MESSAGING_CHANNELS_B64. The L7 proxy rewrites placeholders with real secrets at egress, so no runtime config patching is needed.

Summary

Related Issue

Changes

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

  • 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).

Doc Changes

  • Follows the style guide. Try running the update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Signed-off-by: Sayali Kandarkar [email protected]

Issue earlier:

image

Able to interact with the Discord channel via the discord bot post the fix:

image

In non-root mode (OpenShell no-new-privileges), the entrypoint cannot
patch the immutable openclaw.json to add messaging channel config.
This caused "Channel is required (no configured channels detected)"
when the agent tried to send Discord messages.

Bake channel entries with placeholder tokens into openclaw.json at
image build time via NEMOCLAW_MESSAGING_CHANNELS_B64. The L7 proxy
rewrites placeholders with real secrets at egress, so no runtime
config patching is needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d43ead65-db26-4d08-996f-246525017bff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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 <[email protected]>

## 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 <[email protected]>
Co-authored-by: Carlos Villela <[email protected]>
Co-authored-by: sayalinvidia <[email protected]>
@wscurran wscurran added OpenShell Support for OpenShell, a safe, private runtime for autonomous AI agents Integration: Discord Use this label to identify Discord bot integration issues with NemoClaw. fix labels Apr 6, 2026
@wscurran
Copy link
Copy Markdown
Contributor

wscurran commented Apr 6, 2026

✨ Thanks for submitting this fix, which proposes a way to bake messaging channel placeholders into openclaw.json at build time to avoid runtime patching failures in non-root mode.

@ericksoa
Copy link
Copy Markdown
Contributor

ericksoa commented Apr 6, 2026

This fix is already on main — PR #1081 landed the build-time channel baking via NEMOCLAW_MESSAGING_CHANNELS_B64, which addresses the non-root openclaw.json patching issue. Closing for now; please reopen if the problem persists on the latest main.

@ericksoa ericksoa closed this Apr 6, 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 <[email protected]>

## 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 <[email protected]>
Co-authored-by: Carlos Villela <[email protected]>
Co-authored-by: sayalinvidia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Integration: Discord Use this label to identify Discord bot integration issues with NemoClaw. OpenShell Support for OpenShell, a safe, private runtime for autonomous AI agents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants