Skip to content

feat(channels): Slack bot + Telegram allowlist & group @-mention gating#81

Merged
1bcMax merged 3 commits into
feat/webui-serverfrom
feat/slack-telegram-channels
Jun 7, 2026
Merged

feat(channels): Slack bot + Telegram allowlist & group @-mention gating#81
1bcMax merged 3 commits into
feat/webui-serverfrom
feat/slack-telegram-channels

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Collaborator

What

  • Slack: restore the slack command + channel (was uncommitted WIP, nearly lost) and register it in the CLI.
  • Telegram: add TELEGRAM_ALLOWED_USERS allowlist (owner always allowed); in groups only act on @mention or reply-to-bot (mention stripped before the prompt), ignore other group chatter; private chats unchanged.

Notes

  • Stacked on feat/webui-server (so the diff is just the channels commit). After that merges, this retargets to main.

…ion gating

- Slack: restore the `slack` command + channel (was uncommitted WIP) and register it in the CLI
- Telegram: add TELEGRAM_ALLOWED_USERS allowlist (owner always allowed); in groups only
  act on @mention or reply-to-bot (mention stripped before the prompt) and ignore other
  group chatter; private chats unchanged
@VickyXAI

VickyXAI commented Jun 7, 2026

Copy link
Copy Markdown

Code review

Found 3 issues:

  1. franklin slack crashes at runtime for every npm-installed user: src/channel/slack.ts does await import('@slack/bolt'), but @slack/bolt is not declared in package.json (this PR doesn't touch it). Dynamic import means the build passes, then the command dies with Cannot find package '@slack/bolt' on first run. Add it to dependencies (or catch the import failure with an actionable "npm install @slack/bolt" message if it's meant to be optional).

// Lazy import keeps @slack/bolt out of the load path for users who never
// run the Slack bot, matching how heavy optional deps are handled elsewhere.
const { App, LogLevel } = await import('@slack/bolt');

  1. The Slack capability_start handler posts a separate ⏳ ${event.name}… message for every tool call — the exact flooding pattern commit 7e527e8 ("one 'Working…' ping per turn instead of one per tool call — a multi-tool run otherwise floods the chat") removed from Telegram, and which this same PR upgrades further on the Telegram side to a single per-turn toolsUsed summary. A 10-tool agent turn posts 10 spinner messages into the thread. Apply the same accumulate-and-summarize pattern here.

break;
case 'capability_start':
if (state.currentTarget) {
if (state.responseBuffer.trim()) {
const target = state.currentTarget;
const text = state.responseBuffer.trim();
state.responseBuffer = '';
void postMessage(target, text);
}
void postMessage(state.currentTarget, `⏳ ${event.name}…`);
}
break;

  1. Two Chinese user-facing strings in src/channel/telegram.ts — the /tools toggle reply and the per-turn tool summary (repo rule: src/ is English-only; every other user-facing string in this file is English). Suggested: Tool summary: on/off and Used N tools: ….

savePrefs({ showTools: state.showTools });
await sendMessage(chatId, `🔧 工具调用汇总:${state.showTools ? '开启 ✅' : '关闭'}`);
return true;

const uniq = [...new Set(state.toolsUsed)];
void sendMessage(chatId, `🔧 用了 ${state.toolsUsed.length} 个工具:${uniq.join(' · ')}`);
}

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@1bcMax 1bcMax merged commit 77b76ef into feat/webui-server Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants