Skip to content

feat(messaging): adding default value during onboarding and TELEGRAM_GROUP_POLICY for OpenClaw - #5535

Merged
cv merged 3 commits into
mainfrom
feat/messaging-onboarding-defaults-openclaw-groups
Jun 17, 2026
Merged

feat(messaging): adding default value during onboarding and TELEGRAM_GROUP_POLICY for OpenClaw#5535
cv merged 3 commits into
mainfrom
feat/messaging-onboarding-defaults-openclaw-groups

Conversation

@sandl99

@sandl99 sandl99 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds manifest-level default values for messaging config inputs so onboarding and non-interactive setup can fall back to declared defaults. Also adds OpenClaw-only TELEGRAM_GROUP_POLICY with open as the default and documents that Hermes does not expose an equivalent group-disable policy.

Telegram group policy [open/allowlist/disabled; default: open]: disabled

  Telegram Bot Token: **********************************************
  ✓ telegram token saved
  For Telegram group chats, disable privacy mode in @BotFather (/setprivacy -> your bot -> Disable).
  After changing privacy mode, remove and re-add the bot to each group before testing @mentions.
  Controls Telegram group-chat behavior only — reply only when @mentioned vs. to all group messages. Direct messages are unaffected by this setting and remain subject to pairing and TELEGRAM_ALLOWED_IDS.
  Reply only when @mentioned? [Y/n]: 
  ✓ telegram reply mode saved: @mentions only
  Send /start to @userinfobot on Telegram to get your numeric user ID.
  Telegram User ID (for DM access): 7895072570
  ✓ telegram allowed IDs saved
  Controls OpenClaw Telegram group access. Hermes does not expose an equivalent disable-groups policy.
  **Telegram group policy [open/allowlist/disabled; default: open]: disabled**
  ✓ telegram Telegram group policy saved

Changes

  • Added defaultValue support to channel config input manifests, prompt rendering, compiler resolution, and persisted config validation.
  • Defaulted existing mention-mode config for Telegram and Discord to preserve current behavior when input or env vars are empty.
  • Added OpenClaw-only Telegram group policy values open, allowlist, and disabled, with resolver behavior for wildcard group access.
  • Scoped the Telegram group policy onboarding prompt to OpenClaw so Hermes skips TELEGRAM_GROUP_POLICY.
  • Updated messaging docs and tests for default handling, Telegram group policy, and Hermes/OpenClaw differences.

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

Push used --no-verify per maintainer request after commit hooks passed.

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added TELEGRAM_GROUP_POLICY to control Telegram group access for OpenClaw (open, allowlist, disabled).
  • Documentation

    • Expanded Telegram/Discord messaging-channel onboarding docs and reference pages with TELEGRAM_GROUP_POLICY behavior, OpenClaw vs Hermes differences, and clearer mention-mode defaults.
  • Improvements

    • Updated onboarding prompting so Telegram group policy is collected for OpenClaw only.
    • Strengthened validation and defaulting for messaging-channel configuration values, including mention-mode handling and persisted config rules.
  • Tests

    • Improved coverage for the new Telegram group policy behavior and defaults.

…GROUP_POLICY for OpenClaw

Signed-off-by: San Dang <sdang@nvidia.com>
@sandl99 sandl99 self-assigned this Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 10217515-7eb1-4b90-ba61-1d11841fb8f4

📥 Commits

Reviewing files that changed from the base of the PR and between ab2cdcf and 3a31b68.

📒 Files selected for processing (1)
  • docs/_components/StarterPromptButton.tsx
✅ Files skipped from review due to trivial changes (1)
  • docs/_components/StarterPromptButton.tsx

📝 Walkthrough

Walkthrough

Adds TELEGRAM_GROUP_POLICY (open/allowlist/disabled) as a new optional Telegram config input for OpenClaw. Wires it through the manifest, template resolver, config validation (validValuesByKey mechanism), manifest compiler defaultValue application, and config-prompt hook non-interactive defaulting. Adds a telegram-openclaw-config-prompt enrollment hook limited to the openclaw agent, updates tests throughout, and extends documentation.

Changes

TELEGRAM_GROUP_POLICY feature

Layer / File(s) Summary
Type contracts: ChannelConfigInputSpec.defaultValue and ConfigPromptField extensions
src/lib/messaging/manifest/types.ts, src/lib/messaging/manifest/types.test.ts, src/lib/messaging/hooks/common/config-prompt.ts, src/lib/messaging/channels/discord/manifest.ts, src/lib/messaging/channels/telegram/manifest.ts, src/lib/messaging/channels/manifests.test.ts
ChannelConfigInputSpec gains defaultValue?: string; ConfigPromptField gains defaultValue, placeholder, format, and formatHint; Discord and Telegram requireMention prompts set defaultValue: "1".
Config validation: validValuesByKey replaces requireMentionKeys
src/lib/messaging-channel-config.ts, src/lib/messaging-channel-config.test.ts, src/lib/messaging/channels/metadata.test.ts
Replaces the requireMentionKeys/hasBooleanStringValues mechanism with a validValuesByKey map derived from manifest config inputs' envKeyvalidValues, so normalizeMessagingChannelConfigValue validates against manifest-defined allowed sets for all keys including TELEGRAM_GROUP_POLICY.
Telegram manifest: groupPolicy input, OpenClaw rendering, state, and enrollment hook
src/lib/messaging/channels/telegram/manifest.ts, src/lib/messaging/channels/manifests.test.ts
telegramManifest adds a groupPolicy config input (TELEGRAM_GROUP_POLICY, open|allowlist|disabled, default open), injects it into OpenClaw account rendering, drives channels.telegram.groups from telegramConfig.openclawGroups, persists and hydrates groupPolicy, and adds a telegram-openclaw-config-prompt hook for the openclaw agent.
Telegram template resolver: groupPolicy and openclawGroups
src/lib/messaging/channels/telegram/template-resolver.ts, src/lib/messaging/channels/telegram/template-resolver.test.ts
resolveTelegramTemplateReference is extended to resolve telegramConfig.groupPolicy (with DEFAULT_TELEGRAM_GROUP_POLICY validation) and telegramConfig.openclawGroups (conditionally built from requireMention state). New test file covers all three policy values.
ManifestCompiler: conditional defaultValue application
src/lib/messaging/compiler/manifest-compiler.ts, src/lib/messaging/compiler/manifest-compiler.test.ts
Precomputes initialInputValues, passes applyDefaults into resolveChannelInput, applies manifest defaultValue for config inputs when not in interactive enrollment and no existing value is present, adds hasInputValue for promptWhenInput gating, and refactors readInputEnvValue through a shared normalizeInputValue helper. New tests cover non-interactive defaulting, interactive hook deferral, and gated default suppression.
config-prompt hook: non-interactive defaulting, blank-input fallback, format validation
src/lib/messaging/hooks/common/config-prompt.ts, src/lib/messaging/hooks/common/config-prompt.test.ts
createConfigPromptHook applies field.defaultValue when isInteractive is false via a new logDefaultConfigInput helper; mention-mode prompting derives [y/N]/[Y/n] from the default and treats blank as default; general prompting falls back to readDefaultConfigValue on blank input; normalizeConfigValue enforces field.format RegExp. New tests cover group-policy prompting, blank-input defaults, non-interactive defaulting, and multi-choice question formatting.
Integration and end-to-end tests
src/lib/messaging/plan-validation.test.ts, src/lib/onboard/messaging-channel-setup.test.ts, src/lib/messaging/applier/setup-applier.test.ts, test/generate-openclaw-config.test.ts, test/generate-hermes-config.test.ts, test/messaging-plan-test-helper.ts
Plan validation, onboarding, and config generation tests updated: Telegram plan fixtures include groupPolicy, onboarding asserts the new prompt appears for OpenClaw but is skipped for Hermes, OpenClaw groups rendering assertion updated, Hermes requireMention normalization assertion updated, legacyMessagingConfigEnv propagates TELEGRAM_GROUP_POLICY.
Documentation
docs/_components/StarterPromptButton.tsx, docs/manage-sandboxes/messaging-channels.mdx, docs/reference/architecture.mdx, docs/reference/commands.mdx, docs/reference/commands-nemohermes.mdx
All docs updated to document TELEGRAM_GROUP_POLICY, OpenClaw vs Hermes behavior differences, allowlist/disabled semantics, Telegram/Discord mention-mode defaults, and non-interactive override patterns.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant setupSelectedMessagingChannels
    participant ManifestCompiler
    participant createConfigPromptHook as telegram-openclaw-config-prompt
    participant telegramManifest
    participant resolveTelegramTemplateReference

    User->>setupSelectedMessagingChannels: onboard Telegram (OpenClaw)
    setupSelectedMessagingChannels->>ManifestCompiler: compile plan (runEnrollment=true, isInteractive=true)
    ManifestCompiler->>telegramManifest: resolve inputs (requireMention, groupPolicy)
    ManifestCompiler-->>setupSelectedMessagingChannels: plan with telegram-openclaw-config-prompt hook
    setupSelectedMessagingChannels->>createConfigPromptHook: execute hook (prompt groupPolicy)
    createConfigPromptHook-->>setupSelectedMessagingChannels: groupPolicy=open, TELEGRAM_GROUP_POLICY=open
    setupSelectedMessagingChannels->>resolveTelegramTemplateReference: resolve telegramConfig.groupPolicy, telegramConfig.openclawGroups
    resolveTelegramTemplateReference-->>setupSelectedMessagingChannels: groupPolicy="open", openclawGroups={*:{requireMention:true}}
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5338: Shares messaging configuration validation logic modifications; this PR extends validValuesByKey validation to support the new TELEGRAM_GROUP_POLICY key alongside other manifest-defined config inputs.

Suggested reviewers

  • cv

Poem

🐰 A policy for groups, now open or closed,
The Telegram bots know just where they're hosted!
allowlist guards, disabled shuts the door,
Defaults to open — what could you want more?
With manifests wired and compilers aligned,
The rabbit hops on with new configs designed! 🎉

🚥 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 title clearly describes the main changes: adding default value support during onboarding and introducing TELEGRAM_GROUP_POLICY for OpenClaw.
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/messaging-onboarding-defaults-openclaw-groups

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

@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the feat/messaging-onboa... 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 feat/messaging-onboa... 3a31b68 +/-
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 feat/messaging-onboa... branch is 46%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main feat/messaging-onboa... 3a31b68 +/-
src/lib/state/o...oard-session.ts 90%
src/lib/inference/local.ts 76%
src/lib/sandbox/config.ts 72%
src/lib/actions...dbox/rebuild.ts 67%
src/lib/onboard/preflight.ts 64%
src/lib/actions...licy-channel.ts 56%
src/lib/state/sandbox.ts 55%
src/lib/policy/index.ts 49%
src/lib/onboard...er-gpu-patch.ts 44%
src/lib/onboard.ts 18%

Updated June 17, 2026 12:23 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: messaging-providers-vitest, channels-add-remove-vitest
Optional E2E: hermes-discord-e2e

Dispatch hint: messaging-providers-vitest,channels-add-remove-vitest

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • messaging-providers-vitest (high; live Docker/OpenShell sandbox with fake messaging tokens): Required because this PR changes Telegram/Discord manifests, manifest compilation, template resolution, and OpenClaw config rendering. This job exercises provider creation, credential isolation, generated OpenClaw channel config, network reachability, and OpenShell L7 rewrite behavior for messaging providers.
  • channels-add-remove-vitest (high; live Docker/OpenShell sandbox lifecycle and rebuild coverage): Required because channel config persistence, non-interactive defaults, prompt/config plumbing, and onboarding setup can affect host-side channels add, rebuild, policy application, credential reuse, and removal lifecycle.

Optional E2E

  • hermes-discord-e2e (high; live Hermes sandbox with hosted inference and fake Discord token): Optional additional confidence for the Hermes-specific Discord render and credential-placeholder boundary because this PR changes the Discord manifest defaulting path. Existing coverage appears to pass an explicit DISCORD_REQUIRE_MENTION value, so it is useful but not a complete guard for the new unset-default behavior.

New E2E recommendations

  • Telegram group policy defaults (high): Existing messaging E2E covers provider wiring and channel lifecycle, but the PR introduces TELEGRAM_GROUP_POLICY and changes the default Telegram group mention behavior. Add live coverage that omits TELEGRAM_REQUIRE_MENTION, sets TELEGRAM_GROUP_POLICY=open/allowlist/disabled, rebuilds, and asserts the generated OpenClaw config contains the expected groupPolicy and group requireMention defaults without leaking tokens.
    • Suggested test: Add a Telegram group-policy/defaults case to the existing messaging providers or channels add/remove live scenario.
  • Discord unset mention default (medium): The Hermes Discord E2E uses DISCORD_REQUIRE_MENTION=0, so it does not prove that an unset DISCORD_REQUIRE_MENTION with DISCORD_SERVER_ID records the default mention-only mode. Add a live or scenario E2E assertion for non-interactive Discord setup with the server ID set and the mention variable unset.
    • Suggested test: Add a Discord default mention-mode case for OpenClaw and Hermes channel rendering.

