Foreword

When using DeepSeek Harness (DSH) for long-session development, context expansion is a common problem. As history accumulates, token consumption increases, model inference slows down, and details may be lost. Traditional manual compaction loses key information. In addition, the primary model carries too much execution load, and many tasks better suited to cheaper models are still handled by the primary model.

dsh-switchman aims to solve these problems. It is a DSH plugin that transforms the primary model from execution to scheduling. It measures the context watermark in real time, dispatches tasks to appropriate scheduling pools, and manages agent teams. This is not a new model, but a scheduling policy mounted on DSH.

Plugin Overview

dsh-switchman is a plugin for DeepSeek Harness (DSH) that provides context watermark control, scheduling pool management, and agent team management, and supports autonomous coding workflows. The plugin is maintained by mrzturn and is licensed under the MIT License.

Core Features

1. Context Watermark Control

The plugin monitors session token counts through three thresholds to prevent unlimited context expansion:
- 50k tokens: A soft threshold that suggests the model may need to delegate tasks.
- 90k tokens: A hard threshold that limits the budget for a single read and guides the session toward closure.
- 130k tokens: A forced truncation threshold that automatically forks the session, compresses the context, and wakes a backup session to continue the task. The IDs, tasks, and report paths of background subagents are written into the handover document to ensure no state is lost.

Users can intervene manually with the following commands:
- /ctx-pause: Pause watermark actions while continuing measurement.
- /ctx-resume: Resume watermark actions.
- /ctx-handover: Trigger session handover immediately without waiting for a threshold to be reached.

2. Six Scheduling Pools

The plugin defines six scheduling pools, each corresponding to a different task type. Users can configure the model priority and tier (S/A/B/C) for each pool on the settings page.
- Economy pool: Handles small batch tasks.
- Mechanical pool: Handles template rewrites.
- Primary model pool: Handles everyday coding tasks.
- Hard pool: Handles difficult inference and large refactors.
- Vision pool: Handles image tasks.
- Review pool: Handles independent verification.

Scheduling modes include Off, Advisory, and Forced. In Forced mode, models outside the pool definition are rejected.

3. Agent Team Mode

The default is lightweight subagent scheduling. When “Agent Team” is enabled, team policies are activated (default delegation, layered verification, and a shared task board).
- Layered verification: Changes exceeding 20 lines are checked by a tester; changes exceeding 300 lines or involving core/security/data consistency are additionally submitted to an independent reviewer.
- Shared task board: The primary model can publish tasks to the shared task board using team_task_* commands.
- Model whitelist synchronization: When this option is enabled, the plugin merges the models from all scheduling pools and writes them to the DSH subagent model whitelist as a single source of truth.

4. Language Preferences and UI

  • Language preferences: Supports global or project-level configuration for the language of replies, comments, and documentation.
  • UI localization: Supports multilingual interfaces without additional downloads. Select the language in the “UI” section of the settings page, or keep “Auto” to follow the DSH application language.

5. Built-in Skills

The plugin includes three built-in skills:
- db-query: Read-only MySQL/Redis validation for data reconciliation and cache checks.
- git-commit-message: Generates standardized commit messages.
- requirement-docs: Generates standard outputs for requirement analysis, PRDs, and design documents.

Installation and Dependencies

Ensure the environment meets the requirements before installation:
- Node.js >= 24
- DSH >= 0.2.0-rc.0

Use the following command to install:

plugin_manager: install_bundle  target=dsh-switchman

Typical Usage

After installation, the primary model dispatches tasks based on the context watermark and scheduling pool recommendations. Users can:
1. Configure the model priority for scheduling pools on the settings page.
2. Use /ctx-pause or /ctx-resume to control watermark behavior.
3. Use the /vision command to let the Vision pool model process an image (for example: /vision what's wrong with this image).

Notes

  • The plugin depends on @deepseek-ai/schemastery.
  • Agent Team Mode must be manually enabled by the user on the settings page.
  • The plugin runs with the permissions of the current DSH process; it is recommended to inspect the source code and license before installation.

Summary

dsh-switchman helps developers control token consumption in long sessions through context watermark and refined scheduling pool management, and routes suitable tasks to more appropriate models. Combined with agent teams and layered verification, it provides a more stable infrastructure for autonomous coding workflows.

Plugin Directory
GitHub Repository