Preface¶
When using DSH to have agents submit cluster jobs, SSH into bare metal, or start long-running tasks in remote tmux sessions, the conversation often goes quiet quickly. However, the task status remains in a separate set of programs—squeue, bjobs, tmux list-sessions—and to check progress, you have to open a terminal to poll, keep a separate monitoring page open, or remember to glance at it hours later.
The GUI already knows which conversation you are working in. dsh-job-watch binds a task ID to the current conversation, queries the status according to your configured provider, and colors the corresponding row in the sidebar: pink for running, green for finished, and amber for unknown IDs. A glance at the sidebar answers the question: “Which conversation still has something running, and which ones finished while you were away?”
This article introduces the community plugin yanggaihao5-sys/dsh-job-watch (maintained by yanggaihao5-sys, categorized as a client). The plugin has no affiliation with DeepSeek and only declares compatibility with DeepSeek Harness (DSH). Capabilities in the DSH ecosystem are extended via plugins; the directory site skillhub.cn is an independent community directory, not an official DeepSeek or High-Flyer app store.
What is this¶
In short: dsh-job-watch registers long-running task IDs that were not started by the current conversation but that you care about within the DSH Web GUI, associating them with the current conversation. The sidebar row then carries the status—pink for running, green for completed, and amber if the provider cannot find the ID.
The plugin does not implement the business logic for schedulers or tmux. Each provider is simply a shell command plus a “line-matching” regex; Slurm, tmux on bare metal, or your own status CLI are all the same abstraction to the plugin.
How to read the sidebar status¶
The README uses a schematic to explain four scenarios:
□ conv A · (no mark) nothing to do
▌ conv B · ● pink, pulsing a tracked job is running
▌ conv C · ● green finished — come back and analyse
▌ conv D · ● amber the id cannot be found by its provider
Green is intentionally persistent: it does not automatically expire, aiming to remind you to return and analyze the results. It is only cleared when you actually send a message in that conversation; injected contexts such as workspace instructions, skill directories, or runtime snapshots do not count as sending a message, preventing the mark from being silently cleared.
The running state’s left bar color is #ec4899 (consistent with the README screenshot description and the actual machine).
Architecture: Host and Browser each do half the work¶
| Part | Location | Responsibility |
|---|---|---|
host (lib/index.js) |
dsh process |
Task ledger, provider polling, job_watch agent tool, /api/job-watch/* |
browser (lib/client.js) |
Web GUI | Reads the status API and colors the sidebar rows |
Queries are triggered at four moments, which can skip each other and have controllable costs:
| Trigger | Effect |
|---|---|
Every pollMinutes (default 30) |
Regular rhythm |
| ~60s heartbeat, comparing wall clock vs. monotonic clock | Timers are unreliable when the machine sleeps; clock drift > 90s is treated as sleep, triggering an immediate catch-up poll |
| Opening / refocusing the GUI | Status should be relatively fresh when the user is present (the host only queries again if the ledger is older than requestStaleSeconds) |
After register |
The color should be correct immediately, rather than waiting 30 minutes |
Installation and Activation¶
Installation command (must be used exactly as written; --profile must be placed after plugin, otherwise it will be rejected):
dsh plugin --profile web add dsh-job-watch
Restarting dsh web is required after installation.
package.json requires DSH engine >=0.1.2-alpha.1 and is licensed under MIT. The plugin runs the shell commands in the provider (including SSH) with the permissions of the current dsh process; please review the source code and license yourself before installing.
Configuring Providers¶
Configure at least one provider in the profile patch, located at a path like ~/.dsh/profiles/<profile>/cordis.patch.yml:
- id: job-watch
config:
pollMinutes: 30
providers:
# 1) Scheduler: one line per job (Slurm: id, state, name)
- id: cluster
label: Cluster
command: 'ssh login01 "squeue -u $USER -h -o ''%i %T %j''"'
linePattern: '^(?<id>\S+)\s+(?<stat>\S+)\s+(?<name>\S+)$'
# 2) Bare metal: treat tmux session names as job ids
- id: lab
label: Lab box
command: 'ssh lab "tmux list-sessions -F ''#{session_name}''"'
linePattern: '^(?<id>[A-Za-z0-9_.-]+)$'
linePattern is applied line by line; it must have a named capture group id, and optionally stat, name. Unmatched lines are ignored. ANSI color codes are stripped beforehand.
Provider Fields¶
| Key | Required | Meaning |
|---|---|---|
id |
✅ | Name used in job_watch(provider=…) and tooltips |
label |
Human-readable name | |
command |
✅ | Executed via the platform shell; you write SSH, etc., in the command |
linePattern |
✅ | Regex for each line, named group id required |
runningStates |
Override the default list of running states (e.g., RUN, PEND, QUEUE, WAIT) |
|
doneStates |
Override the default list of finished states (e.g., DONE, EXIT, FAIL) |
Other configuration options include: pollMinutes, heartbeatSeconds, commandTimeoutSeconds, minPollGapSeconds, requestStaleSeconds, unknownAfterSeconds, pruneDays (finished and acknowledged rows are pruned after this number of days), missingMeans (done: disappearing from the listing is treated as finished; unknown: colored amber), statePath (default $DSH_HOME/job-watch.json).
A non-zero exit from the provider command is not fatal (e.g., tmux list-sessions exits with 1 when there are no sessions); stdout is still parsed, and failure information is reported alongside the status.
Agent: The job_watch Tool¶
The host injects brief rules into each agent’s system prompt and exposes the tool:
job_watch(action='register', jobIds=['40217'], provider='cluster', etaMinutes=540, note='sweep A')
job_watch(action='list')
job_watch(action='refresh')
job_watch(action='clear')
Key points are as follows:
- Registration is not optional. Jobs that no one tells the plugin about will not be recorded in the ledger, and the sidebar will not guess. Tasks submitted to
tmuxor the cluster do not appear automatically; the rules are placed in the system prompt to ensure the agent callsregisterafter submitting long-running tasks. - If
jobIdsis not passed toregister, it will auto-claim: claiming all jobs currently listed as running by providers that are not yet tracked by any conversation. This is suitable for backfilling registration later. - Each report provides a suggested completion time at the end of each job: registration time plus your registered ETA, or an explicit statement that it cannot be estimated and how to measure it; the plugin does not fabricate times. If the ETA has passed and the provider still reports running, it is marked as overdue, without assuming it has finished.
SKILL.mdis consistent with the above conventions, for use by agents that load the skill.
Typical Usage Steps¶
- Install the plugin as described above and restart
dsh web. Write at least one provider incordis.patch.yml(e.g., clustersqueueor labtmux list-sessions). - Open the conversation in DSH Web where you want to track the task; have the agent call
job_watch(action='register', jobIds=[...], provider='cluster', etaMinutes=..., note='...')after submitting the long-running task. - The sidebar row will appear pink and pulsing when running; green after finishing (until you speak in that conversation); amber if the ID cannot be found in the provider listing.
- Use
listorrefreshas needed; callclearafter confirming analysis is complete, or rely on the green mark clearing after you send a message.
Use Cases and Limitations¶
Who is it for: People who frequently use DSH Web for multi-conversation development while running hour-scale tasks on Slurm schedulers, SSH bare metal, or tmux, wanting the sidebar to replace manual polling.
Known Limitations (stated in the README):
- The sidebar has no official decoration API. The browser half finds the session ID from the row DOM via the React fiber chain to inject marks, binding it to the current sidebar implementation; if an exception occurs, the console and
window.__dshJobWatch.stats()provide information rather than failing silently. - Jobs not initiated by DSH must be manually
registered. - Only conversation rows actually rendered in the sidebar are colored; sessions not appearing in the sidebar list have no color.
Conclusion¶
dsh-job-watch writes the “long-running task ID ↔ current conversation” relationship into a ledger, interfaces with any listing via configurable “command + line regex,” and collapses status into the Web sidebar you already look at. Community directory page: skillhub.cn/plugins/yanggaihao5-sys/dsh-job-watch. Source code and full documentation: github.com/yanggaihao5-sys/dsh-job-watch.