dsh-plugin-discord: Driving DeepSeek Harness Workspace Sessions in Discord

Preface

DeepSeek Harness (dsh) agent sessions are usually tied to a desktop client or a profile in dsh web: editing code, running tools, waiting for approvals—all of that requires you to be at your computer. When you’re on your phone or away, the common approaches are SSH, remote desktop, or simply putting tasks off until the next time you boot up—which doesn’t match the experience of “interrupt anytime, stop anytime, approve tools anytime.”

Below is an introduction to the community plugin dsh-plugin-discord (maintainer tjiisztiuv): it treats Discord as a remote console and talks to the Harness Host through the same set of APIs via a bot, rather than spinning up a separate gateway process.

What Is This

dsh-plugin-discord is a bundle plugin for dsh, categorized as a client. Once installed and enabled, its code runs inside the Harness Host process of the DeepSeek desktop client (or dsh web) and calls the same Host APIs used by the UI (e.g. ctx.sessionController, ctx.workspaceRegistry).

In short: Chat with any workspace session from Discord, attach to a session currently in use on the desktop client, approve tool calls, answer model questions, and stop tasks.

No additional daemon is needed, and no ports are exposed to the outside: the Discord bot only makes outbound connections.

Core Features

Shared Sessions with the Desktop Client

  • Sessions created from Discord are ordinary sessions: they appear under the corresponding workspace in the desktop client sidebar, using the current default model, agent preset, and permissions.
  • Sessions already open in the desktop client can be attached from Discord using /attach (or !attach); input from either end will sync replies to Discord (mirroring desktop input can be controlled via configuration).
  • Tool approvals and model ask_user_question prompts appear simultaneously in Discord and the desktop client; the default policy is race—whoever answers first takes effect. If Discord answers first, the desktop client approval dialog automatically collapses.

Discord-Side Mapping

Discord Harness
Direct message (DM) One session; /new switches to a new session
Text channel A default workspace (/use to select); sending a message in the channel automatically creates a thread
Thread One session; the thread is automatically renamed once a title is generated

Commands and Daily Operations

Both slash commands and !-prefixed text commands are supported (global slash command registration may take a few minutes; text commands can be used during that time). Commonly used ones include:

Slash command Text command Effect
/ws !ws List workspaces
/use workspace !use <name/index> Switch the workspace used here
/new [prompt] [workspace] !new [content] Create a new session
/sessions [workspace] !sessions Recent sessions
/attach session !attach <index> Attach to an existing session
/detach !detach Unbind (does not delete the session)
/stop !stop Stop the current task
/steer text !steer <content> Interject to guide a running task
/status !status View the bound workspace and session

Sending a message directly delivers it to the currently bound session; if nothing is bound, a new session is created in the default workspace (text channels automatically open a thread). Image attachments are passed to the model as image input, while other attachments are included as links in the message.

When the model asks a question, Discord displays a question card (single-select buttons, multi-select dropdown, “Other…”, “Skip”, etc.); during the wait for an answer, ordinary messages in the channel can also be used as answers. A session is bound to only one Discord location at a time; if you /attach the same session from elsewhere, the original location will receive a transfer notice.

Configurable Behavior (Selected)

Override the discord plugin configuration in the profile’s cordis.patch.yml, for example:

  • approvals / questions: race (both sides race) or desktop (desktop only)
  • toolCalls: compact (one editable tool progress entry per turn) or off
  • showReasoning: whether to display the reasoning process in quote format
  • allowedGuildIds / allowedChannelIds: optional server and channel allowlists

See the configuration table in the repository README for all fields.

Installation and Activation

1. Create a Discord Bot

  1. Go to https://discord.com/developers/applications → New Application.
  2. On the left, Bot → Reset Token, then copy the token.
  3. On the same page, enable Privileged Gateway Intents → MESSAGE CONTENT INTENT (otherwise message content cannot be read).
  4. OAuth2 → URL Generator: check bot and applications.commands in Scopes; check View Channels, Send Messages, Create Public Threads, Send Messages in Threads, Manage Threads, Read Message History, Add Reactions, Attach Files in Bot Permissions. Use the generated link to invite the bot to your server.
  5. Get your Discord user ID: Settings → Advanced → Developer Mode → right-click your avatar → Copy User ID.

A prerequisite for DMing the bot is that you and the bot are in the same server.

2. Install the Plugin

Method A (Desktop client): Sidebar “Plugins” → Install → Enter dsh-plugin-discord as the “Plugin package name” → “Enable now” after installation.

Method B (Command line, dsh web or other profiles):

dsh plugin --profile <profile> add dsh-plugin-discord

3. Configure the Token

The token is not written to the patch file; it is read by dsh’s credentials system, with the default environment variable name DISCORD_BOT_TOKEN. Choose one of the following:

  • ~/.dsh/.env: DISCORD_BOT_TOKEN=xxxxx
  • Or ~/.dsh/.credentials.yaml

If using .env: it is only read once at desktop client startup; after modifying it, you must fully quit (e.g. Cmd+Q) and reopen the app; simply re-enabling on the plugin page will not pick up the new value. The variable name must match tokenEnv in the configuration.

4. Fill in the Patch (Required)

By default, if allowedUserIds is empty, the bot will not go online (the logs will indicate this). Override the discord entry in the profile’s cordis.patch.yml; the desktop client example path is ~/.dsh/profiles/desktop/cordis.patch.yml:

- id: discord
  config:
    tokenEnv: DISCORD_BOT_TOKEN
    allowedUserIds: ['123456789012345678']     # Your Discord user ID
    stateFile: !!js dshHomePath('discord', 'state.json')
    defaultWorkspace: my-project                # Optional

The patch replaces the entire config of that entry, so all required keys must be written out. After saving, profiles with HMR enabled will automatically reload; otherwise, restart the desktop client.

Typical Usage

  1. In a Discord DM with the bot: /use to select the workspace, then /new or send a message directly to start a session; the same session will appear in the desktop client sidebar.
  2. For a long-running task already running on the desktop client: use /sessions in Discord to find the index, /attach to join it, and use /steer to interject or /stop to stop it while away.
  3. When the agent requests to execute a tool: Discord receives an approval button, and whoever clicks first between Discord and the desktop client takes effect; approval prompts will not appear under a full access preset.
  4. Model multiple-choice questions: click buttons, use dropdowns, or simply reply with the index number/original text/any text; in plan mode, the “approve” option is a green button.

Use Cases and Caveats

Who it’s for: Developers already using the dsh desktop client or dsh web who want to follow up on the same workspace session via Discord on their phone or Mac; people who need to approve tools, answer model questions, or stop tasks on the go without setting up a reverse proxy or exposing local ports.

Security (must read):

  • Discord messages directly drive the local agent to read and write files and execute commands—the effect is equivalent to a remote shell. You must configure allowedUserIds, and it is recommended to only put the bot in a private server; optional allowedGuildIds and allowedChannelIds can further narrow the scope.
  • The token should only be stored locally in credentials, not committed to any repository.
  • The plugin runs with the permissions of the current dsh process; before installing, review the source code and the MIT license yourself to confirm it meets your security policy.

Known limitations (from the README):

  • After a time-limited question times out, supplementary answers can only be provided on the desktop client.
  • Replies are sent as a complete chunk after each model step finishes, without per-character streaming editing.
  • When the token is written to ~/.dsh/.env, the desktop client must be fully restarted for the bot to go online; when written to ~/.dsh/.credentials.yaml, it can be re-enabled on the plugin page.

The DeepSeek Harness ecosystem emphasizes “everything is a plugin”; community directories such as SkillHub are independent of DeepSeek / High-Flyer and are not official app stores.

Closing

dsh-plugin-discord connects Discord inside the Harness Host: no additional process, no opened ports, yet it enables remote conversations, desktop session attachments, racing approvals, and answering questions. If you are already using dsh and want mobile control, follow the README to create a bot, install the bundle, configure the allowlisted user ID, and enable it.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye