Skip to content

Rewire Discord to @copilotkit/channels (P0) — spec + plan - #109

Draft
jerelvelarde wants to merge 3 commits into
mainfrom
jerel/rewire-channels-sdk-3779f1
Draft

Rewire Discord to @copilotkit/channels (P0) — spec + plan#109
jerelvelarde wants to merge 3 commits into
mainfrom
jerel/rewire-channels-sdk-3779f1

Conversation

@jerelvelarde

@jerelvelarde jerelvelarde commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description corrected 2026-08-19. The body previously on this PR described unrelated work (a Vitest harness, Typefully read methods, a drafts store) pasted from another repo. It never matched this branch. What follows describes the actual diff.

Spec and plan only — no implementation. +1164/−2 across 5 files: a design doc, an implementation plan, an ingress-findings doc, plus the @copilotkit/channels dependency added to apps/discord-bot/package.json and the resulting lockfile changes.

What the spec proposes

Replace the Discord-facing I/O layer with @copilotkit/channels + @copilotkit/channels-discord, so the SDK owns the gateway, JSX→Components V2 rendering, interactions and slash-command registration instead of the hand-rolled discord.js client in apps/discord-bot.

Two seams change and nothing else does:

  • Inboundapps/discord-bot's Client + events/* + interactions/* + commands/* become createChannel({ adapters: [discord({...})] }), translating each turn into Outpost's existing InboundMessage.
  • Outbound — stays exactly where it is: async through ticket → queue → worker, with the worker calling getAdapter(DISCORD).postResponse(...).

The deliberate non-goals are the load-bearing part of the design:

  • The SDK's agent runtime is not used. thread.runAgent() is never called; Outpost's ticket/queue/worker/AI pipeline stays unchanged underneath. The SDK is Discord transport + rendering only.
  • GitHub is out of scope, and for a structural reason rather than a scheduling one: the Channels SDK ships no GitHub adapter and covers live chat surfaces only. GitHub is webhooks plus reaction polling, not a gateway surface.
  • Slack / Teams / Email untouched.
  • Cutover sits behind an env flag so it is per-environment and reversible.

Current status — read this before treating it as pending work

Open since 2026-07-16, the oldest open PR in the repo. In the meantime the Discord bot shipped, went live, and accumulated its own roadmap items. On main today apps/discord-bot still depends on discord.js directly and nothing in the tree imports @copilotkit/channels, so none of this spec has been implemented.

Worth knowing for whoever picks the decision up: @copilotkit/channels has itself moved on since this was written — the canonical CopilotKit surface is now @copilotkit/channels with managed Intelligence Channels, so the SDK-side API in this spec should be re-verified against the current package before any implementation starts, not assumed still accurate.

Two things are true at once, which is why this is a judgement call and not a cleanup:

  • the architectural analysis still holds — in particular the finding that shapes the scope (no GitHub adapter, so GitHub cannot sit on the SDK the way Discord can), and the decision to use the SDK as transport rather than as agent runtime;
  • the P0 label no longer reflects reality, and leaving it that way makes the roadmap read as if a critical rewire is queued when nothing is scheduled.

Tracked as CPK-7937. Left open deliberately pending that call; staying draft in the meantime so it cannot be merged by accident.

jerelvelarde and others added 3 commits July 16, 2026 11:02
Bridge apps/discord-bot onto @copilotkit/channels for transport + JSX
rendering while keeping the ticket/queue/worker engine intact. GitHub
deferred (SDK ships no GitHub adapter). Behind DISCORD_USE_CHANNELS_SDK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task 1 is a gating ingress spike (SDK is mention-gated; Outpost is
forum-monitored). Tasks 2-7: flag + dual-boot, inbound bridge to
InboundHandler, slash commands, feedback buttons via onInteraction,
outbound render swap, parity + docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Spike verdict: the SDK's stock discord() ingress cannot do forum /
non-mention monitoring (hardcoded mention gate, no threadCreate
subscription, private Client). Egress/renderDiscordMessage is usable.
See docs/superpowers/plans/2026-07-16-discord-ingress-findings.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 19, 2026

Copy link
Copy Markdown
CPK-7937 PR #109 — Channels SDK rewire: decide whether the spec is still live

PR #109Rewire Discord to copilotkit/channels (P0) — spec + plan. Draft, +1164/-2 across 5 files, authored by Jerel. MERGEABLE but open since 2026-07-16 — the oldest open PR by a month.

Spec and plan only, no implementation. Nothing else touches its files.

The decision

It is labelled P0 but has sat a month while the Discord bot shipped, went live, and accumulated its own roadmap items. Either it is still the intended direction for Discord — in which case it should merge as a spec and get an implementation issue — or it has been overtaken and should be closed so it stops reading as pending P0 work.

Jerel is the author and the right person to call it. He also has CPK-7921 (review PR #192) queued, so this is worth raising in the same pass.

Review in Linear

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.

1 participant