dsh-telegram-bridge: Move DSH sessions into Telegram

Preface

All DSH sessions run within desktop applications: checking status requires switching windows, approving tool calls requires staying at the computer, and when running long tasks, if a person leaves, there is no one to take over. Existing approaches rely on Web UI or repeatedly typing commands in the terminal; as long as you are not next to the machine, the agent’s manual intervention link breaks down.

captainpersia-66/dsh-telegram-bridge (package name @local/dsh-telegram-bridge) is to fill this gap. It runs a Telegram bot within the DSH Host process, allowing you to view sessions, check results, send prompts, and handle approvals using just your phone. No need to open ports, webhooks, or have a public address — the plugin long-polls the Telegram Bot API from the Host.

Below is an introduction to its capabilities, how to enable it, and usage points.

What is it

A plugin that bridges DSH sessions to Telegram. The maintainer is CaptainPersia-66, classified as “Client” in the community directory. The page lists 1 GitHub star, MIT license, and version 1.3.0 in package.json.

It solves the problem: when a person is not sitting at the desk, they can still follow sessions, advance the agent, and perform human-in-the-loop judgments on mobile devices.

Core Capabilities

The capabilities listed in the README are as follows:

  • View sessions: Title, working directory, running/idle status, recent activity.
  • Read results: The latest assistant answer for each turn, including token usage.
  • Review a run: Request, answer, every tool call (including success/failure and result preview), and the files it modified, along with added/deleted line counts.
  • Advance the agent: Send plain text as a prompt directly, or send steering messages, stop the run, create or rename sessions.
  • Voice input: Telegram voice messages are transcribed locally by DSH’s voice input model and sent as prompts.
  • Media return: Video, audio, images, and documents produced in a specific turn are automatically sent to Telegram; /files can resend the output of the most recent turn.
  • Approval moment: When the desktop app is not in the foreground, use your phone to approve/reject tool calls or answer ask_user_question cards.
  • End push: A push is sent as soon as a turn finishes, accompanied by Result / Review / Status buttons.

Installation & Enablement

The plugin does not provide an installation command entry and intentionally does not include a pre-generated settings form. The method to enable it is: first create a bot to get a token, then give the token to DSH, and finally authorize your chat in the profile patch.

  1. Create a bot and get a token.

    Find @BotFather in Telegram, send /newbot, name it and set the …_bot username, and copy the token (e.g., 123456789:AA…).

  2. Give the token to DSH.

    Two options: write botToken: directly in the telegram-bridge line of the profile patch (the official guide does not recommend doing this on shared machines); or set the TELEGRAM_BOT_TOKEN environment variable, or save it via Harness credential store. The default is tokenRef: TELEGRAM_BOT_TOKEN. For Windows desktop installation, the path is “System Properties → Environment Variables → User Variables → New”, name TELEGRAM_BOT_TOKEN, value token, then completely restart DSH — closing the window isn’t enough, you must exit from the tray menu.

  3. Authorize your chat and restart.

    After restarting, send /start to the bot. At this point, no chats are authorized yet. The bot enters pairing mode and only returns your numeric chat ID and user ID. Add this chat ID to the plugin line in the profile patch:

    - id: telegram-bridge
      name: "@local/dsh-telegram-bridge"
      config:
        tokenRef: TELEGRAM_BOT_TOKEN
        allowedChatIds: ["123456789"]
Location of the profile patch: Windows is `%USERPROFILE%\.dsh\profiles\desktop\cordis.patch.yml`, other systems are `~/.dsh/profiles/desktop/cordis.patch.yml`. Note that it must be written in the profile patch, not inside the bundle's own patch. Private chats can also use `allowedUserIds`; the two lists are merged.

Here is a pitfall: line overrides replace the entire `config`, so when setting `allowedChatIds`, you must re-specify `tokenRef`. Also, the profile patch is applied after the bundle layer, so your configuration remains after a plugin upgrade.
  1. Restart DSH, send /help to the bot, and receive a command card to confirm it is working.

    A security detail: pairing itself does not authorize. Unknown chats will only receive their own ID, and this prompt has rate limits; as long as the ID is not in the whitelist, all commands are ignored.

Common Commands

The full command table from the README is below. Plain text (not starting with /) will be sent to the current session as a prompt.

Command Function
/sessions (or /list) List sessions, click buttons to select one
/use <n \| id-prefix \| title> Select a session by index, ID prefix, or title substring
/status (/current) Status, turns/steps, model, tokens, context, strategy, activity
/result [turns] Latest assistant answers for the last few turns, default 1 turn
/files Resend media/documents produced in the most recent turn to this chat
/review Request/answer/tool calls/modified files of the most recent turn
/tail [turns] Compact overview of the last few turns
/controls (/more) Button card for all session actions, equivalent to ⚙️ All controls
/say <text> Send a prompt (explicit syntax for plain text; if no text, waits for the next message)
/steer <text> Send steering to the currently running turn; if no text, waits for the next message
/stop Stop the currently running turn
/new [absolute-cwd] Create a new session (can specify working directory) and select it
/topic [rename <name> \| sync \| close \| reopen] Create/bind, rename, sync, close, or reopen session topic
/rename <title> Rename the selected session; if no title, waits for the next message
/pending List pending approvals/questions with buttons
/approve [id] / /deny [id] Handle the oldest or specified ID pending item
/notify on\|off Toggle push notifications for this chat
/notify all\|current Set push scope to all sessions or only the current session
/whoami View your ID, selected session, notification status, web UI address
/debug Sanitized diagnostic information
/cancel Abandon pending button text input (Say…/Steer…/Rename…) or the entered answer
/help Command card

By default, /sessions does not show subagents and archived sessions. To see them, set sessions.includeSubagents: true and/or sessions.includeArchived: true, or directly specify using /use <full session id>.

Typical Usage

Follow multiple sessions. After selecting a session, it becomes the default target for plain text and commands. When pushes from multiple sessions arrive simultaneously, you don’t need to select: simply reply to a message in Telegram; the prompt will be sent to the session that message belongs to, and it will be set as the subsequent active session. The reply mapping is kept in memory for 24 hours, with a maximum of 300 entries per chat. After a restart, replies to old messages will revert to the current active session; at this point, explicitly send /sessions or click the notification button.

Remote approval. When the desktop app is not in the foreground, approval/question messages have inline buttons. Questions with multiple choice answers also have ✅ Done and ✏️ Other; the latter switches the conversation to “type your answer” mode. You can also use /pending to see the to-do list with buttons, or /approve//deny to process them.

Remind the agent you aren’t at the machine. DSH sessions by default belong to the person sitting at the desk, and the agent might directly open files or windows there. The plugin makes the transmission source explicit: all prompts from Telegram (input text, quoted routing text, transcribed voice) are labeled as remote context.

Applicable Scenarios & Notes

Suitable for scenarios where DSH runs long tasks or requires multiple manual judgments, and the person is often not at the computer, wishing to continue the session on the phone, approve calls, and receive media output.

Points to note:

  • The plugin runs with the permissions of the current DSH process and can read files, environment variables, and credentials that the process can read. You should check the source code and license before installing to confirm you accept its capability boundaries.
  • It will access TELEGRAM_BOT_TOKEN and long-poll the Telegram Bot API from the Host. Do not hardcode the token into the configuration line on shared machines.
  • This section only covers features with clear documentation. Installation commands, built-in configuration options, icons, copywriting, etc., follow package.json and README.md in the repository.
  • The directory page is an unofficial community site with no official affiliation with DeepSeek or Huansuan. Star counts and category data follow the directory page and the GitHub page.

Conclusion

The value of this plugin lies in turning “not being at the machine” from an obstacle into a normal state: sessions are visible, results are readable, approvals are clickable, and outputs can be collected. If you are running automation on DSH and need manual oversight, it is worth trying out. The directory page is at https://www.skillhub.cn/plugins/CaptainPersia-66/dsh-telegram-bridge, and the source code is at https://github.com/CaptainPersia-66/dsh-telegram-bridge.

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

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

Xiaoye