Dispatch hint

  • Workflow: .github/workflows/e2e-vitest-scenarios.yaml
  • jobs input: messaging-providers-vitest,channels-add-remove-vitest

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: messaging-providers-vitest, channels-add-remove-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=messaging-providers-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-add-remove-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • messaging-providers-vitest: Messaging manifest/config changes alter Telegram group policy, mention-mode defaults, Discord defaults, and OpenClaw/Hermes channel rendering. The messaging providers Vitest job exercises Telegram/Discord/Slack/WeChat/WhatsApp provider placeholders, policy, rendered OpenClaw config, and runtime channel contracts.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=messaging-providers-vitest
  • channels-add-remove-vitest: The PR changes persisted messaging-channel config and Telegram defaults used by host-side channel mutation. The channels add/remove Vitest job exercises adding Telegram after onboarding, registry messaging.plan persistence, rebuild rendering, provider/policy state, and cleanup.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=channels-add-remove-vitest

Optional Vitest E2E scenarios

  • messaging-compatible-endpoint-vitest: Adjacent Telegram-enabled onboarding coverage through the compatible-endpoint path; useful if reviewers want an extra check that Telegram channel config still coexists with custom provider routing and inference.local.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=messaging-compatible-endpoint-vitest

Relevant changed files

  • src/lib/messaging-channel-config.ts
  • src/lib/messaging/applier/setup-applier.test.ts
  • src/lib/messaging/channels/discord/manifest.ts
  • src/lib/messaging/channels/telegram/manifest.ts
  • src/lib/messaging/channels/telegram/template-resolver.ts
  • src/lib/messaging/compiler/manifest-compiler.ts
  • src/lib/messaging/hooks/common/config-prompt.ts
  • src/lib/messaging/manifest/types.ts

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 0 worth checking, 1 nice ideas
Since last review: 0 prior items resolved, 1 still applies, 0 new items found

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • None.

🌱 Nice ideas

  • Cover final OpenClaw config output for restrictive Telegram group policies (test/generate-openclaw-config.test.ts:506): The resolver and plan-level tests cover `TELEGRAM_GROUP_POLICY=allowlist` and `disabled`, but the final generated OpenClaw config tests still only assert default/open behavior and require-mention variants. Because this value controls the user-consumed `openclaw.json` group-access shape, a final generated-config assertion would guard against regressions where a restrictive policy still leaves the wildcard group stanza in place.
    • Recommendation: Add generated-config cases that set `TELEGRAM_GROUP_POLICY=allowlist` and `TELEGRAM_GROUP_POLICY=disabled`, then assert `channels.telegram.accounts.default.groupPolicy` matches the requested value and `channels.telegram.groups` does not contain the wildcard `*` stanza.
    • Evidence: `src/lib/messaging/channels/telegram/template-resolver.test.ts` covers resolver output for `open|allowlist|disabled`; `test/generate-openclaw-config.test.ts` covers default/open Telegram group behavior but has no `TELEGRAM_GROUP_POLICY` cases.
Consider writing more tests for
  • **Runtime validation** — generate-openclaw-config emits `channels.telegram.accounts.default.groupPolicy=allowlist` and omits `channels.telegram.groups["*"]` when `TELEGRAM_GROUP_POLICY=allowlist`. The PR has broad unit coverage for manifest defaults, prompt behavior, validation, plan hydration, and template resolution, but the behavior is consumed by generated sandbox agent configuration. Final generated-config assertions would better cover the runtime-facing `openclaw.json` shape.
  • **Runtime validation** — generate-openclaw-config emits `channels.telegram.accounts.default.groupPolicy=disabled` and omits `channels.telegram.groups["*"]` when `TELEGRAM_GROUP_POLICY=disabled`. The PR has broad unit coverage for manifest defaults, prompt behavior, validation, plan hydration, and template resolution, but the behavior is consumed by generated sandbox agent configuration. Final generated-config assertions would better cover the runtime-facing `openclaw.json` shape.
  • **Runtime validation** — Hermes generated config ignores `TELEGRAM_GROUP_POLICY` and does not render OpenClaw Telegram group-policy/group stanzas. The PR has broad unit coverage for manifest defaults, prompt behavior, validation, plan hydration, and template resolution, but the behavior is consumed by generated sandbox agent configuration. Final generated-config assertions would better cover the runtime-facing `openclaw.json` shape.
  • **Runtime validation** — channels add telegram persists `TELEGRAM_GROUP_POLICY` through the compact messaging plan and rebuild hydration. The PR has broad unit coverage for manifest defaults, prompt behavior, validation, plan hydration, and template resolution, but the behavior is consumed by generated sandbox agent configuration. Final generated-config assertions would better cover the runtime-facing `openclaw.json` shape.
  • **Cover final OpenClaw config output for restrictive Telegram group policies** — Add generated-config cases that set `TELEGRAM_GROUP_POLICY=allowlist` and `TELEGRAM_GROUP_POLICY=disabled`, then assert `channels.telegram.accounts.default.groupPolicy` matches the requested value and `channels.telegram.groups` does not contain the wildcard `*` stanza.
Since last review details

Current findings:

  • Cover final OpenClaw config output for restrictive Telegram group policies (test/generate-openclaw-config.test.ts:506): The resolver and plan-level tests cover `TELEGRAM_GROUP_POLICY=allowlist` and `disabled`, but the final generated OpenClaw config tests still only assert default/open behavior and require-mention variants. Because this value controls the user-consumed `openclaw.json` group-access shape, a final generated-config assertion would guard against regressions where a restrictive policy still leaves the wildcard group stanza in place.
    • Recommendation: Add generated-config cases that set `TELEGRAM_GROUP_POLICY=allowlist` and `TELEGRAM_GROUP_POLICY=disabled`, then assert `channels.telegram.accounts.default.groupPolicy` matches the requested value and `channels.telegram.groups` does not contain the wildcard `*` stanza.
    • Evidence: `src/lib/messaging/channels/telegram/template-resolver.test.ts` covers resolver output for `open|allowlist|disabled`; `test/generate-openclaw-config.test.ts` covers default/open Telegram group behavior but has no `TELEGRAM_GROUP_POLICY` cases.

Workflow run details

This is an automated advisory review. 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lib/messaging/channels/telegram/template-resolver.test.ts (1)

10-40: ⚡ Quick win

Add a fallback-case assertion for groupPolicy defaulting.

This suite covers valid policies, but it doesn’t assert the new fallback path when telegramConfig.groupPolicy is missing/invalid and should resolve to "open". A small case here would lock in that behavior.

