Sessions & Messages

dsh-task-control

p2coder/dsh-task-control · ★ 9

p2coderCurated

Pause / resume / cancel the in-flight conversation task from the composer area: forced pause interrupts immediately and remembers the interrupted tool, safe pause lands after the tool or reasoning finishes, resume asks for confirmation, and the default pause granularity is configurable in the settings.

License
MIT
Added
2026-08-16
Maintenance
active
Install kind
github
Manifest details
Manifest status
Declared
Manifest path
package.json#dsh
Manifest checked
2026-08-19
Lifecycle scripts
None found

Static manifest checks report declarations only; they are not compatibility or security review.

安装

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

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: en · Read Chinese README

Table of contents
  1. Installation
  2. Quick start
  3. Pause modes
  4. Commands
  5. Plugin API
  6. Notes
  7. Test

English | 中文

Adds task pause, resume, and cancel controls to DSH Web. Supports safe and force pause, then resumes from the pause point without repeating completed work.

Compatible with DSH v0.1.x and v0.2.x.

Installation

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

After installation, fully restart dsh web, then refresh the browser.

Quick start

Three persistent buttons appear beside the input box while a task is running:

Button Action Available when
⏸ Pause Pause using the configured default Running
▶ Resume Continue from the pause point Paused
⏹ Cancel Stop the current turn immediately Running or paused

Gray buttons are unavailable; dark buttons are clickable.

Location and states of the Pause, Resume, and Cancel buttons

Pause modes

Mode Behavior Best for
safe wait (default) Waits for reasoning and tools to finish naturally Long tasks, migrations, tests
safe stop Waits for tools, but may interrupt current reasoning Faster pauses
force Immediately interrupts reasoning and in-flight tools Emergencies

Change the default under Settings → Task control. Saving applies it immediately:

Steps for configuring task pause granularity

Commands

Command Description
/pause Pause using the configured default
/pause force Force pause
/pause safe wait Safe pause without interrupting reasoning
/pause safe stop Safe pause that may interrupt reasoning
/resume Resume the task
/resume confirm rerun Re-run an interrupted or deferred tool, then resume
/resume confirm skip Skip that tool, then resume
/cancel Cancel the current turn

Using task controls with a slash command

Plugin API

Get the service with ctx.get("taskControl"):

API Action
pause(sessionId, options?) Pause a task
resume(sessionId, options?) Resume a task
cancel(sessionId) Cancel a task
state(sessionId) Read idle, running, or offline status and pause details

Pause state is stored under ~/.dsh/task-control/ and survives restarts. Tests can override the directory with DSH_TASK_CONTROL_STATE_DIR.

Notes

Situation Behavior
Force pause A tool may have partial side effects; choose re-run, skip, or stay paused before resuming
Deferred tools under safe wait Resume requires choosing re-run or skip
New messages while paused Start a new turn; pause controls only the current turn
Scheduled reminders Due dsh-schedule reminders still wake the session
Subagents Already-dispatched subagents are not interrupted with the parent
State sync The browser polls every 2 seconds; restart dsh web after plugin changes

Test

node test/host-smoke.mjs