Introduction

When developing agents in DeepSeek Harness (DSH) that need to be triggered periodically, extra scheduling logic is usually required. The dsh-cron plugin adds a /cron slash command, allowing developers to define recurring agent tasks directly in conversation using standard Cron syntax.

What Is It

This is a DSH plugin maintained by XiaoWind. Its core function is to provide an interactive /cron slash command. It lets users define scheduled tasks in a session, allowing the agent to run regularly according to a predefined Cron expression (minute, hour, day, month, weekday).

Core Features

  1. Slash command interaction: Provides the /cron command, supporting setting scheduled tasks, viewing status, stopping tasks, and resuming tasks.
  2. Standard Cron syntax: Supports standard 5-field Cron syntax (minute hour day month weekday).
  3. Local time execution: Task scheduling is calculated based on local time.
  4. Persistent storage: Task plans are saved in the $DSH_HOME/dsh-cron/<sessionId> file.
  5. Automatic recovery: After restarting DSH, the plugin automatically reads saved plans and resumes execution.
  6. Goal compatibility: Supports appending a task goal directly after the Cron expression (for example, /cron "0 9 * * *" fix the tests), and also supports entering only a goal to use the default plan.
  7. Non-blocking execution: If the trigger time arrives while the agent is running, the plugin waits until the agent is idle before executing the next trigger.

Installation and Enabling

The plugin is installed using the dsh plugin command. After installation, the Web application needs to be restarted.

dsh plugin --profile web add git+https://github.com/XiaoWind/dsh-cron.git

The plugin injects the commands service, so it is only enabled in configuration files that include the command adapter. The built-in web configuration file in DSH already includes this adapter.

Typical Usage

The plugin supports the following subcommands and syntax:

# 设置每 30 分钟执行一次,保持当前目标
/cron "*/30 * * * *"

# 设置工作日早上 9 点执行
/cron "0 9 * * 1-5"

# 设置工作日早上 9 点执行特定目标
/cron "0 9 * * 1-5" fix the tests

# 使用默认计划执行目标
/cron fix the tests

# 查看当前任务状态
/cron status
/cron

# 停止任务
/cron stop

# 手动恢复已保存的任务
/cron resume

# 查看帮助
/cron help

Note: Seconds are not supported in Cron expressions. The default plan is */10 * * * * (every 10 minutes).

Applicable Scenarios and Notes

This plugin is suitable for scenarios that require long-term, recurring automation in DSH.

  1. Configuration requirements: You must use a configuration file that includes the command adapter (for example, the web configuration file).
  2. Time precision: Only minute-level scheduling is supported.
  3. Execution logic: It does not interrupt an in-progress agent turn. Instead, it waits until the agent is idle before executing, ensuring that tasks are not lost.
  4. License: The open-source license is MIT.

Conclusion

dsh-cron lowers the development barrier for scheduled DSH agent tasks by using standardized Cron syntax. If you need to implement periodic automation workflows in DeepSeek Harness, you can refer to the community directory or the source repository for configuration.