Suggested test addition.
 describe("Telegram template resolver", () => {
+  it("defaults groupPolicy to open when value is missing", () => {
+    const inputs: SandboxMessagingInputReference[] = [
+      {
+        channelId: "telegram",
+        inputId: "requireMention",
+        kind: "config",
+        required: false,
+        statePath: "telegramConfig.requireMention",
+        value: "1",
+      },
+    ];
+
+    expect(resolveTelegramTemplateReference("telegramConfig.groupPolicy", { inputs })?.value).toBe(
+      "open",
+    );
+    expect(
+      resolveTelegramTemplateReference("telegramConfig.openclawGroups", { inputs })?.value,
+    ).toEqual({ "*": { requireMention: true } });
+  });
+
   it.each([
🤖 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/channels/telegram/template-resolver.test.ts` around lines
10 - 40, The test suite for resolveTelegramTemplateReference using it.each is
missing a test case that verifies the fallback behavior when
telegramConfig.groupPolicy is missing or invalid and should default to "open".
Add a new test case to the it.each array that passes undefined (or an invalid
value) for the groupPolicy parameter and expects the same openclawGroups result
as the "open" case, to ensure the fallback path is properly covered and locked
in.
🤖 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 `@docs/_components/StarterPromptButton.tsx`:
- Line 125: In the StarterPromptButton.tsx file, the Telegram configuration row
in the starter table currently presents TELEGRAM_GROUP_POLICY as a universally
applicable optional parameter alongside TELEGRAM_BOT_TOKEN,
TELEGRAM_ALLOWED_IDS, and TELEGRAM_REQUIRE_MENTION. Update this line to clarify
that TELEGRAM_GROUP_POLICY is specific to OpenClaw only, not applicable to
Hermes setup, by adding an appropriate label or note to distinguish it from the
other parameters that are universally supported.

In `@test/generate-openclaw-config.test.ts`:
- Around line 506-513: The test file has exceeded the enforced size budget of
1984 lines and is currently at 1989 lines. To fix this, locate duplicated
Telegram test setup code near the new test "defaults Telegram group replies to
require mentions when telegramConfig is empty (`#3022`)" and consolidate or remove
the duplication to reduce the file size by at least 5 lines. Look for other
Telegram-related tests in the same file that may have similar test setup or
assertions that can be combined with existing tests or refactored to eliminate
redundancy.

---

Nitpick comments:
In `@src/lib/messaging/channels/telegram/template-resolver.test.ts`:
- Around line 10-40: The test suite for resolveTelegramTemplateReference using
it.each is missing a test case that verifies the fallback behavior when
telegramConfig.groupPolicy is missing or invalid and should default to "open".
Add a new test case to the it.each array that passes undefined (or an invalid
value) for the groupPolicy parameter and expects the same openclawGroups result
as the "open" case, to ensure the fallback path is properly covered and locked
in.
🪄 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: cce1ed13-8f62-4c1d-983f-b5dbdd5db603

📥 Commits

Reviewing files that changed from the base of the PR and between 01e5525 and 6d892a6.

📒 Files selected for processing (25)
  • docs/_components/StarterPromptButton.tsx
  • docs/manage-sandboxes/messaging-channels.mdx
  • docs/reference/architecture.mdx
  • docs/reference/commands-nemohermes.mdx
  • docs/reference/commands.mdx
  • src/lib/messaging-channel-config.test.ts
  • src/lib/messaging-channel-config.ts
  • src/lib/messaging/applier/setup-applier.test.ts
  • src/lib/messaging/channels/discord/manifest.ts
  • src/lib/messaging/channels/manifests.test.ts
  • src/lib/messaging/channels/metadata.test.ts
  • src/lib/messaging/channels/telegram/manifest.ts
  • src/lib/messaging/channels/telegram/template-resolver.test.ts
  • src/lib/messaging/channels/telegram/template-resolver.ts
  • src/lib/messaging/compiler/manifest-compiler.test.ts
  • src/lib/messaging/compiler/manifest-compiler.ts
  • src/lib/messaging/hooks/common/config-prompt.test.ts
  • src/lib/messaging/hooks/common/config-prompt.ts
  • src/lib/messaging/manifest/types.test.ts
  • src/lib/messaging/manifest/types.ts
  • src/lib/messaging/plan-validation.test.ts
  • src/lib/onboard/messaging-channel-setup.test.ts
  • test/generate-hermes-config.test.ts
  • test/generate-openclaw-config.test.ts
  • test/messaging-plan-test-helper.ts

Comment thread docs/_components/StarterPromptButton.tsx Outdated
Comment thread test/generate-openclaw-config.test.ts
@sandl99 sandl99 added area: messaging Messaging channels, bridges, manifests, or channel lifecycle enhancement New capability or improvement request feature PR adds or expands user-visible functionality v0.0.66 labels Jun 17, 2026
Signed-off-by: San Dang <sdang@nvidia.com>
@sandl99
sandl99 requested a review from cv June 17, 2026 12:23
@NVIDIA NVIDIA deleted a comment from github-actions Bot Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27689739918
Target ref: feat/messaging-onboarding-defaults-openclaw-groups
Requested jobs: messaging-providers-e2e,messaging-compatible-endpoint-e2e,channels-add-remove-e2e,rebuild-openclaw-e2e,rebuild-hermes-e2e,hermes-e2e,onboard-resume-e2e,onboard-repair-e2e,telegram-injection-e2e,double-onboard-e2e,onboard-negative-paths-e2e,channels-stop-start-openclaw-e2e,channels-stop-start-hermes-e2e,openclaw-discord-pairing-e2e
Summary: 14 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
channels-add-remove-e2e ✅ success
channels-stop-start-hermes-e2e ✅ success
channels-stop-start-openclaw-e2e ✅ success
double-onboard-e2e ✅ success
hermes-e2e ✅ success
messaging-compatible-endpoint-e2e ✅ success
messaging-providers-e2e ✅ success
onboard-negative-paths-e2e ✅ success
onboard-repair-e2e ✅ success
onboard-resume-e2e ✅ success
openclaw-discord-pairing-e2e ✅ success
rebuild-hermes-e2e ✅ success
rebuild-openclaw-e2e ✅ success
telegram-injection-e2e ✅ success

@cv
cv merged commit 06d840e into main Jun 17, 2026
188 checks passed
@cv
cv deleted the feat/messaging-onboarding-defaults-openclaw-groups branch June 17, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: messaging Messaging channels, bridges, manifests, or channel lifecycle enhancement New capability or improvement request feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants