[All Platforms][Messaging] channels add telegram turns a mistyped TELEGRAM_GROUP_POLICY into open
Description
nemoclaw <sandbox> channels add telegram doesn't validate TELEGRAM_GROUP_POLICY or TELEGRAM_REQUIRE_MENTION. An unrecognized value is replaced with the manifest default, so a typo of disabled ends up as groupPolicy: "open".
Onboard has rejected bad values here since #5696. That check, detectInvalidMessagingChannelConfigEnvValues() in src/lib/messaging-channel-config.ts, has one caller: src/lib/onboard/messaging-channel-setup.ts. The channels add path in src/lib/actions/sandbox/policy-channel.ts never calls it, and normalizeInputValue() in src/lib/messaging/compiler/manifest-compiler.ts swaps an out-of-range value for the default.
docs/manage-sandboxes/set-up-telegram.mdx says "Export the settings before onboarding or channels add telegram", so users will reasonably expect both paths to treat the values the same way.
Reproduction Steps
- In an isolated HOME, register an OpenClaw sandbox named
mysband put stubopenshellanddockerbinaries on PATH. - Run:
NEMOCLAW_NON_INTERACTIVE=1 TELEGRAM_BOT_TOKEN=123456:fake TELEGRAM_GROUP_POLICY=disabeld TELEGRAM_REQUIRE_MENTION=1 NEMOCLAW_SKIP_TELEGRAM_REACHABILITY=1 nemoclaw mysb channels add telegram - Run it again with
TELEGRAM_GROUP_POLICY=disabled.
I expected the first run to stop with Invalid TELEGRAM_GROUP_POLICY value 'disabeld' (expected one of: open, allowlist, disabled), which is what onboard prints.
Environment
- macOS 26.5.2 (arm64), Node.js v22.22.3
- NemoClaw
mainat4c44f7cc8; the files involved are unchanged ond61268122 - Real CLI (
node bin/nemoclaw.js) with stubbed OpenShell. With no live gateway, I checked what would be written by building the same plan throughMessagingWorkflowPlanner.buildChannelAddPlanFromSandboxEntry().
Debug Output
$ TELEGRAM_GROUP_POLICY=disabeld ... nemoclaw mysb channels add telegram
✓ telegram Telegram group policy defaulted: open
$ TELEGRAM_GROUP_POLICY=disabled ... nemoclaw mysb channels add telegram
✓ telegram — Telegram group policy already set: disabled
Plan built from the same environment:
disabeld -> plan value "open", rendered openclaw.json "groupPolicy":"open"
disabled -> plan value "disabled", rendered openclaw.json "groupPolicy":"disabled"
TELEGRAM_REQUIRE_MENTION=yes falls back the same way and prints ✓ telegram reply mode defaulted: @mentions only.
Logs
If you meant to turn group chats off and mistyped the value, the bot answers in any group, and the only hint is a green check mark saying the policy defaulted to open.
Running the same validation at the start of channels add, before planning or any sandbox change, would fix it. A CLI test with something like TELEGRAM_GROUP_POLICY=lockdown would keep it from coming back.
Checklist
- [x] I confirmed this bug is reproducible
- [x] I searched existing issues and this is not a duplicate