返回目录
模型与 MCP 插件

dsh-pause-button

trammels51/dsh-pause-button

Minimal pause/resume button beside the DSH composer, with safe step-boundary pause and breakpoint resume.

Stars
0
Forks
0
Issues
0
更新
8 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:trammels51/dsh-pause-button

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-pause-button

English | 中文

A minimal pause/resume control beside the DSH composer, plus /pause and /resume commands.

Pause button design preview

The button is 28 × 28 px, icon-only, borderless, and inherits the composer tool-row color. It stays at 68% opacity while running, uses one low-saturation blue only when paused, pulses while a safe pause is pending, and fades to 26% when there is no running task. It sits in conversation.input.right, immediately left of Send.

What pause guarantees

  • While paused, no new model request is issued. Instant pause cancels the in-flight request; safe pause holds before the next agent/pre-step.
  • Completed work is never replayed. Resume continues from the durable conversation and the retained partial output.
  • Safe pause also holds live in-process subagents at their own pre-step boundaries. Instant pause cancels the addressed turn; child tool calls bound to that turn are aborted by the runtime.
  • A paused session also gates a brand-new turn, including an automatic goal round or a queued prompt, until you resume.

There is one unavoidable cost: DSH model APIs are stateless. Resuming after an instant pause must send the conversation context again, so it costs one request's prompt tokens. The model continues from the checkpoint rather than from the beginning, and completed tool calls/steps are not repeated. Safe resume does not send an extra message.

Pause modes

Instant (default, force / stop / instant)

  • Calls agent.cancel({ kind: 'user' }, { keepInbox: true }) immediately: the current model stream and running tools stop now.
  • The partial assistant output and every completed tool result remain in the session.
  • Resume sends one continuation prompt asking the model to continue from the interruption, not to redo finished work.

Safe (safe / wait)

  • The current step (including a running tool) is allowed to finish.
  • The next agent/pre-step is held at its very start, before compaction, context snapshots, or any other listener can issue a model request.
  • Resume releases that exact boundary and runs pre-step preparation once, continuing the same turn without a continuation message. This is the lowest-token resume path, at the cost of waiting for the current step.

Install

Requires DSH 0.2.2-rc.1 through 0.2.x.

From GitHub:

dsh plugin --profile web add github:trammels51/dsh-pause-button

Or from the prebuilt release tarball:

dsh plugin --profile web add https://github.com/trammels51/dsh-pause-button/releases/latest/download/dsh-pause-button.tgz

Refresh the Web page if the button does not appear after installation.

Commands

Command Action
/pause Pause using the configured default (instant by default)
/pause instant / /pause force / /pause stop Stop thinking and tools now, overriding the default
/pause safe / /pause wait Wait for the current step, then hold the next boundary
/pause status Show phase, current mode, and default mode
/pause resume Same as /resume
/resume Resume the paused session and any subagents held by a safe pause

/pause force also escalates a pending safe pause instead of being a no-op.

Settings

Open Settings → General → Pause granularity:

  • Instant (stop) — stop the current thinking/tools now; resume continues from the breakpoint with one context resend.
  • Safe (wait) — finish the current step, then stop; no model requests while paused, and resume continues in place.

The choice is stored in $DSH_HOME/dsh-pause.json. The composer button and bare /pause follow it; /pause safe or /pause instant overrides it once.

Implementation

  • Host half — lib/index.js
    • Registers /dsh-pause/state, /pause, /resume, and /config routes.
    • The safe-pause agent/pre-step listener is prepended and holds before next(), so downstream compaction or context listeners cannot run while paused.
    • Instant pause cancels the active turn, retains history, and resumes with one continuation prompt.
    • Safe pause recursively holds live descendants reported by ctx.agents.isOwnedBy; a paused session gates new turns.
    • Registers /pause and /resume through ctx.commands.
  • Browser half — lib/client.js
    • A hand-written window.__ModuleLoader__.load bundle using the official conversation.input.right and settings.general.item slots.
    • Polls the current Session state every 900 ms and pauses polling while the page is hidden.
    • Requires only the platform-provided react; no extra npm dependency.

Verification

npm test runs both suites:

  • test/host.test.mjs — instant default, cancel + continuation, safe hold before next(), safe resume with no extra prompt, subagent pause/resume, new-turn gating, settings writes, origin fence, and force escalation.
  • test/client.test.mjs — bundle exports, both slot registrations, and the pause-state source shape.

Limitations

  • Safe pause covers the addressed Agent and its live in-process descendants. Instant pause aborts the addressed turn and its bound child calls; separate-process or remote subagents cannot be reached.
  • Instant resume still needs one new model request (context resend), because the provider stream is not resumable. Completed steps are not re-run.
  • During a safe pause the Agent status remains running because the same turn is held. Stop/cancel releases the hold and ends that turn.
  • Requires the Web host services webServer and agents; it is not a headless/ACP plugin.

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。