Skip to content

Add a Slack notification channel adapter #2

@jstuart0

Description

@jstuart0

Goal

Ship HITL (human-in-the-loop) requests to a Slack channel or DM the same way we ship them to Telegram today. Inline approve/decline buttons via Slack Block Kit.

Background

Notification channels are abstracted behind NotificationChannelAdapter (src/server/services/channels/types.ts). Telegram is the only implementation today. Each channel has:

  • An adapter (send, isConfigured, optional webhook handler)
  • Credential storage in notification_channels.credential_ciphertext (encrypted per-channel)
  • A UI panel in Settings that enrolls + tests the channel

Where to start

  • Read src/server/services/channels/telegram.ts and telegram-credentials.ts as your reference.
  • Create src/server/services/channels/slack.ts with:
    • slackAdapter implementing NotificationChannelAdapter — formats the HITL proposal into Slack Block Kit with Approve / Decline buttons
    • Uses Slack's Incoming Webhooks for sending, or the Web API if a bot token is configured
  • Webhook handler for interactive components (button presses) — POST to /api/v1/channels/slack/webhook with Slack signing-secret verification.
  • Register "slack" in NotificationChannelKind (src/server/services/channels/types.ts) and the adapter registry (registry.ts).
  • UI: build src/web/components/settings/SlackChannelPanel.tsx modeled on TelegramChannelPanel.tsx.

Acceptance criteria

  • Admin can paste a Slack Incoming Webhook URL or Bot Token in Settings and "Test send" works.
  • A HITL proposal delivered to Slack shows Approve / Decline buttons that resolve the proposal when tapped (same behavior as Telegram).
  • Signing secret verification on the interactive-components webhook (don't trust Slack's body without it).
  • Unit tests for signature verification + block kit formatting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    channelNotification channels (Telegram, Slack, webhook, etc.)enhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions