Preface¶
DeepSeek Harness (DSH) is a plugin-centric framework. When building agent applications, you often need to run periodic tasks or handle scheduled triggers. The cofy-x/dsh-cron plugin addresses this problem. It is a persistent calendar-trigger adapter for DSH Automation that converts one-off or recurring calendar events into idempotent session runs.
What It Is¶
- Name: cofy-x/dsh-cron
- Category: Workflow
- Description: Provides scheduled-task capabilities for DSH Automation, supports model calls and Shell command management, and can inject follow-up tasks into Agent sessions.
- License: MIT
Installation and Prerequisites¶
Before installing, make sure your environment meets the following requirements:
* Node.js 24 or later
* DSH version 0.1.5-rc.1 or later (0.1.x line)
* dsh-automation 0.2.x
Install dsh-automation first, then install this plugin. The commands are:
dsh plugin --profile web add dsh-automation@next
dsh plugin --profile web add @cofy-x/dsh-cron
Core Features¶
The plugin mainly provides the following capabilities:
- Flexible scheduling formats: Supports standard five-field Cron expressions, RFC 3339 timestamps, and IANA time zones, including daylight saving time calculations.
- Dual management methods: Provides Shell commands (such as
/cron add) and Model Tools (such ascron_add,cron_update,cron_list, andcron_remove) for managing tasks. - Persistence and idempotency: Every calendar trigger persists a run record. If the process crashes and restarts after commit, it can recover based on the job ID and timestamp, ensuring idempotent session runs.
- Fault-tolerance policy: Uses a “Latest-only catch-up” policy. Missed trigger times for recurring tasks are not replayed; only the latest due task is executed. One-time tasks keep their history after triggering.
- Browser task center: Provides a task-management interface for the browser through the
dsh.clientmanifest.
Usage Examples¶
Creating tasks with Shell commands is straightforward. Here are some typical examples:
# 每周一到周五的上午 9 点总结项目状态
/cron add 0 9 * * 1-5 Summarize the project status
# 设置上海时区,每周五下午 6 点 30 分准备周报
/cron add tz=Asia/Shanghai 30 18 * * 5 Prepare the weekly report
# 设置具体的执行时间(RFC 3339 格式)
/cron add-at 2026-09-01T09:00:00+08:00 Run the release checklist
Commands for managing tasks (pause, resume, remove):
/cron pause cron-1
/cron resume cron-1
/cron remove cron-1
Configuration and Limitations¶
The plugin provides the following configuration options (default values):
| Key | Default | Meaning |
|---|---|---|
dataDir |
$DSH_HOME/cron |
Directory for persistent job storage and scheduler locks |
defaultTimeZone |
host zone | Time zone used when a Cron expression does not specify one |
maxJobs |
64 |
Maximum number of active jobs |
minIntervalMinutes |
1 |
Minimum recurring interval (minutes) |
defaultCwd |
none | Absolute fallback working directory for browser/API tasks |
reconcilePollMs |
1000 |
Polling interval for the Automation event stream |
maxRunHistory |
100 |
Terminal run history kept per job |
For concurrency limits, each job uses cron:<job-id> as its concurrency key, with a default limit of 1 concurrent job. The maximum number of active jobs is 64.
Summary¶
cofy-x/dsh-cron is a plugin that provides reliable scheduled-task capabilities for DeepSeek Harness. Through persistent records and idempotent design, it ensures stable task scheduling, making it suitable for scenarios that require periodic logic in Agent workflows.