DSH Plugin: Tool Toggles and the Plan-Act Method

Introduction

DeepSeek Harness’s (DSH) plugin architecture lets developers extend capabilities on demand. However, for context-constrained small models like local 9B-class ones, every request must carry the full schema of all registered tools, easily introducing too much noise in a single turn. At the same time, dumping a long task onto the model in one go tends to produce “big and broad” reasoning that actually lowers quality.

hawkqiang/dsh-tool-slice adds two layers on top of DSH: a per-conversation tool toggle layer, and a “discuss first, then break into steps, with each step executed by a sub-agent” plan-act workflow. The former saves tokens by slimming down the tool table; the latter reduces per-step complexity by decomposing tasks.

Plugin Overview

This is a workflow-style DSH plugin maintained by hawkqiang. It adds two things to DSH:

  • Tool toggles: a per-conversation, checkable tool list with scenarios and defaults, reducing unnecessary tool schema transmission.
  • Plan-act workflow: break a task into small step-by-step plans, then execute each step via a sub-agent with restricted model and tool scope, so a local small model does only one small thing at a time.

The plugin provides a /slice command series, a sidebar plan file, a control panel beside the conversation, and “task” cards mirrored from the plan.

Installation & Activation

  1. In DSH, go to Plugins → Add plugin → Local directory and select the dsh-tool-slice directory.
  2. In the plugin list, confirm two entries: tool-slice (Host, tool toggles) and the plan-act preset row (plan-act workflow), and make sure both are enabled.
  3. Refresh the page (frontend plugins assemble on load), start a new session, and you’ll see 「plan-act」 in the preset selector. Existing sessions are unaffected.

After modifying plugin code, you must restart DSH to load new modules (HMR does not watch the module root by default). The new conversation panel and /slice commands require this restart; a page refresh will show the plugin card but not the panel.

Tool Toggles: Per-Conversation Persistence

Below the input box there is a slim control bar that doesn’t occupy the main content area. Clicking it opens the toggle checklist for this conversation: a scenario selector at the top, grouped checkboxes in the middle (searchable, toggle-all-per-group, toggle all on/off), and fixed Save / Revert buttons at the bottom.

Save & Revert

Checking boxes is just a draft: try a combination, look at the token estimate, then decide whether to commit. Clicking 「Save for this conversation」 at the bottom writes it in; 「Revert」 restores the last saved state.

Per-Conversation Isolation

Toggles are saved per conversation with the following rules:

  • If you’ve saved in a conversation → that conversation uses only its own list, with 「This conversation only」 shown in the title;
  • If you haven’t saved → it uses the default list, shown as 「Follow default」;
  • To discard this conversation’s custom list, click 「Follow default»; the entry for that conversation is removed from the state file.

So turning off tools in conversation A won’t affect conversation B; sub-agents launched by step_run follow the toggles of the conversation they belong to.

New Session Defaults & Scenarios

A new session has no messages when created; DSH renders the input box in “hero” layout, where tool chips don’t appear below the input. The plugin registers a 「Default tools」 chip in the hero layout: as soon as the session is created you can open it and check the default toggles (the shared default list for all conversations). After sending the first message, the chip becomes the per-conversation 「Tools」 chip.

At the bottom of the panel there is also a 「Save as default」 button: at any time you can save the current toggle set as the default, so all future new conversations start from it; the current conversation’s own list is unaffected.

The tool list comes from globally registered tools, so in a new session or right after a DSH restart (before any step has run), the panel can immediately list tools and allow checking.

Scenario Management

A scenario is a named set of tool toggles; you can create and select them directly in the panel:

  1. Check the toggle combination you want;
  2. In the “Name this toggle set…” field, enter a name (e.g., “Coding”), then click 「Save as scenario」 — it’s saved immediately and visible across all conversations;
  3. In any conversation, open the panel and select it from the top 「Scenarios」 dropdown → the full toggle set loads into the draft → click “Save for this conversation.”

The dropdown also includes three built-in scenarios (computed in real time from tool groups): Coding (off: web / Office / scheduled tasks), Research (off: terminal / Office), Minimal (only: read/write files, search, todo, ask). If your saved scenario shares a name with a built-in one, yours takes precedence.

When you select a saved scenario, a 「Delete」 button appears next to the dropdown, removing that definition (without affecting toggles already saved in any conversation).

Plugins → This plugin → Config card "Tool Toggles · Defaults & Scenarios" is the full-version editor: it modifies defaults, so “select a scenario in the page + click ‘Save default’” means all conversations that haven’t set their own will use this toggle set.

Saved state lives in %DSH_PROFILE_DIR%\tool-slice.json (typically C:\Users\<you>\.dsh\profiles\desktop\tool-slice.json); you can edit it directly:

{
  "version": 2,
  "revision": 7,
  "hidden": ["web_search", "office_render"],
  "scenarios": [{ "name": "Coding", "hidden": ["web_search", "office_render"], "note": "" }],
  "sessions": {
    "s-9f3c1a2b": { "hidden": ["pwsh", "web_fetch"], "updatedAt": "2026-11-20T22:40:00.000Z" }
  }
}

hidden is the default list; each session in sessions has its own (up to 200 kept, oldest by update time evicted). Old-version files with only sets are still readable and treated as scenarios.

Hand-editing this file also works: the next model step recalculates the tool table based on the new content, no restart needed. If the file is corrupted, the last valid list is retained and the session won’t error.

Scope: all agents, including sessions already running before activation (from the next step onward) and sub-agents launched by step_run.

The list is only readable after a session has created an agent: DSH’s tool table is assembled per preset, and the page must see a real session’s tool set first; if the card shows no list yet, click “Refresh list.”

Plan-Act Workflow: Plan → Set Model & Tools → Confirm → Execute

The plan is discussed into existence, and “which model for which step, which tools are allowed, when to actually start” are all set by you in the panel. The full chain is:

  1. Discuss first. If your goal has ambiguities, the model first uses ask_user_question to ask 1–3 key questions (scope, boundaries, acceptance criteria, which files may be touched) instead of guessing.
  2. Then plan (plan). After clarifying, it calls plan_options to get the currently available model list and three-tier access descriptions, then uses plan_write to break the task into 3–8 very small steps. Each step carries two things:
    - model: which sub-model executes this step (provider/model-id; empty = inherit from parent session);
    - access: how much access this step gets — Read-only / Read-write / Full (Read-only = no file modification, no commands; Read-write = can modify files but no terminal, no network; Full = unrestricted).
    The plan is written to <workspace>\.dsh\plans\plan-<session-suffix>.md (previewable directly in the sidebar as Markdown).
  3. Stop and wait for confirmation. After writing the plan, the model stops — it recaps key points in no more than 8 lines (including each step’s model and access). The plan is now in an unconfirmed state.
  4. You review / adjust each step. Click “Plan” below the input → “Set N steps”; each step is one row:
    - Access tier (Read-only / Read-write / Full, set during planning) or “Custom −N” (you’ve checked individually);
    - Model dropdown: lists currently available providers/models in DSH, defaulting to “Inherit parent session”;
    - Tools button: check the tools allowed for this step (uncheck = disable that tool for this step). Individual checking replaces the tier with a custom list.
    These two columns are written into the plan file; step_run executes the step strictly based on these final values.
  5. Click “Confirm plan.” This is a hard gate: before confirmation, any step_run call is rejected outright (error: “This plan has not been confirmed”), and no sub-agent can be launched. Only after confirmation can the model execute.
  6. Execute step by step (act). Each step is handed to a brand-new sub-agent using the model you chose, with only the allowed tools; the parent session only receives “this step’s report + next step.” Three ways to drive it: click “Execute next step” yourself, type /slice next, or after confirmation tell the model “start.”
  7. Revise the plan. If you have objections, write them in “Send to model for revision”; the model rewrites the entire plan — completed steps, reports, and the models/tools you set for each step are all preserved — but the plan returns to unconfirmed state and needs another confirmation click.
  8. When all steps are done, the model summarizes in 5–10 lines.

The parent session’s context is thus: a fixed prompt + a few hundred tokens per step, rather than the entire work history. The plan file is the single source of truth; a mid-run restart can pick up where it left off.

Plan File Example

# Task: Migrate login from session to JWT and add refresh

- Session: s-test1234
- Created: 2026-11-20 23:30
- Progress: 1/3 done
- Confirmed: 2026-11-20 23:41

## Steps

### 1. Audit issuance points —— Done
What: Read src/auth, list all issuance and verification points
Done when: List provided
Access: Read-only
Model: local/Qwen3.8-9B-Q6_K

### 2. Implement issuance —— In progress
What: Sign access+refresh in the login route
Done when: Unit tests pass
Access: Read-write
Model: qiafan/glm-5.3-flash
Started: 2026-11-21 00:51

### 3. Run integration tests —— Pending
What: Run pytest and fix failing cases
Done when: All green
Access: Full
Depends on: 2

## Log

### Step 1 —— Done

Found 4 issuance points: login.ts / refresh.ts / middleware.ts / test/auth.ts

### Step 4 —— Cancelled

Cancelled (aborted): user stopped

Key field notes:

  • - Confirmed: when empty (written as Unconfirmed), step_run is always rejected; any plan_write rewrite clears it.
  • Access: one of three tiers; at execution time it expands into the specific disabled list of tools actually mounted for that preset; omitted = Full.
  • Model: omitted = inherit parent session; format is provider/model-id.
  • Started: appears only on the currently executing step: step_run writes it before launching the sub-agent, so if the process crashes or DSH restarts, you can tell a step was “stuck in progress” rather than actually running. Completion (success or failure) clears it.
  • Depends on: step numbers that “must be completed before this one runs.” Steps whose dependencies aren’t met won’t be auto-selected and won’t be pulled into “parallel execution.” You can also add/remove dependencies by hand-editing this file.
  • Five states: Pending / In progress / Done / Failed / Cancelled. A stopped step is Cancelled, and like Failed it can be re-run by the next step.
  • Disabled tools: a, b appears on a step where you’ve checked individually (at which point Access: is cleared, since a coarse tier can’t describe a custom list).
  • All these fields can be hand-edited directly; the panel will show the edited values on next read.

Plan Panel Beside the Conversation

The “Plan 3/8” panel doesn’t wait for the model to call a tool; a human can drive it directly:

  • Plan chip: Plan 1/6 · Step 2 · glm-5.3-flash — persistent below the input box, showing which step is next and which model without opening the panel.
  • Unified step settings (panel top): one access-tier dropdown + one tool checkbox (“Tools −N”) + three buttons:
  • Apply to all steps: write this access/tool set to all incomplete steps in one go (completed steps are untouched);
  • Set as default: save as this profile’s default. Future plan_write new steps without an explicit access will start from this default (actually recorded in the plan file, not just displayed);
  • Collapse: fold this section, leaving a one-line summary (“Current unified setting: Read-only · 3 tools disabled” + expand button).
  • “Task” cards in the conversation: plan-act mirrors the plan into session todo events (todo/write), so the “Tasks · 1 in progress · 3 pending” card above the big dialog updates with each step: after planning it shows 4 Pending, a step starting becomes In progress, finishing becomes Done. This is a built-in DSH card; no need to open the small panel.
  • Real-time log + cost per step: whenever a step is running, the panel shows “Step N · Executing,” displaying the sub-agent’s 🔧 tool calls, ✓/✗ tool results, 💬 its messages (from the sub-agent’s own session event stream) line by line; each line also shows Output 1.2k tok · 12.3 tok/s · 1 min 40 sec. A finished step immediately disappears from the small panel: its trace is already in the conversation; the panel only retains “what’s running now.”
  • The same trace also goes into the conversation: in each step_run result, after the report body follows a full “Step N · Sub-agent full trace” section, so in the big dialog you can read exactly what this sub-agent did from start to finish without opening the panel.
  • Auto-run remaining N steps sequentially: after confirming the plan, click this and the model will continuously call step_run to finish all remaining steps without you clicking after each one; each step’s report still lands in the conversation (that’s where you read results). To stop, click “Stop all” or /slice stop; completed steps are kept, unrun ones stay as-is.
  • Confirm plan / Unconfirm: the only switch that allows step_run (equivalent to /slice approve / /slice unapprove).
  • Each step’s list is expanded by default: each row = number, status (Pending / In progress / Done / Failed / Cancelled, each in a different color), title, access tier, model dropdown, tools button; steps with dependencies show Depends on 1,3 after them. The values the model set during planning are right here — no need to hunt through other buttons.
  • Execute next step / Re-run step N: disabled when unconfirmed; when the current step isn’t “Pending,” the button becomes “Re-run step N” (use it to continue after failure, cancellation, a crash, or a restart). Which model, which access, and when it starts are all shown in the current-step row at the panel top and in the plan file.
  • Parallel execution: N steps ready: appears when ≥2 steps have all dependencies met. Clicking it = you confirm this batch can run simultaneously (equivalent to /slice parallel). Steps with unmet dependencies won’t be pulled in.
  • Stop all: appears when a step is running (or this session has a plan in progress); clicking is equivalent to /slice stop: all running sub-agents are cancelled, steps marked as “Cancelled” — not Done, can be “re-run” or “re-planned” later. It only stops this session’s plan, not the model’s current turn.
  • Start planning: write a desired outcome and click it, equivalent to /slice plan <goal> — the model asks questions first, then decomposes, and stops after writing.
  • Send to model for revision: equivalent to /slice revise <feedback>; the model rewrites the plan, completed steps and your model/access settings are preserved, then re-confirmation is needed.

Each change to the plan file adds a line - Revision: time (vN) in the header, so you can tell which version it is.

/slice Commands

The same chain is available in the input box (findable in the + menu’s command list):

Syntax Effect
/slice or /slice show Report progress, confirmation state, current step, and all steps (including each step’s model)
/slice approve (or /slice 确认) Confirm the plan, unlock step_run
/slice unapprove (or /slice 取消确认) Revoke confirmation, step_run is rejected again
/slice next or /slice next 3 Execute the next incomplete step / a specific step 3 (requires prior confirmation)
/slice parallel Execute all steps whose dependencies are met simultaneously (requires prior confirmation)
/slice auto (or /slice 顺次) Let the model auto-run remaining steps sequentially without pausing between steps to ask (requires prior confirmation)
/slice stop Cancel this session’s running step, mark as “Cancelled” (does not end the model’s current turn)
/slice plan <goal> Start discussion: let the model clarify first, then write the plan, and stop after
/slice revise <feedback> Pass revision feedback to the model to rewrite the plan (completed steps preserved)

Command results only appear in the hint above the input box and do not enter the model context; only plan and revise append a user message.

The session → plan file mapping is stored in %DSH_PROFILE_DIR%\tool-slice-plans.json (up to 40 sessions kept); the panel reads only this index, so even after a page refresh or when no model is running, you can check progress, adjust settings, and confirm the plan.

Tools Mounted by the Plan-Act Preset

The plan-act preset mounts the following tools:

pwsh (bash on non-Windows), read/write/edit, glob/grep, jobs, web_search/web_fetch, todo_write, ask_user_question, plan_options/plan_write/step_run, plus a compression group (threshold lower than standard presets).

Not mounted: Office, sub-agent tools, skill directory, plan mode, workflow, schedule…

Use Cases & Notes

Who it’s for:

  • Developers using context-constrained local 9B-class models who want to reduce per-turn noise;
  • Developers who need to decompose long tasks into executable steps and control model & tools per step;
  • Users who want per-conversation tool toggles, scenarios, and defaults.

Notes:

  • The plugin runs with the current DSH process’s permissions; review the source code and license before installing;
  • Local directory installation requires manually selecting the directory; do not use name-based dsh plugin add github:owner/repo commands;
  • After modifying plugin code, restart DSH to load new modules.

Short Conclusion

Tool toggles let a local small model stay focused on each request; the plan-act workflow breaks long tasks into small steps, each executed by a sub-agent with restricted model and tools. Together, they keep local models producing high-quality output within a limited context.

  • Directory page: https://www.skillhub.cn/plugins/hawkqiang/dsh-tool-slice
  • GitHub: https://github.com/hawkqiang/dsh-tool-slice
羽毛球分组比赛记分
小程序二维码

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

Xiaoye