Add Discord as a communication provider#268
Conversation
|
No code issues found. See task
Reviewed 5717264 |
|
Addressed the remaining permission-resolution feedback in bdcbfae. The |
|
Addressed the remaining docs feedback in 4e4f7ec: removed the retired default-destination instructions, clarified the server permissions as task-entry requirements, and updated Gateway troubleshooting for the embedded BullMQ runtime. Also added linked-user DM delivery for the setup task, suggestions, and follow-up in a28f16e. Full |
|
Updated the Discord linking flow in bcf72d3: |
Adapts the Discord provider to refactors that landed on develop since the PR was opened: - PR terminal-status notifications now go through the collapsed notifyPullRequestTerminalStatus notifier (Discord delivery to be wired into it) instead of per-provider notifyDiscordPrMerge - PR review notifications go through getCommunicationProviderAdapter; registered a discord adapter backed by resolveDiscordRuntimeCredentials - MCP thread replies build the Discord provider via the new sdk helper createDiscordCommunicationProviderFromRuntimeCredentials - Setup flow rebased onto the new bootstrap/setup page structure - Dropped the PR's 0010 drizzle migration (develop also shipped an 0010); the Discord migration will be regenerated as 0011
- Register Discord in the automation destination waterfall (connected providers list, primary-conversation fallback via the default Discord destination, prompt surface label) and in the six automations that already support Teams/Telegram - Add discord/discord_channel to the background-automation provider and target-kind unions - Drop the Discord setup-completion notification: develop removed that pattern for all surfaces in #324 (env setup is non-blocking now) - Remove merge-duplicated CornerDownRight mock and stale import
Fans Discord targets out through the collapsed notifyPullRequestTerminalStatus notifier via the shared communication adapter, replacing the pre-merge notifyDiscordPrMerge path.
- Worker tasks launched from Discord now get the surface-generic post_to_channel tool (with a Discord channel-post path on the API MCP endpoint) instead of the Slack-labeled post tool - Show a typing indicator across Discord thread-reply delivery, mirroring the Telegram typing heartbeat - Add a default-channel picker to the Discord settings/setup status card so the proactive destination (automation suggestions, reports) is configurable from the UI; the backing endpoints already existed - Ship a mock-discord-testing skill plus a runnable harness: mock server control endpoints (/mock/state, /mock/events acting as the Gateway), run-mock-discord script with example scenario, and LLM-judged eval scenarios with an eval:discord-scenario runner
oxlint enforces @typescript-eslint/no-require-imports and no-explicit-any here while residual ESLint does not, so eslint-disable comments trip ESLint's unused-directive check. Use oxlint-disable comments, which ESLint ignores, so both linters pass.
- DM-delivered setup suggestion cards: the Start button launched only from guild threads and threw for DMs, releasing the claim and making every DM card unusable. DM cards now launch the task in the DM conversation itself, matching direct-message task entry. - Automation work-item launches: transient Discord failures (429/5xx/ network) while preparing the task thread reopen the work item under its claim instead of terminally failing it, so the retry resumes in the persisted thread. Permanent failures stay terminal. - Discord channel posts: a caller-provided threadTs redirected the post to any bot-accessible thread. Only the task's own stored thread (or its launch channel) is accepted; anything else is rejected with 403.
|
Addressed the three outstanding review findings in 2838738:
Focused suites (28 files / 223 tests across the Discord, MCP, and work-item handlers), typecheck, lint, and the full pre-push gate pass. |
…unication-provider
Develop's #375 expanded CI failure triage to Teams/Telegram manager destinations without updating the capability-badge test, which only runs on merge refs here. The triage runner is destination-generic, so declare Discord support too (matching the other multi-provider automations), teach the triage prompt the Discord surface label, and update the badge and registry test expectations.
A transient launch failure reopens the work item, but the reopened row also blocks re-insertion as an active fingerprint duplicate, so nothing ever launched it again. Scans now load fingerprint-duplicate rows that are still open (or stale-launching) with no linked task and include them in the launch set; the claim CAS keeps concurrent launchers safe.
|
Addressed the remaining stranded-work-item finding in ca5171e. Reopening on a transient failure wasn't enough on its own: the reopened row blocks re-insertion as an active fingerprint duplicate, so no later scan would launch it. |
Summary
/new,/link, and/help, add task controls, and keep guild traffic limited to mentions or bot-owned task threadsmock-discord-testingskill, and broad regression coverageUpdate (2026-07-15): rebased onto develop + Telegram feature parity
The branch was brought up to date with
develop(85 commits, including the communication-adapter refactors, the collapsed PR terminal-status notifier, oxfmt/oxlint, and drizzle migration 0010), and Discord was audited feature-by-feature against Telegram, the most complete chat surface, with every gap closed.Merge adaptations
getCommunicationProviderAdaptervia a newcreateDiscordCommunicationProviderFromRuntimeCredentialssdk helper; MCP thread replies, PR review notifications, and the collapsednotifyPullRequestTerminalStatusnotifier all reach Discord through it (replacing the pre-mergenotifyDiscordPrMergepath)listConnectedCommunicationProviders,resolveAutomationRuntimeDestination, prompt context) extended to Discord, and the six Teams/Telegram-capable background automations now also declare Discord support0011after develop shipped its own0010Feature matrix: Discord vs Telegram
/new)/start·/help)/start <code>·/link)send_chat_replysend_chat_reaction_emojipost_to_channel(Slack tool suppressed)0011)/mock/state+/mock/eventsmock-*-testing)Notes:
DISCORD_REQUIRED_TAG_FORUM_ERROR), documented behavior.Reliability and security
Validation
pnpm format:check,oxlint --deny-warnings, residual ESLint (includes a small oxlint/ESLint suppression reconciliation inapps/workerthat also fails onorigin/developtoday),pnpm check-types(26/26), full uncached Vitest suite (26/26 workspaces),pnpm knip(clean)