Introduction

DeepSeek Harness (DSH) adopts a plug-in architecture, emphasizing modularity and flexibility. In traditional agent development, a single model often simultaneously handles analysis, planning, execution, and summarization. When dealing with complex tasks, this approach can easily lead to excessive token consumption by the main model or make it difficult for the main model to focus on high-level strategy formulation. The dsh-planner-executor plug-in aims to solve this pain point by decoupling the planning and execution processes through a role separation mechanism.

Plug-in Overview

Plug-in Name: mikuuuuuue/dsh-planner-executor

Core Value: Planner/executor separation. The main model is responsible for analyzing issues, formulating plans, and summarizing results, while execution work is delegated to an independent executor sub-agent through a tool. The sub-agent runs in an independent session, ensuring that intermediate steps do not pollute the main session. This maximizes token savings for the main model and allows each role to use the most suitable model.

Core Features

  1. Main Model Responsibilities: The main model selected for the session is responsible for analysis, planning, and final summarization.
  2. Delegation Mechanism: Execution work is delegated to the sub-agent via the tool delegate_execution(task, context).
  3. Sub-agent Configuration: The model, LLM provider, persona, and tool scope of the executor sub-agent can be configured in the “Planning and Execution” section of the Web settings panel (if left blank, it inherits from the main model).
  4. Session Isolation: The sub-agent executes in an independent session; intermediate steps do not enter the main session, and only the final report is returned.
  5. Zero Dependencies: Implemented in pure JavaScript with no build dependencies; ready to use immediately after installation.

Installation and Enablement

Installing this plug-in requires using DSH CLI commands. After installation, the plug-in will be automatically integrated into the current Web Profile.

dsh plugin --profile web add "github:mikuuuuuue/dsh-planner-executor"

After installation, the plug-in will load automatically, and specific execution parameters will be configured in the Web interface.

Typical Usage

Using this plug-in mainly involves two steps: configuration and invocation.

1. Configure the Sub-agent

Access the Web settings panel, find the “Planning and Execution” section, and configure the following parameters:
* Sub-agent Backend: Select spawn (fresh context, token-saving) or fork (inherits completed turns from the main agent).
* Model and Provider: Set the model ID or LLM provider routing for the executor sub-agent.
* Permission Control: Configure tool filtering to allow or deny specific tools.
* Recursion Limit: Set maxDepth to limit the depth of recursive delegation.

2. Invoke the Tool

In the main model’s prompt or logic, call the delegate_execution tool to initiate delegation:

delegate_execution(task, context)

Use Cases and Considerations

  • Use Cases: Suitable for scenarios that require decomposing long-chain tasks into execution steps, or scenarios where the main model and execution model need to use different models (for example, using DeepSeek-V3 for the main model and a lighter model for the executor).
  • Permission Restrictions: The sub-agent’s permissions are fixed within the inherited sandbox scope, and the approval policy is fixed as never; it cannot self-escalate permissions.
  • Tool Restrictions: The delegate_execution tool is forcibly excluded from the sub-agent’s tool directory to prevent infinite recursion or out-of-scope invocations.
  • Known Limitations:
    • Dynamic model parameters per invocation are not supported.
    • Structured reporting via outputSchema has not yet been introduced.
    • The sub-agent runs in an independent session; if the main process has restricted permissions, the sub-agent will be similarly restricted.

Summary

This plug-in decouples the main and sub-agent roles through the delegate_execution tool, allowing the main model to focus on planning and summarization while the sub-agent focuses on specific execution. This separation model helps optimize token usage and improves flexibility in task processing. For more details, refer to the plug-in directory or GitHub repository.