Introduction¶
In the DeepSeek Harness (DSH) plugin ecosystem, Agent presets typically mix planning, execution, and review into a single session. If the expensive primary model personally runs commands, modifies files, and writes code, it both burns through budget and produces changes that are hard to audit. dsh-dev-plan-presets splits the work into two roles: the main window handles only planning, delegation, and review, while sub-agents perform the actual construction and report directly. This is version 0.4.0, focused on overall speed improvements and engineering optimizations, streamlining the main window persona on top of 0.3.0, introducing controllable tool modes and step-count warning thresholds.
What Problem Does This Package Solve¶
If an expensive primary model personally reads the repository, runs commands, and writes code, it simultaneously burns through budget and creates changes that are difficult to audit. This package splits the work into two roles:
- Main window (dev-plan): Plans, delegates, and reviews only. It does not mount construction tools such as fs / search / Web / Shell / workflow / skill / todo / goal, and never writes code itself.
- Sub-agents:
recon/reviewhandle evidence gathering and review;scribehandles document persistence;develophandles actual construction. All four tools spawn in-process,maxDepth=1, and share the same sub-agent model routing.
0.2.x had only the first three delegation tools, and construction typically relied on a separate window or a bridge plugin. 0.3.0 added develop, allowing the main window to directly delegate work, collect reports, dispatch independent reviews, and send rework back to the same developer—no longer depending on dual-window buttons.
Installation¶
This package is a standard DSH bundle; package.json declares dsh.bundle.patch and dsh.client. Install the local directory via the plugin manager:
Plugins → Add plugin → Select this directory
After installation, enable the dsh-dev-plan-presets bundle, then create a new session and select “Development Planning & Delivery.” The package contains no install scripts, no build steps, and zero runtime dependencies.
Environment requirements:
- DSH
>=0.2.2-rc.3(package.jsonengines.dsh; current verified baseline is 0.2.2-rc.3); @deepseek-ai/dsh-agent-preset-registryalready enabled in thedsh-base/ Web or Desktop profile (shipped with the official base);- The Client settings page also requires
@deepseek-ai/dsh-client-locale(enabled by default in Web/Desktop). If missing, the settings entry is not registered; Host preset registration, model guarding, and state/save routing do not depend on it. - The main window requires
agentPresets,webServer, andconfigEditorservices; if any are missing, it degrades gracefully based on actual availability and will not cause Host startup failure: - Missing
agentPresets: presets are not dynamically registered; remaining Host guards/settings routes still operate with available services; - Missing
webServer: Client still unconditionally registers the settings page, but/stateand/configroutes do not exist; the page displays 404 guidance, stops automatic polling, and “Refresh” triggers a retry; - Missing
configEditor: the page can read state, but save returns 503 (code=config-editor-unavailable); configuration must be modified via plugin management.
The Four Delegation Tools¶
| Tool | Purpose | Sub-agent preset | Tool surface |
|---|---|---|---|
recon |
Verify, traverse, and search repository facts | standard |
Full standard (constrained to read-only by the compact template embedded in the main preset; for sub-agent use only) |
review |
Independent review, find issues, falsify critical facts | standard |
Full standard (constrained to read-only by the compact template embedded in the main preset; for sub-agent use only) |
scribe |
Persist finalized documents verbatim | standard |
Full standard (constrained write scope by the compact template embedded in the main preset; for sub-agent use only) |
develop |
Actual construction, run tests, fix defects | Any available preset (default standard) |
Determined by the selected preset |
Common configuration for all four tools:
provider: spawn—only in-process spawn (the only one that supportsagentPreset);maxDepth: 1—sub-agents cannot delegate further;modelSelection: false,modelDiscovery: false—model routing is pinned by plugin settings, not exposed for model self-selection;- No
allowedAgentPresetsset; agentOptionscome from the same settings source of truth:childProvider/childModel/ optionalchildReasoningEffort.
recon / review / scribe always run under standard, with compact role constraints merged into the main preset and explicitly marked for sub-agent use only (to avoid extra internal presets appearing in the DSH host preset list); only develop switches based on settings. Internal ids like dev-plan are disabled in the developMode selector and runtime self-reference protection.
Main Window Behavior Contract¶
The main window persona (generated by preset.js) enforces these fixed rules:
- Never writes code itself: does not call
write/edit/apply_patch/pwsh/bash, does not directly modify the repository. - Defaults to planning and review only. Only when the user explicitly authorizes with phrases like “start work / build / fix / do it / begin implementation” may
developbe invoked; after authorization,developmust actually be called—merely writing/displaying a task brief or saying “ready to delegate” does not count as delegation. - Delegation facts are determined by tool invocations: the task brief is the
developprompt parameter, not a chat deliverable; only after the tool accepts it can you say “developer dispatched,” then end the turn and await the automatic completion notification. Ifdevelopis unavailable, the call fails, or no call occurred, you must honestly report “not delegated” with the reason—outputting a fake success flow summary is not permitted; rework must also actually invokesend_message. - First development is fixed with
name=developer; follow-ups, rework, and supplementary acceptance for the same task all usesend_messageto continue with the samedeveloper—do not repeatedly spawn new sub-agents. - Upon receiving a construction report, the main window first performs its own static review and evidence verification; only for high-risk changes or when independent review clearly adds value does it dispatch a separate
review; review findings are sent back viasend_messageto the samedeveloperfor rework—no dual-window buttons needed. - Only ask the user for scope expansion, unauthorized changes, or irreversible risks (data deletion, production config changes, force-pushing Git, modifying permissions/secrets, etc.); normal implementation details are decided by the developer within the task brief boundaries.
- Once the user has explicitly approved starting work through the main window, do not repeatedly request the same start authorization.
developandrework_task/ask_workermust not be used simultaneously for the same task; mixing the two channels causes duplicate dispatch.- The main window cannot treat sub-agent self-reports as its own test execution; when citing, it must explicitly state “per developer’s report.”
- The main window has no fs/search/Shell/Git tools: the developer’s completion report must include auditable actual change evidence (prefer real diffs; for new files/non-Git, provide before/after content or equivalent evidence). If only a summary or file list is provided, the main window must not claim to have reviewed actual diffs—it should first
send_messagethe same developer to supply evidence. - Construction directory is fixed at creation time: when dispatching
develop, the actual construction directory for this task must be passed in the tool parametercwd; it cannot be written only in the task brief, nor omitted to let the sub-agent inherit the current directory. - Check writable scope before delegating: if the target directory is outside the current session’s writable workspace, or writability cannot be confirmed, stop delegation and inform the user—do not create first and then try.
- No “create then cd”: it is not allowed to spawn in another directory first and then have the developer use
working_directory/cdto bypass permissions; sub-agent permissions are fixed at creation time, and post-hoc privilege escalation by the parent session does not expand existing sub-agent permissions. When new permissions are needed, stop and request the user/main window to handle it—do not repeatedly re-delegate; permission failures must record the actual cwd, sandbox mode, and real error.
The develop task brief must be self-contained. The complete template in docs/flow-redesign.md is the sole contract, containing at minimum:
Goal:
Non-goals:
Acceptance criteria:
Allowed modification paths:
Interfaces/dependencies:
Check commands:
Risks/rollback:
Definition of done:
Actual change evidence: real diff / before-and-after content / equivalent evidence; a file list alone is insufficient
Report format:
Construction reports must include: changes made, real commands and outputs, self-acceptance, risks, assumptions and unverified items, blockers, and actual change evidence. Sub-agents do not ask humans questions; when information is missing or conflicts with the task brief, list it separately in the report and stop related actions.
Process Efficiency (P0)¶
The 0.3.0 persona includes the P0 process contract; detailed development/acceptance documentation is in docs/flow-redesign.md. P0 itself adds no new settings, tools, or dependencies—it only changes how the main window and developer collaborate. The preset/model linkage and guarding scope added to the settings page belong to a separate approved change:
- Risk grading: Select fast path, standard path, or high-risk path based on ambiguity, impact scope, reversibility, and verifiability. The fast path reduces unnecessary recon, independent review, and documentation, but does not eliminate user start authorization, developer self-verification, or main window review.
- One-time start contract: Scope, non-goals, allowed paths, interfaces/dependencies, acceptance conditions, check commands, and risks/rollback are written clearly once; a single user approval covers the entire approved scope—normal implementation does not repeatedly wait for approval; only scope expansion, risk changes, or host permission requirements trigger re-confirmation.
- Acceptance prioritization and cost ordering: Minimal slice → syntax/static contract → targeted tests → necessary runtime/GUI acceptance; static checks do not equal real verification.
- Non-blocking collaboration: Relies on automatic completion notifications; the main window does not poll, busy-wait, duplicate construction, or repeatedly read files the developer is modifying; during waits, only non-conflicting work such as acceptance preparation or research is performed. The developer interrupts the main window only when blocked, on scope conflicts, or on critical contract decisions.
- Evidence-based reporting and severity-based rework: The developer reports real commands/results, verified/partial/failed or unverified items, risks and assumptions; the main window reviews actual diffs and critical evidence; blocking issues are sent via
send_messageto the same developer for rework; non-blocking suggestions are not polished indefinitely.
Explicitly out of scope: P1/P2 (controlled dual developers, persistent task cards, metrics, DAG/Team/heavy runtime), automatic model tier reduction, default dual developers. recon is invoked only when facts are missing; review only for high-risk or clearly needed cases; scribe only when documentation is part of acceptance or the user needs it; the main window’s final review responsibility is not outsourced.
Plugin Settings¶
Settings entry: Plugins → Installed → Development Planning & Delivery Mode → Included components → Click the plugin row title/right arrow. The settings page is registered at plugins.row.config, with key dsh-dev-plan-presets#dev-plan-presets; the entry label is determined by the host plugin page and may not display the word “Configure.”
Settings page fields:
| Field | Default | Meaning |
|---|---|---|
developMode |
standard |
Construction sub-agent preset: any host-registered preset; the settings page dropdown lists the real directory, with broken/self items disabled |
childProvider |
dsh-opencode-go |
Sub-agent provider shared by all four delegation tools; selected from the host directory on the settings page |
childModel |
deepseek-v4.1-flash |
Sub-agent model shared by all four delegation tools; linked selection follows the provider |
childReasoningEffort |
empty | Optional reasoning effort; empty string means omit this key |
modelGuardMode |
pin |
off / audit / pin |
killOnViolation |
true |
In pin mode, whether to reject + cancel + notify the parent session on violation |
honorExplicit |
false |
Whether to honor explicit non-parent routing at sub-agent creation time |
audit |
true |
Whether to write structured audit logs (routing and events only, no credentials) |
guardAllSubagents |
false |
By default only guards sub-agents dispatched from the dev-plan parent session; when checked, restores global sub-agent guarding |
mainToolMode |
ask-edit |
Main window tool permissions: ask-edit (default, small-scope read-only verification + allows read/edit/write for local micro-edits after explicit user consent in the current turn, never mounts Shell) / readonly (only glob/grep targeted search, cannot modify files) / none (pure planning and delegation, most economical for primary model quota) |
mainStepWarnThreshold |
6 |
Only effective when mainToolMode !== 'none' (integer 2..30): when consecutive steps in a single turn exceed the threshold, only a gentle reminder to hand off to a sub-agent is given; never select/cancel/reject the main session |
Save path: Client → Host /plugins/dev-plan-presets/config → strict validation (hand-written Standard Schema) → ctx.get('configEditor').edit(entry, ...) → write back to profile patch → Loader rebuilds the plugin. Do not manually edit the profile’s cordis.patch.yml, and do not write a separate config.json in the plugin directory. The settings page’s own read/display goes through /plugins/dev-plan-presets/state.
Configuration uses regular (non-volatile) fields: after saving, the plugin is rebuilt; cordis.patch.yml only mounts the root plugin, and presets are dynamically re-registered by the new apply. Existing sessions retain the old generation (registry revision semantics); to use new settings, create a new session. configEditor.edit writes to the profile patch and awaits reconcile; by the time save returns, rebuild/apply of the new configuration has been attempted—the frontend uses the read-back value as authoritative.
Settings Page Behavior & Security¶
- 404/network degradation: When the Host has not loaded the new version of the plugin or the
/stateroute is not registered, the page displays actionable guidance to “restart DSH and confirm the plugin row is enabled,” and stops automatic polling; manual “Refresh” triggers a retry, and the periodic read-back after saving also continues retrying after a brief 404 during HMR. When the Host cannot be connected to, it displays “Confirm DSH is running and the plugin is enabled, click Refresh to retry,” with the original error as mono secondary text. - Language & theme: Client follows the host’s
ctx.locale.getSnapshot().active(non-zh falls back to English), updating in real time after language switch; colors/borders/border-radius only use verified--dsw-alias-*/--dsw-radius-*and--ds-font-family-code; no hex/rgba values, no component library imports. - Write request origin/type:
POST /configonly acceptsapplication/json(charset allowed), otherwise 415;Sec-Fetch-Site: cross-siteor Origin inconsistent with the request Host /webServer.getOrigin()actual listening origin returns 403 (127.0.0.1 / localhost / [::1] on the same port are treated as limited equivalents); same-origin and non-browser clients without Origin are allowed. Reverse proxy scenarios that rewrite Host/Origin are not supported in this release—the authoritative listening address must be maintained. Rejected requests do not invokeconfigEditor. - Error localization: Host returns stable
codevalues (e.g.,invalid-config,config-editor-unavailable,forbidden-origin,unsupported-media-type); Client localizes common errors by code and validation path; unknown errors retain the original fallback. - Directory status: The preset dropdown comes from
/state.presets(includingbrokenand its own id); the model dropdown comes from/state.modelCatalog(provider-linked, single provider failures go intofailures). Independent prompts exist for directory loading, empty, partial failure, and stale values not in the directory—and none auto-save. - Guard unmount: Each sub-agent’s
agent/pre-stepguard is tracked by the disposer held by the plugin; plugin HMR/unmount unbindsagent/crea… (truncated)
Development Sub-Agent: Selecting from Host Presets¶
The sub-agent preset for the develop tool is determined by developMode on the settings page, defaulting to standard. The settings page fetches the real directory from the host’s registered preset list; broken items or its own id are disabled. Sub-agent configuration is uniformly managed via childProvider / childModel / optional childReasoningEffort, not exposed for model self-selection. The development sub-agent runs in-process spawn with maxDepth=1, sharing the same sub-agent model routing as the main window.
Model Guarding¶
Model guarding by default only manages sub-agents dispatched from “Development Planning & Delivery” sessions; the main session is never guarded. The guarding mode is determined by modelGuardMode:
off: Guarding disabled; sub-agents can freely select their model.audit: Only records model routing events; does not reject violations.pin: Rejects violations and cancels the sub-agent, simultaneously notifying the parent session (killOnViolationdetermines whether to also cancel).
When guardAllSubagents is checked, the guarding scope extends to all sub-agents, including those dispatched by other presets. Guarding is implemented via the agent/pre-step hook; each sub-agent’s guard is tracked by the disposer held by the plugin; plugin HMR/unmount unbinds the relevant hooks.
Migration: From dsh-subagent-model-pin¶
This package’s 0.3.0 added model guarding and the settings page, overlapping in functionality with dsh-subagent-model-pin. During migration, disable the old plugin in the host configuration, enable this package, and set the same childProvider / childModel / modelGuardMode. Fields from the old plugin such as allowedAgentPresets have no direct equivalent on the settings page; guarding behavior is controlled through the combination of modelGuardMode + killOnViolation + guardAllSubagents.
Architecture & Implementation¶
This package is a DSH bundle, dynamically registering presets in the host via dsh.bundle.patch and registering the settings page via dsh.client. The main window preset (dev-plan) is generated by preset.js; the internal preset id is dev-plan, the plugin manager display name is “Development Planning & Delivery,” and the preset name is also “Development Planning & Delivery.” The sub-agent preset is fixed to standard, but the actual behavior of develop is determined by the host’s registered preset.
The main window persona is streamlined to ≤ 6,000 characters, merging compact recon/review/scribe constraints into the main preset and explicitly marking them for sub-agent use only, without exposing extra sub-preset options in the DSH preset list. 0.4.0 adds the optional controlled mainToolMode (none / readonly / ask-edit, never mounting Shell) and the step-count warning threshold mainStepWarnThreshold; the settings page now uses stateVersion/stateTag + ETag 304 with 700ms/30s adaptive polling and directory idle prewarming.
Known Limitations¶
- The main window does not mount Shell;
developrelies on the sub-agent providing shell capability; if the host preset lacks shell tools, construction is limited. - The settings page requires
webServerandconfigEditorservices; if missing, 404 or 503 will appear, but Host startup will not fail. - Settings page save depends on the host’s
configEditor.edit; if the host implementation is incomplete, save may fail. - During plugin HMR, relevant hooks are unbound; guarding may be briefly unstable.
- The main window does not directly modify files; all changes must be completed through sub-agent tools; the main window cannot bypass sub-agents to directly operate the file system.
Verification¶
After installation, create a new session and select “Development Planning & Delivery.” Try to have the main window delegate, review, and rework; observe whether the main window complies with the behavior contract (does not directly call write/edit/apply_patch/pwsh/bash, only delegates through the develop tool). Adjust developMode/childProvider/childModel/modelGuardMode on the settings page, save, then create a new session to verify the new configuration takes effect. Use mainToolMode to switch the main window’s tool permissions and observe behavioral differences under read-only, small-scope editing, and no-tool modes.
Development¶
This package is a standard JavaScript module with zero runtime dependencies. The verification script is node scripts/verify-presets.mjs; the test script is node --test --experimental-test-isolation=none. Source code is in the GitHub repository, maintained by hongcha-dsh.
License¶
MIT
References¶
- Plugin directory page: https://www.skillhub.cn/plugins/hongcha-dsh/dsh-dev-plan-presets
- GitHub repository: https://github.com/hongcha-dsh/dsh-dev-plan-presets