Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture, and agents typically run within sessions. In multi-agent collaboration scenarios, a mechanism is needed to allow agents in different sessions to communicate or pass instructions to each other. Existing approaches often rely on hard-coded raw session IDs, which lack manageability and stability.

The dsh-agents-in-the-loop plugin solves this problem. It provides a cross-session “call center” capability for DSH agents, enabling standardized communication among agents through inter-session message delivery and a name-based contact directory.

Plugin Positioning

  • Name: dsh-agents-in-the-loop
  • Type: Workflow
  • Owner: markelayan
  • License: MIT
  • Core value: Cross-session message delivery and named contact directory management.

Core Features

This plugin provides three main functional modules:

  1. session_message tool: Used to list currently active sessions and send messages to registered contact names.
  2. contacts tool: Maintains a named contact directory based on session IDs. Supports adding, updating, renaming, and deleting contacts at runtime without restarting DSH.
  3. HTTP API: Provides a loopback-only HTTP interface, allowing external agents (such as Claude Code) to send messages to registered contacts. It also supports client panels reading the contact directory.

Installation and Enablement

Install via npm:

npm i dsh-agents-in-the-loop

After installation, you need to add the plugin line to DSH’s cordis.patch.yml configuration file and restart dsh web. Configuration example:

- insert:
    - id: dsh-agents-in-the-loop
      name: dsh-agents-in-the-loop
      config:
        enabled: true
        sessionMessage:
          enabled: true      # 开启 session_message 工具
        contacts:
          enabled: true      # 开启 contacts 工具

Typical Usage

1. Send Messages Using the Tool

In a DSH agent, you can use the following commands:

  • List active sessions:
    session_message { action: "list" }
  • Send a message:
    session_message { action: "send", target: "dev-lead", message: "task done", wake: true, resumeIfDead: false }
*   `target`: Must use a registered contact name (starting with v1.4.2, raw session IDs are rejected).
*   `wake`: Defaults to true, waking an idle session.
*   `resumeIfDead`: Defaults to false, attempting to revive a dead session.

2. Manage the Contact Directory

  • Add a contact (self-registration with name only):
    contacts { action: "add", name: "dev-lead" }
*   Note: Self-registration does not require providing a sessionId.
  • Update contact information:
    contacts { action: "update", name: "dev-lead", label: "Backend Lead", tags: ["senior", "python"] }

3. External HTTP API Calls

External scripts or agents in non-DSH environments, such as Claude Code, can send messages through the loopback interface:

curl -s http://127.0.0.1:9001/api/agents-in-the-loop/message \
  -H 'Content-Type: application/json' \
  -d '{"from":"claude-code","contact":"dev-lead","message":"task done"}'
  • Note: The API only supports loopback access (127.0.0.1). Non-loopback requests return 403.
  • Note: The external API only supports the “send” operation. It does not support registration or receiving messages.

Notes

  1. Version change history: This plugin was formerly taskboard-flow. In v1.0, the kanban engine was removed; in v1.3, the Web UI was removed. The current version focuses on the core messaging functionality.
  2. Target locking rule (v1.4.2): session_message send and contacts call accept only registered contact names as targets. If an attempt is made to use a raw session ID, an error is returned and the list action is suggested.
  3. Context hygiene (v1.6.0): To prevent context bloat, message length is limited to 8,000 characters. If sending long reports, it is recommended to send them via a file path.
  4. Configuration and privacy: Contact storage is file-based (default path ~/.dsh/taskboard-flow-contacts.json), all operations are local, and no telemetry data is collected.

Conclusion

The dsh-agents-in-the-loop plugin provides a practical cross-session communication layer for the DSH plugin ecosystem. By replacing raw session IDs with the concept of “contacts,” it makes multi-agent collaboration more standardized and controllable. It is suitable for developers who need to build complex workflows or multi-agent systems.