Introduction¶
In DeepSeek Harness (DSH), using run_in_background to start background sub-agents is a common development pattern. However, the notification or report messages from completed background sub-agents often go directly into the inbox or appear in the UI while the parent session is still busy, such as when it is generating a reply or calling tools. This can cause messages to mix into the ongoing turn or prematurely interrupt the user’s attention.
@momojie-s/dsh-subagent-idle-delivery solves this problem. It uses a hold-and-release mechanism to intercept completion notifications from background sub-agents until the parent session is fully idle, and then delivers these messages as new conversation turns.
Plugin Overview¶
This is a DSH plugin maintained by developer Momojie-S.
Its core logic is to intercept completion notifications from background sub-agents and deliver them when the parent session is idle. It takes effect after installation without any additional operations. It supports intercepting message types such as subagent-settled (background sub-agent settlement notification), subagent-report (legacy report tool), and agent-message (new send_message replies).
Installation and Enablement¶
Install the plugin via the command line:
dsh plugin --profile web add github:Momojie-s/dsh-subagent-idle-delivery
On first installation, if using pnpm, you may need to add allowBuilds to the pnpm-workspace.yaml file in the profile directory to allow builds. Restart DSH after installation to take effect.
Configuration Options¶
The plugin supports extended configuration by patching the config field.
| Field | Type | Default Value | Description |
|---|---|---|---|
heldKinds |
string[] | ['subagent-settled', 'subagent-report', 'agent-message'] |
Specifies the list of source.kind values to intercept. Before extending, verify all sources of the target type to avoid accidentally intercepting approval or task completion notifications. |
maxHoldMs |
number | 600000 |
Release-valve timeout. If a message is held for longer than this number of milliseconds and the session has not become idle, the message is released in a “queued after the current turn” manner. Set to 0 to strictly hold until idle, but use caution (continuously driven goal sessions may remain non-idle for a long time). |
Verification and Use Cases¶
Typical usage:
Have the model launch a background sub-agent using run_in_background while the parent session continues executing the current task.
Verification steps:
1. Start a background sub-agent.
2. Observe the logs. You should see holding N notice(s) ... until idle, indicating that messages have been intercepted.
3. At this point, the UI should not display the sub-agent’s report message.
4. Complete the current turn’s work in the parent session.
5. The sub-agent’s report appears in the history as a new turn, and the logs show released ... (idle).
Notes¶
- Environment dependency: The plugin depends on DSH version
>= 0.1.0-rc.7. - Type changes: By default, it intercepts the
agent-messagetype. After the DSHrc.1steer unification, this message type replaces the old report tool. - Permissions: This plugin runs with the current DSH process permissions. Please review the source code and license before installing.