dsh-task-splitter: Identifying and Automatically Splitting Long Tasks on the Host Side to Adapt to Local Models with Small Contexts

Introduction

When connecting local small models like llama.cpp or Ollama in DeepSeek Harness (DSH), the maxTokens per request and the context window are often far tighter than those of cloud models. A single user request such as “write a 3000-word report” or “help me pick a stock that might rise tomorrow” may not be completable within one model response, or the context may fill up after multi-step tool calls, causing intermediate conclusions to be lost. Relying on the model to judge on its own whether to split steps is not stable. Below we introduce the community plugin dsh-task-splitter: it uses heuristic scoring on the DSH host side to identify two types of long tasks, and injects executable procedures via agent/pre-step within the same request, instead of consuming an extra conversation round.

What Is This

dsh-task-splitter is maintained by Passenger-Qin, categorized as a workflow, and the current npm package version is 0.1.1 (MIT license). One-sentence positioning: a DSH host plugin that detects “long output” and “multi-step workflow” tasks and automatically splits them for small-context local models — either building a parts skeleton or a PLAN.md ledger, and injecting execution rules.

The plugin does not make business judgments on behalf of the model; Lane B in particular emphasizes process and honesty (planning, persisting evidence, sources and uncertainty), and does not guarantee the correctness of the final answer.

Two Lanes: Output-Type and Workflow-Type

The README uses two “lanes” to distinguish failure modes, and the plugin provides different scaffolding for each lane.

Lane A — Long Output Lane B — Long Workflow
Typical example “Write a 3000-word industry report in 4 parts” “Help me pick a stock that is highly likely to rise tomorrow”
Prompt characteristics Usually fairly explicit (word count, number of sections, sub-sections) Can be extremely short
Bottleneck Single-output budget (maxTokens) Step count and context: tool outputs fill the window, small-model drift, intermediate results lost
Plugin action Create tasks/<slug>/parts/NN-*.md and MANIFEST.json; write only one part per turn, then assemble at the end Create tasks/<slug>/PLAN.md and notes/; establish a plan first, one step per turn, write results to disk

Lane A suits explicit long-form text, sectioned lists, multiple deliverables, etc.; Lane B suits decision/research verbs combined with data-dependent domain nouns, or explicitly multi-step tasks that require current external data. Single queries (e.g., “what’s the weather tomorrow”) are deliberately kept below the threshold to avoid false splitting.

Example decisions from the documentation (host-side scoring, not dependent on model cooperation):

User prompt Result
what's the weather No split
look up tomorrow's weather for me No split (single query)
recommend me a movie No split (score 2, below threshold 3)
pick me a stock likely to rise tomorrow Lane B → PLAN.md + notes/
compare these three laptops and pick one Lane B
write a 3000-word industry report, 4 parts Lane A → 4-part skeleton
Prompts with 1./2./3. sectioned lists Lane A (section titles used as part titles)

How the Host Intervenes

Scoring is done on the host; the model does not need to be self-aware. Lane A signals include: explicit word/character counts, explicit part counts, numbered section lists, long-form keywords combined with writing verbs, overly long prompts, multiple-deliverable phrasing, etc. Lane B signals include: verbs such as pick / recommend / evaluate / compare / analyse / predict / research / screen, combined with data-dependent domain nouns like stocks, funds, housing, flights, papers, competitors, laptops, or explicit multi-step phrasing, “requires current external data”, etc.

The procedure is injected via agent/pre-step into the same request (no extra round), and only applies to the step that begins with a human message.

Installation and Dependencies

Install the official package name under the profile (restart DSH after installation):

dsh plugin --profile <your-profile> add dsh-task-splitter

When installing from a source tarball, the README gives:

npm pack
dsh plugin --profile <your-profile> add file:./dsh-task-splitter-0.1.0.tgz

(The tarball file name is whatever npm pack actually outputs; the current package.json version is 0.1.1.)

The host must expose agent/pre-step, ctx.agents and ctx.sessions, and be compatible with @deepseek-ai/dsh-agent / dsh-session ^0.1.1-rc.2 || ^0.2.0-rc.1. The Node engine requirement is >= 20. The README notes testing on Windows with DSH 0.2.0-rc.2 and Qwen3 served by llama.cpp.

The plugin runs with the privileges of the current DSH process; before installing, it is recommended to read the GitHub repository source code and MIT license to confirm consistency with your local environment.

Configuration

Add a snippet in the profile’s cordis patch (or home patch), for example:

- id: task-splitter
  config:
    enabled: true
    providers: [qwen-local]   # empty array means it applies to all providers
    lanes: [parts, plan]      # remove an item to disable the corresponding lane
    minScore: 3               # Lane A threshold
    workflowScore: 3          # Lane B threshold (raising to 4 is more conservative)
    maxParts: 8               # Lane A: maximum number of parts to split into
    wordsPerPart: 900         # Lane A: target character count per part
    tasksDir: tasks           # relative to the session working directory
    toolPath: ''              # CLI used in the injected procedure; defaults to the built-in one
    extraRules: ''            # supplementary notes appended to the end of the injected procedure (environment-specific tool names/service addresses)

Detection is heuristic; raising workflowScore / minScore can reduce false triggers. In the worst case it just injects one extra short instruction, without blocking any turn.

Lane A Companion CLI: dsh-task-parts

The plugin ships with dsh-task-parts (also referenceable as dsh-task-splitter/task-parts), which drives the parts workflow outside the model:

node bin/task-parts.mjs init <taskDir> --title "T" --parts "one|two|three"
node bin/task-parts.mjs status <taskDir>     # completion status of each part; exit 2 if not finished
node bin/task-parts.mjs next <taskDir>       # the next part to be written
node bin/task-parts.mjs assemble <taskDir>   # concatenate into final.md

Typical usage: after the host identifies Lane A, it builds the tasks/<slug>/parts/ skeleton; the model fills in only one part per turn following the injected rules; once done, run assemble in the task directory to obtain the full draft.

Suitable Scenarios and Limitations

Who it suits better: developers using small local models (e.g., Qwen3 27B IQ2, maxTokens: 8192) for everyday DSH conversations; who need long-form writing in chunks, or multi-step research/comparison tasks, and want intermediate results persisted to disk and advanced step by step.

Limitations to accept (explicitly stated in the README):

  • Lane B guarantees process and honesty (planning, evidence, sources, uncertainty, no fabricating data), but does not guarantee the correctness of conclusions such as stock picking or prediction; when there is no market/financial data source, the procedure should guide the model to state that it cannot give a reliable conclusion, rather than making up numbers.
  • False positives/negatives can be tuned via minScore and workflowScore; the plugin never hard-blocks a user turn.
  • The test-sim.mjs in the repository contains 27 offline simulation cases; the file is not included in the npm package.

The DSH ecosystem emphasizes “everything is a plugin”; the community catalog SkillHub plugin page is an independent site with no official affiliation with DeepSeek / High-Flyer.

Summary

dsh-task-splitter handles the two problem types of “long output” and “long workflow” separately on the host side: the former uses a parts skeleton with assemble, while the latter uses PLAN.md and notes/ executed step by step. If you are using a small-context local model on DSH to handle long tasks, you can first install it using the commands above, adjust lanes and the thresholds as needed, and then complete the full workflow with the CLI in the task directory.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye