dsh-task-progress: A Real-time Progress Channel for DSH Long-running Tasks

Introduction

When running builds, tests, or batch scripts using pwsh or bash within DeepSeek Harness (DSH), a specific observability issue arises: output from foreground commands often appears all at once only after the process finishes, while background tasks leave their output trailing after the model-side job_output cursor. Although the task list in the session header shows status, it doesn’t reveal what the script is actually doing. A command that runs for ten minutes remains a black box to someone watching the Web interface.

The following introduces the community plugin dsh-task-progress (maintained by chen8923, categorized as a client). It does not add new tools to DSH; instead, it allows scripts to write structured progress to workspace files, which the Web UI reads and displays via an overlay, a “Task progress” tab in the right sidebar, and a settings page—eliminating the need to poll the agent or wait for commands to finish.

What is this

dsh-task-progress is currently at version 0.3.0, licensed under MIT, and the npm package name matches the GitHub repository name (dsh-task-progress / chen8923/dsh-task-progress). Its positioning can be summarized as a dedicated secondary channel for long-running tasks—the producer appends events to a JSONL file, the host process polls and exposes the state, and the browser semi-periodically fetches the same snapshot to draw progress bars, messages, elapsed time, and ETA on the interface.

The plugin relies on the Web profile (requiring webServer, connection, shellEnv on the host side; and slots, locale, sidebarRightTabs on the browser side). In configurations missing these integration points (seams), the plugin remains unloaded and has no impact on existing behavior. Build and validation were performed against @deepseek-ai/dsh 0.1.7-rc.1; the plugin itself requires Node 20+.

Core Features

Based on the positioning above, the verified capabilities can be broken down into several sections:

  1. Shell Environment Injection: Every model shell call associated with a session receives DSH_PROGRESS_DIR (the progress file directory); if the bundled CLI is available, DSH_PROGRESS_CLI is also set.
  2. Web Display: The same set of states appears in an overlay (clickable to expand) and the Task progress / 任务进度 tab in the right sidebar; the settings page provides adjustable items such as scan interval, poll interval, and task limits.
  3. HTTP State Endpoint: Same-origin GET/HEAD /plugins/task-progress/state, fenced by DSH’s connection.requestRejection. It serves only the current session at a time, and the response does not contain filesystem paths.
  4. Job Mirror Lines: Background tasks that do not actively report will still display a line (command label, runtime, termination method, etc.). This data comes from DSH’s built-in job mirror, not routed through this plugin; false percentages will not appear when there is no script reporting.
  5. Model Prompting: The host semi-appends a static system prompt (adjacent to DSH’s background task instructions); optionally, if a background task exceeds remindAfterMs (default 30000 ms, 0 disables) without reporting, it sends at most one reminder.
  6. Terminal State Fallback: If a script is forcefully terminated by job_kill etc. and cannot write a terminal state, the host semi-infers killed / failed / completion based on the job registry and marks it as inferred rather than reported in the UI.
  7. Bundled CLI: dsh-progress (bin/dsh-progress.mjs) supports emit, done, list, and run --task <id> -- <command> to wrap long commands and attempt to parse progress from output.

Zero npm dependencies at runtime; it does not register new tools to the tool directory, so it does not consume additional tool description cache prefixes.

Installation and Enablement

DSH mounts profile bundles at startup, so a DSH restart is required after installation. The installation methods provided in the official README are as follows.

Install from npm and register to the web profile:

dsh plugin --profile web add dsh-task-progress

Install committed build artifacts from the same repository on GitHub:

dsh plugin --profile web add github:chen8923/dsh-task-progress

For local development/checkout scenarios, you can use the rebuild script in the repository (requires an existing DSH source path):

./tools/rebuild.ps1 -Profile web -Checkout <path-to-dsh-checkout>

The package does not declare install, postinstall, or prepare, so no maintainer scripts are executed on your machine during the installation phase; the actual code executed afterwards is lib/index.js (host) and lib/client.js (browser) within the package. If you wish to verify consistency between the published tarball and a source rebuild yourself, the README provides a comparison workflow using npm pack, diff -r, and npm view dsh-task-progress dist.integrity.

Plugin directory page: https://www.skillhub.cn/plugins/chen8923/dsh-task-progress (SkillHub is a community plugin directory and has no official affiliation with DeepSeek / High-Flyer).

Typical Usage

1. Append JSONL in scripts

The plugin prepares the directory for every shell call; the script simply needs to append a line of JSON to $DSH_PROGRESS_DIR/<task>.jsonl (see repository docs/PROTOCOL.md for the protocol details).

PowerShell example (one event per line):

$line = '{"v":1,"task":"build","state":"running","pct":42,"msg":"linking"}'
[System.IO.File]::AppendAllText(
  (Join-Path $env:DSH_PROGRESS_DIR 'build.jsonl'), $line + "`n",
  [System.Text.UTF8Encoding]::new($false))

bash:

printf '{"v":1,"task":"build","pct":42,"msg":"linking"}\n' >> "$DSH_PROGRESS_DIR/build.jsonl"

Python:

import json, os
path = os.path.join(os.environ["DSH_PROGRESS_DIR"], "build.jsonl")
with open(path, "a", encoding="utf-8") as handle:
    handle.write(json.dumps({"v": 1, "task": "build", "pct": 42, "msg": "linking"}) + "\n")

2. Use the Bundled CLI

To avoid hand-writing escapes, you can directly invoke the CLI pointed to by the environment variable:

node "$DSH_PROGRESS_CLI" emit --task build --pct 42 --msg "linking"
node "$DSH_PROGRESS_CLI" done --task build --msg "shipped"
node "$DSH_PROGRESS_CLI" list

Long commands can be handed over to the wrapper (the README suggests using this for commands expected to exceed ~30 seconds):

node "$env:DSH_PROGRESS_CLI" run --task <id> -- <your command>

3. Zero-config Trial Run

The repository provides a simulation script. After installing the plugin, you can execute it in the DSH shell:

pwsh ./examples/simulate.ps1 -Task demo -Steps 30 -DelayMs 500

Then open the “Task progress” tab in the right sidebar, or wait for the floating capsule to appear and click it.

After installing the plugin, the host side adds a progress convention to the system prompt, and the model will typically arrange reporting for long commands automatically; if the systemPrompt seam is missing in your configuration, you can copy the AGENTS.md snippet from the README to the workspace as a supplementary constraint.

Settings Page and Main Configuration

Open the Task Progress Settings card on the plugin page in the Web UI (the title comes from the plugin-registered slot). Saving writes to this entry’s config in the profile, and changes take effect immediately. Fields listed in the README include:

Config Item (Meaning) Default Value
Scan Interval (ms) 1000
Reporting/Poll Interval (ms) 2000
Retention after Completion (ms) 1800000
Max messages per task (historyLimit) 30
Max tasks (maxTasks) 200
Max file read size in bytes (maxFileBytes) 262144
Extra Root Directories –
Remind model if no report for X ms (remindAfterMs) 30000
Show floating capsule for unreported tasks (overlayUnreported) Off

Progress files are located by default under .dsh-progress/<session-id>/ in each workspace. The plugin only tails these jsonl files (and configured extra absolute path roots) and does not initiate external network requests.

Use Cases and Notes

Who it is for: Users who frequently watch long builds, data imports, test matrices, or Agent-triggered background jobs in the DSH Web interface, and want to see percentages, phase messages, and ETA within the human loop, rather than just a “running” status.

Script-side Habits (from the README section “When scripts are killed”):

  • Try to make the task id appear in the command line (e.g., --task sync-catalog) to facilitate pairing with job mirror lines.
  • One task id corresponds to one writer, or split ids by phase.
  • The normal path should still use try/finally to write terminal states; when the process is force-killed, rely on host inference as a fallback.

Notice before installation: DSH plugins run within DSH host process permissions; this is not a sandboxed installation. The declared scope of this plugin includes: reading/creating the aforementioned .dsh-progress paths, injecting shell environment variables, registering one HTTP route and UI slots, and appending a system prompt segment; no outbound network, no telemetry, no new tools. For the complete table, see the repository’s SECURITY.md. Before installing, it is recommended to read the source code, the LICENSE (MIT), and the release integrity statement, and decide whether to enable it based on your own security strategy.

Deliberately Not Done (to avoid incorrect expectations): No historical archiving, no UI cancel button (use DSH’s job_kill to stop tasks), no cross-session or remote producers.

Conclusion

The DSH ecosystem emphasizes “everything is a plugin”; dsh-task-progress uses a file protocol to decouple long task progress from the agent output stream, allowing humans to see progress in real-time within the Web UI. If your workflow is primarily based on the Web profile and involves many long commands, you can start by installing via a single npm command. After restarting, use examples/simulate.ps1 to verify the overlay and sidebar tab, then integrate it into your own scripts using the protocol or CLI.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye