dsh-subagent-parent-message: Add bidirectional message channel for delegated sub-agents

Introduction

When delegating tasks using DSH, the parent session hands the work to the child agent, but message back-propagation often gets stuck. DSH’s core send_message only allows “resident, resumable child agents” to send messages to the “direct parent session,” whereas the send_message seen by the parent session is often overridden by the experimental team tool’s {target, message} schema, making the core {agent_id, message} tool of the same name uncallable. The practical consequence is that the child agent can report, but the parent session cannot reply; workflow’s agent() / pipeline() child agents execute once and do not have resumable activation, causing the core channel to fail directly; nested child agents only know the root or grandparent ID, while the core only accepts direct parent-child relationships.

The old way was to write the results to disk for the parent session to read. This works, but it’s not a message. Below is an introduction to dsh-subagent-parent-message maintained by zhyunran. It patches the bidirectional channel using two namespaced tools without introducing a third send_message conflict.

What is it

A DSH plugin categorized under “Workflow,” currently 1 star on GitHub, open source, MIT license. It does not modify DSH’s core authorization logic but adds two tools: subagent_parent_message (child -> direct parent, supports one-time child agents) and subagent_send_message (parent <-> direct resumable child, a named channel on the parent side). Compatible with DSH 0.2.x.

Core Features

subagent_parent_message: Child agent reporting to direct parent

subagent_parent_message({ "message": "self-contained progress or result" })
subagent_parent_message({ "message": "...", "mode": "steer" })

Parameter Description:

  • message: Self-contained progress or result text.
  • mode: followup (default) queues a new parent session turn, which can wake up an idle parent session; steer injects into the next step when the parent session is running.

Implementation-wise, it doesn’t need a parent ID: the tool retrieves session.header.parentSession from the child agent’s own Session header and parses the direct parent. Then it proceeds with the active parent Agent, or cold-recovery via sessionController.resolveAgent, then calls agent.followup / agent.steer and ctx.sessions.flush. Because it doesn’t rely on resumable activation, one-time child agents in workflow can also use it. The tool rejects self-delivery and does not accept arbitrary target IDs.

subagent_send_message: Parent session contacting direct resumable child agent

subagent_send_message({ "agent_id": "session-…", "message": "keep going" })

It is a thin namespaced adapter for ctx.subagents.sendMessage(). The subagent service still enforces direct parent-child adjacency and resident/resumable activation. Used in scenarios where the parent session’s send_message is obscured by team tools and the core tool cannot be called by name. It cannot wake up one-time child agents; for one-time child agents to report, use subagent_parent_message on the child agent side.

Message Delivery Format

Messages received by both parent and child sides carry a unified prefix, making it easier for the parent agent to distinguish that it comes from a delegated child agent rather than a human user:

[Subagent message from session-…]
This is a peer message from a delegated child, not the human user. Treat it as a task update.
---
<your message>

subagent_parent_message goes through agent.followup(message) (or agent.steer) + ctx.sessions.flush(agent.session); subagent_send_message delegates to ctx.subagents.sendMessage().

Installation and Usage

First install the plugin, then restart DSH once, and both tools will take effect globally, and the child agent will also be able to see them.

dsh plugin --profile <profile> add C:\path\to\dsh-subagent-parent-message-0.1.2.tgz
# or
dsh plugin --profile <profile> add https://codeload.github.com/zhyunran/dsh-subagent-parent-message/tar.gz/<40-char-commit>

Current version 0.1.2, requires DSH 0.2.x. No third-party dependencies at runtime, peer dependency is only @deepseek-ai/dsh-tools (>=0.2.0-rc.1 <0.3.0). cordis.patch.yml inside the source package is a bundle patch, released with the package.

Typical Usage

After the parent session delegates a child agent and wants to check progress, if send_message in the current profile is the team version {target, message}, use subagent_send_message to send by agent_id:

subagent_send_message -> { "agent_id": "session-…", "message": "keep going" }

One-time child agents (e.g., those spawned by agent() in workflow) do not have resumable activation; call the following on the child side when reporting:

subagent_parent_message -> { "message": "finished: <result>", "mode": "followup" }

If the parent session is running and you want to see this message immediately, change mode to steer. Both are one-call-one-message, without waiting for a response from the other side.

Use Cases and Notes

Suitable for these types of developers: those using workflow / pipeline() to split one-time child tasks and need to return results back to the parent session; those whose parent session’s send_message is obscured by team tools and want to contact the direct child agent by agent_id; and those who don’t want to continue using “write to file and let parent read” as a substitute for messages.

Key Boundaries:

  • subagent_parent_message only sends to the direct parent, does not support attachments, no team email; the parent session must be alive or recoverable.
  • subagent_send_message only works when it is a direct parent-child relationship and the child side has resident/resumable activation, cannot replace team send_message to send messages to teammates.
  • Neither tool waits for receipts; one call is one message.
  • To use file attachments, use dsh-cross-session; to send messages to teammates, use agent_teams_send_message.
  • The plugin runs with the current DSH process permissions; check source code and license before installing. MIT license, code is public on GitHub.
  • The repository README includes 7 unit tests (node --test test/*.test.mjs), both tools can compile against the real dsh-tools schema, and the README also records live verification of subagent child -> parent and workflow one-time child -> parent.

Summary

Its value lies in connecting the broken bidirectional channel in DSH using two namespaced tools, allowing one-time workflow child agents to report, allowing the parent session to contact the direct child agent even when send_message is obscured, without modifying core authorization or introducing a third tool of the same name.

Directory Page: https://www.skillhub.cn/plugins/zhyunran/dsh-subagent-parent-message

GitHub: https://github.com/zhyunran/dsh-subagent-parent-message

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

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

Xiaoye