feat(messaging): adding default value during onboarding and TELEGRAM_GROUP_POLICY for OpenClaw - #5535
Conversation
…GROUP_POLICY for OpenClaw Signed-off-by: San Dang <sdang@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds ChangesTELEGRAM_GROUP_POLICY feature
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}}
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-5535.docs.buildwithfern.com/nemoclaw |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review AdvisorFindings: 0 needs attention, 0 worth checking, 1 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
…ding-defaults-openclaw-groups
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/lib/messaging/channels/telegram/template-resolver.test.ts (1)
10-40: ⚡ Quick winAdd a fallback-case assertion for
groupPolicydefaulting.This suite covers valid policies, but it doesn’t assert the new fallback path when
telegramConfig.groupPolicyis 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
📒 Files selected for processing (25)
docs/_components/StarterPromptButton.tsxdocs/manage-sandboxes/messaging-channels.mdxdocs/reference/architecture.mdxdocs/reference/commands-nemohermes.mdxdocs/reference/commands.mdxsrc/lib/messaging-channel-config.test.tssrc/lib/messaging-channel-config.tssrc/lib/messaging/applier/setup-applier.test.tssrc/lib/messaging/channels/discord/manifest.tssrc/lib/messaging/channels/manifests.test.tssrc/lib/messaging/channels/metadata.test.tssrc/lib/messaging/channels/telegram/manifest.tssrc/lib/messaging/channels/telegram/template-resolver.test.tssrc/lib/messaging/channels/telegram/template-resolver.tssrc/lib/messaging/compiler/manifest-compiler.test.tssrc/lib/messaging/compiler/manifest-compiler.tssrc/lib/messaging/hooks/common/config-prompt.test.tssrc/lib/messaging/hooks/common/config-prompt.tssrc/lib/messaging/manifest/types.test.tssrc/lib/messaging/manifest/types.tssrc/lib/messaging/plan-validation.test.tssrc/lib/onboard/messaging-channel-setup.test.tstest/generate-hermes-config.test.tstest/generate-openclaw-config.test.tstest/messaging-plan-test-helper.ts
Signed-off-by: San Dang <sdang@nvidia.com>
Selective E2E Results — ✅ All requested jobs passedRun: 27689739918
|
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_POLICYwithopenas the default and documents that Hermes does not expose an equivalent group-disable policy.Telegram group policy [open/allowlist/disabled; default: open]: disabled
Changes
defaultValuesupport to channel config input manifests, prompt rendering, compiler resolution, and persisted config validation.open,allowlist, anddisabled, with resolver behavior for wildcard group access.TELEGRAM_GROUP_POLICY.Type of Change
Verification
Push used
--no-verifyper maintainer request after commit hooks passed.npx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: San Dang sdang@nvidia.com
Summary by CodeRabbit
Release Notes
New Features
TELEGRAM_GROUP_POLICYto control Telegram group access for OpenClaw (open,allowlist,disabled).Documentation
TELEGRAM_GROUP_POLICYbehavior, OpenClaw vs Hermes differences, and clearer mention-mode defaults.Improvements
Tests