dsh-subagent-parent-message
Bidirectional messaging tools for delegated DSH subagents.
subagent_parent_message— child → direct parent. It reads the parent from the child's own Session header and delivers a durable peer-session message, so one-shot/workflow children can report without writing a file first.subagent_send_message— a namespaced alias for the core adjacent-agent channel (parent ↔ direct continuable child). Use it when the parent'ssend_messageis shadowed by a team-scoped tool with a different schema.
Why
DSH core send_message only authorizes a resident continuable child to message its direct parent, and the parent often sees a different send_message ({target, message} from the experimental team tool) instead of the core one ({agent_id, message}). In practice:
subagent/subagent_forkchildren can reach the parent, but the parent cannot reply when itssend_messageis team-scoped.workflowagent()/pipeline()children are one-shot; they have no continuation activation, so coresend_messagefails.- Nested children often only know a root/grandparent id; core only accepts the direct parent/child (
subagent "<id>" is unavailable). - The old workaround was "write everything to disk so the parent can read it". It still works, but it is not a message.
These two namespaced tools cover both directions without adding another send_message collision.
Tools
subagent_parent_message — child → parent
subagent_parent_message({ "message": "self-contained progress or result" })
subagent_parent_message({ "message": "...", "mode": "steer" })
followup(default): queue a new parent turn; wakes an idle parent.steer: inject at the parent's next step while it is running.- Resolves the direct parent from
session.header.parentSession; no parent id required. - Uses the live parent Agent or
sessionController.resolveAgentcold resume, thenagent.followup/steer+ctx.sessions.flush. - Works for one-shot/workflow children because it does not depend on a continuation activation.
- Refuses self-delivery and never accepts an arbitrary target.
subagent_send_message — parent ↔ direct continuable child
subagent_send_message({ "agent_id": "session-…", "message": "keep going" })
- Thin namespaced adapter over
ctx.subagents.sendMessage(). - The subagent service still enforces direct parent/child adjacency and continuation residency.
- Useful when the parent's
send_messageis team-scoped (targetschema), so the core channel is otherwise unreachable by name. - It cannot wake a one-shot child; for a one-shot child's report use
subagent_parent_messagein the child.
Delivery shape
[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 uses agent.followup(message) (or agent.steer) + ctx.sessions.flush(agent.session); subagent_send_message delegates to ctx.subagents.sendMessage().
Limits
subagent_parent_message: direct parent only, no attachments, no team mailbox; parent must be live or resumable.subagent_send_message: only direct parent/child with a resident continuable activation; it does not replace teamsend_messagefor teammates.- Neither tool waits for the other side's answer; one call is one message.
- For file attachments use
dsh-cross-session; for teammates useagent_teams_send_message.
Install
Requires DSH 0.2.x.
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>
Restart DSH once after install; both tools are global and visible to subagents.
Status
- 7 unit tests (
node --test test/*.test.mjs): live parent, cold resume, steer, missing parent, empty message,subagent_send_messagedelegation, missing service. - Real
dsh-toolsschema compile for both tools. - Live verified:
subagentchild → parent via coresend_message;workflowone-shot child → parent viasubagent_parent_message(followupandsteer). - No runtime dependencies; peer-depends only on
@deepseek-ai/dsh-tools.
License
MIT. See LICENSE.
Built for DeepSeek Harness.
No comments yet. Be the first to write one.