Skip to main content

dsh-task-control

4Stars0Forks0Issues0Watchers

Adds pause, resume, and cancel capabilities to DSH Web dialogue tasks, supporting two pause granularity levels (safe and forced), with resume continuing from the pause point without redoing completed work.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
dsh-plugin

Install

cmdweb profile
$ dsh plugin --profile web add dsh-task-control

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin p2coder/dsh-task-control for me: review the repository at https://github.com/p2coder/dsh-task-control first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Description

Adds pause, resume, and cancel control capabilities for conversation tasks in DSH Web. When AI is executing a long task, you can pause it midway (preserving all execution progress), resume later from the pause point, or immediately cancel the current turn.

Core Features

  • Pause task: Supports safe pause (waits for inference/tool to complete naturally before landing) and forced pause (immediately interrupts in-flight tools and model outputs)
  • Resume task: Continues from the pause point without redoing already completed work
  • Cancel task: Immediately terminates the current turn and prompts about the interrupted tool's intended purpose and potential side effects
  • Pause granularity settings: Configure default pause mode and inference granularity for safe pause (wait/stop) in Web settings page; takes effect immediately after saving
  • State persistence: Each session's pause state is written to a local file, surviving dsh web restarts
  • Available for other plugins: Provides programmatic interface via taskControl service by session ID
  • Three entry points: Permanent buttons next to the input box, slash commands (/pause /resume /cancel), and service calls from other plugins

Technical Implementation

  • Language: TypeScript / JavaScript (compiled output)
  • Key dependencies: @deepseek-ai/cordis, @deepseek-ai/dsh-llm, @deepseek-ai/dsh-client-ui-primitives, react
  • Architecture pattern: Host/Client dual-sided plugin. Host side registers slash commands, session event listeners, taskControl service, and two HTTP routes via cordis bundle.patch; Client side injects runtime/locale/ui-settings/conversation services provided by the host via package.json#dsh.client.inject, renders buttons in composer toolbar and granularity config panel in settings page
  • Entry files: lib/index.js (host) + lib/client.js (browser) + cordis.patch.yml

Use Cases

Suitable for scenarios requiring management of long-running tasks in DSH Web: when AI is running a large migration, batch testing, or multi-step tool calls, you may want to pause to switch context, or immediately cancel a task that has gone off track. After installation, no complex configuration is needed—three permanent buttons appear next to the input box, and slash commands are also directly callable.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DSH Web>= 0.1.0-rc.6Inferred from multiple @deepseek-ai/dsh-* packages in peerDependencies
React^18.2.0Client-side rendering dependency
@deepseek-ai/cordis^4.0.1Host-side framework
NodeNot declaredpackage.json does not declare engines field
PlatformCross-platformUses only Node built-in fs / path modules

Installation

dsh plugin --profile web add github:p2coder/dsh-task-control

After installation, please fully restart dsh web and refresh the browser.

Configuration Options

ConfigTypeDescriptionDefault Value
Default pause modeEnum: safe / force/pause without explicit mode and pause button in input box both execute in this mode; safe waits for inference/tool to complete before landing, force immediately interruptssafe
Inference granularity for safe pauseEnum: wait / stopEffective when default mode is safe; wait pauses after current inference completes, stop immediately terminates current model outputwait
Task control state archive directoryPathEach session's pause snapshot is written to this directory using atomic tmp+rename; can be overridden via environment variable DSH_TASK_CONTROL_STATE_DIR~/.dsh/task-control

Configuration entry is in Web settings page "Settings → Task Control", or can be directly modified via /task-control/settings JSON interface.

FAQ

Q: Do I need to restart after installation?

A: Yes. As described in README and patch, you must fully restart dsh web and refresh the browser for cordis bundle patch and client-side injection to take effect; refreshing only the page will load the old UI.

Q: What's the difference between pause and the official "stop" button?

A: The official "stop" button directly terminates the current turn with state lost; this plugin's "pause" preserves all execution progress and writes to local archive. When resuming, it continues from the pause point without redoing completed work.

Q: Will forced pause break tools being executed?

A: Yes. Any in-flight tools will be immediately interrupted, potentially causing partial side effects. When resuming, the plugin will show a selection menu letting you decide whether to re-execute, skip, or keep paused.

Q: Where is pause state saved? Will it be lost after restart?

A: Saved in ~/.dsh/task-control/ under user directory, one JSON file per session, using atomic tmp+rename write. It will not be lost after dsh web restarts. During testing, you can change the path via environment variable DSH_TASK_CONTROL_STATE_DIR.

Q: Can other plugins call task control?

A: Yes. Host side registers taskControl service. Other plugins can obtain it via ctx.get("taskControl") and call pause / resume / cancel / state four methods by session ID.

Q: Will timed reminders trigger during pause?

A: Yes. When dsh-schedule is due, it will still wake up the current session. Pause only controls the current turn and does not intercept timed events.

Q: Will sub-agents be paused together?

A: No. Already dispatched sub-agents run independently and will not pause with the parent task.

Q: What needs to be done after modifying plugin code?

A: Need to reload the plugin and restart dsh web. Client polls status every 2 seconds; without restart, the browser will still get the old version.

Difficulty Level

Beginner — only one installation command required, no mandatory configuration; buttons next to input box and slash commands work out of the box; advanced users can then tune pause granularity.

Known Issues & Limitations

  • Forced pause immediately interrupts in-flight tools; tool side effect state is unknown. When resuming, user must manually choose to re-execute or skip (lib/index.js:303-310, 545-572)
  • Pause state is stored as independent JSON files locally rather than in session log: source code explicitly states harness's persistence reader only accepts known event types, writing task-control/* events to session would cause failure to load after session restart, therefore external storage is used (lib/index.js:42-50)
  • Pause only controls the current turn; sending new messages during pause starts a new turn (README.md:81)
  • In safe wait mode, pause occurs after inference completes but before tool dispatch, recording deferredTools. When resuming, user must confirm whether to re-execute or skip (lib/index.js:484-526, 640-641)
  • Dispatched sub-agents are not paused by parent task; behavior is independent (README.md:83)
  • Browser polls /task-control/state every 2 seconds; state sync has up to 2 seconds delay (lib/client.js:195-198)
  • Plugin hot-unload must deregister /task-control route via ctx.effect, otherwise webserver throws "duplicate prefix route" (lib/index.js:828-834)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/p2coder/dsh-task-control)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory