Introduction¶
When running long tasks in DeepSeek Harness (DSH), the traditional approach is to write progress information into the reply text, requiring users to scroll through the conversation to see the latest status. If you switch sessions, this information gets overwritten or lost. The dsh-live-activity plugin provides a floating card on top of the DSH window, continuously displaying task phases, progress, time estimates, and metric series. The card persists after the reply ends and does not disappear when switching sessions.
What It Is¶
dsh-live-activity is a DSH client plugin for displaying real-time progress of long-running tasks. It provides a set of write interfaces (Agent tools and a local HTTP endpoint) along with a persistent floating card. The card floats above the DSH window, implemented via shell.overlay, continues to display after the reply ends, and remains visible across session switches.
Core Features¶
Floating Card¶
The card appears in the upper-right corner of the DSH window, with a default position of top: 72px; right: 20px. Multiple cards stack downward sequentially. Each card is independently operable: drag the title bar to move it, click the collapse button to shrink it into a pill, click the pill or press Enter to expand, and click the close button to dismiss the card. Position and collapse state are persisted in the browser’s local storage per card ID.
The card contains the following areas:
- Title bar: icon, title, subtitle (optional); collapse and close buttons on the right side, which also serves as the drag handle
- Phase: the phase text
- Progress: completed/total count or a progress ratio, with a progress bar below
- Time: elapsed time, remaining time extrapolated from the measured rate, total time, and rate
- Series: one area chart per metrics series, with the latest value displayed in the upper-right corner
- Status: ETA timestamp, pending update, or finished
- Reporter origin: when written from a non-local source, an icon appears after the title; hover to show the reporting machine and port
Write Interfaces¶
The plugin provides two write paths:
1. Agent tool: write via the live_activity tool
2. Local HTTP endpoint: for build scripts, training loops, or direct reporting from devices
The HTTP endpoint listens on 127.0.0.1:41363. The operations are identical to the Agent tool, but only support create / update / end / dismiss / list / get for cards — it cannot read settings, toggle switches, or establish tunnels.
SSH Tunnel¶
By default, the endpoint only listens on 127.0.0.1. LAN access and SSH tunneling are two independent switches, both disabled by default. Toggling takes effect immediately without a restart.
LAN access: When enabled, the endpoint listens on 0.0.0.0:41363, allowing devices on the same subnet to connect directly via http://<local IP>:41363. This port is open to all devices on the subnet; the token is the sole authentication mechanism, and traffic is plaintext HTTP. Enable only on a trusted internal network.
SSH tunnel: For scenarios where the remote machine is not on the same subnet. Once enabled, the agent can establish a tunnel via the tool, and remote scripts can then request http://127.0.0.1:<remotePort>. The tunnel is held by the plugin instance and terminated on line reload or normal process exit.
Installation & Activation¶
The plugin has been verified on DSH 0.2.2-rc.5.
git clone https://github.com/Tippye/dsh-live-activity.git
After enabling, go to the Plugins panel in the DSH interface, add the plugin and select the cloned directory, then enable @local/dsh-live-activity. The agent can also install it by passing the absolute path to plugin_manager’s install_bundle.
The repository directory serves as the installation source (a link: symlink in the profile); git pull completes the upgrade. Host code changes require a refresh in the plugin panel, while client.js changes require a single window refresh.
Typical Usage¶
Agent Tool Calls¶
{"action":"create","title":"构建发布","subtitle":"prod","phase":"编译中","completed":120,"total":500,"etaEpochSeconds":1763650000,"symbol":"build"}
{"action":"update","id":"<id>","phase":"上传产物","completed":430,"metrics":[{"name":"loss","value":0.42}]}
{"action":"end","id":"<id>","phase":"已发布","dismissalPolicy":{"afterSeconds":120}}
Command-Line Client¶
cat ~/.dsh/plugin-data/dsh-live-activity/token
node bin/live-activity.mjs '{"action":"create","title":"训练","phase":"Epoch 1","completed":1,"total":16}'
node bin/live-activity.mjs '{"action":"update","id":"<id>","completed":7,"metrics":[{"name":"loss","value":0.42}]}'
curl -s http://127.0.0.1:41363 \
-H "Authorization: Bearer $(cat ~/.dsh/plugin-data/dsh-live-activity/token)" \
-H 'Content-Type: application/json' \
-d '{"action":"update","id":"<id>","completed":9,"total":16}'
Python Example¶
import json, pathlib, urllib.request
token = pathlib.Path('~/.dsh/plugin-data/dsh-live-activity/token').expanduser().read_text().strip()
def call(payload):
req = urllib.request.Request('http://127.0.0.1:41363', data=json.dumps(payload).encode(),
headers={'Authorization': f'Bearer {token}', 'Content-Type': 'application/json'})
return json.loads(urllib.request.urlopen(req, timeout=5).read())['value']
card = call({'action': 'create', 'title': '训练', 'phase': 'Epoch 1', 'completed': 0, 'total': 16})
for epoch in range(16):
call({'action': 'update', 'id': card['id'], 'completed': epoch + 1,
'metrics': [{'name': 'loss', 'value': 2.0 / (epoch + 1)}]})
call({'action': 'end', 'id': card['id'], 'phase': '训练完成'})
Configuration¶
Open @local/dsh-live-activity in the Plugins panel to configure the two switches. Alternatively, write directly to cordis.patch.yml in the profile:
- id: dsh-live-activity
name: '@local/dsh-live-activity'
config:
lanAccess: false # LAN access, disabled by default
allowTunnel: false # SSH tunnel, disabled by default
port: 41363
Limitations & Caveats¶
- Cards are only visible while the DSH window is visible; they are hidden when minimized. This is not a system-level desktop widget.
- Card content can only be written by the agent or a program; the UI does not support editing (only dismissal or collapsing).
- The polling interval is 2 seconds, so there is approximately a 2-second delay between a write and the card refresh. Countdown and elapsed time are calculated locally in the browser.
- Remaining and total time are extrapolated from the average rate; abrupt speed changes require a period to converge. For precise timing, set
etaEpochSeconds. - Card charts are built-in sparklines with no axes, legends, or interactivity. Use
dsh_boardfor full-featured charts. - The HTTP endpoint listens on the loopback address by default. Cross-device access requires an SSH tunnel or explicitly enabling LAN access. TLS is not provided.
- A maximum of 8 active cards at any given time; the record limit is 32 entries.
- Creating a card requires at least one of
progress,completed+total, ormetrics; otherwise, aNOT_PROGRESS_TRACKINGerror is returned (HTTP 422). - An existing card cannot have both progress and series cleared during an
updatecall (useendto finish).
Ecosystem Context¶
The philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” dsh-live-activity is a community-maintained plugin with no official affiliation to DeepSeek or High-Flyer.