dsh-timer Heading: Configured by Directory to Schedule Agent Sessions to Run Periodically within DSH Processes

Introduction

When running long-term deployments in DeepSeek Harness (DSH), a common requirement is to “automatically start an Agent run at a specific time”: daily reports, periodic inspections, one-time reminders, delayed tasks after process startup, etc. Relying entirely on external cron or system systemd often requires setting up separate processes and environments, which creates a disconnect with DSH’s profiles, sessions, and sandbox strategies.

dsh-timer, published by community maintainer xuan25 and categorized as a workflow plugin, positions itself as the “equivalent of systemd.timer within DSH.” Task definitions reside in a job directory, and upon triggering, it creates a new prompted session for each execution within the same dsh process. Below is an introduction to what it does, how to install it, and how to write job files.

What is this

dsh-timer (GitHub: xuan25/dsh-timer) is an in-process scheduling plugin attached to a specific dsh profile (package version 0.1.0, MIT license). It does not replace system cron but maintains a scheduling loop within the running dsh deployment (the README and package description mention a tick of approximately 30 seconds). When a task is due, it starts a brand-new Agent session for that job.

Each run allows configuration of the working directory, preset, model, file policy, reasoning effort, etc. Job-level state files record the next trigger time and the last 50 run records. Its behavior aligns with common systemd.timer semantics: persistent catch-up runs after a stop, overlap policies (skip / stop / allow), maximum single-run duration limits, and handling of timezones and clock rollbacks.

Core Features

Job Storage and Hot Reloading

  • Jobs are stored in the job directory in a one-job-per-file format: <id>.json. When enable is false, the job remains in the same file but is excluded from scheduling; it can still be triggered manually or re-enabled.
  • Runtime state is written to state/<jobId>.json and is written to by the plugin only.
  • Directory changes trigger a live rescan with a 500 ms debounce. You can also force a rescan via the reload command in the timer tool (README).
  • Other filenames or subdirectories are ignored.

Three Trigger Methods

At least one of the following must be enabled (fields can be null to indicate that trigger method is unused):

  1. onCalendar: 5/6-segment cron expression, or a full ISO 8601 one-time timestamp.
  2. onActiveSec: An interval calculated from the start time of the most recent run (e.g., 30min).
  3. onStartupSec: A one-time delay calculated from process startup, triggered once per process lifecycle.

Calendar-based conditions can set an IANA timeZone. The semantics of fields such as persistent, deferReactivation, runtimeMaxSec, and overlap are detailed in the official schema and the README table.

What constitutes a Run

Upon triggering, instead of an inline function, it creates a new prompted session. run.prompt is the mandatory instruction; the framework automatically appends result summary descriptions. run.cwd determines the session’s working directory and serves as the control scope under the plugin’s permission model. If run.cwd is not defined in the spec, management requires approval, and execution results in create_failed. Therefore, it must be explicitly set in the job file.

Session Archival

The plugin scans by minute: finished run sessions that exceed the job’s run.sessionRetention limit are archived from the framework’s session store to $DSH_HOME/dsh-timer/, preventing session accumulation.

Installation and Activation

The installation command comes from the repository README (replace <name> with the actual profile name):

dsh plugin --profile <name> add dsh-timer

The README states: Registration requires no additional plugin configuration; jobs are read from the directory specified below by default. The optional configuration item jobsDir is used to specify the job directory.

Job Directory Resolution Order

  1. Explicitly specified: jobsDir plugin configuration, or the environment variable DSH_TIMER_JOBS_DIR (if specified but unavailable, the plugin fails to start).
  2. Default: If not explicitly specified, <profileDir>/timers is used (where profileDir is the profile directory where the plugin is installed).
  3. Cordis Patch: If the profile cannot be uniquely determined, use a loader expression in the profile’s cordis.patch.yml to fix the path, for example:
# <profileDir>/cordis.patch.yml
- id: dsh-timer
  config:
    jobsDir: !!js dshHomePath('profiles', '<name>', 'timers')

Job IDs must match ^[a-z0-9][a-z0-9-]{0,63}$ (starting with a lowercase letter or number).

Typical Usage

Writing Job Files Manually

Create daily-check.json in the job directory (the filename serves as the job ID). The following examples are derived from the examples in the repository’s schemas/job.schema.json and serve only as references for field combinations. Please modify the actual paths and prompts according to your deployment, and set an explicit run.cwd for the run (if the session workspace is not inherited upon creation).

Weekday 9 AM inspection (Shanghai Time Zone):

{
  "onCalendar": ["0 9 * * 1-5"],
  "timeZone": "Asia/Shanghai",
  "deferReactivation": true,
  "overlap": "skip",
  "run": {
    "prompt": "Inspect new reports under /workspace/reports in the last 24h and summarize them",
    "cwd": "/path/to/your/workspace"
  }
}

Heartbeat every 30 minutes (calculated from the last activation):

{
  "onActiveSec": "30min",
  "persistent": true,
  "run": {
    "prompt": "Output a one-sentence heartbeat with the current time",
    "cwd": "/path/to/your/workspace"
  }
}

One-time ISO timestamp task:

{
  "onCalendar": ["2026-10-01T00:00:00"],
  "timeZone": "Asia/Shanghai",
  "run": {
    "prompt": "National Day reminder task",
    "policy": "read-only",
    "cwd": "/path/to/your/workspace"
  }
}

Upon saving, the plugin will rescan within a few seconds. You can also use the timer tool (README mentions a nine-verb CLI) within the session to create, delete, modify, or query jobs, either as an alternative to or mixed with manual file editing.

For complete field descriptions and troubleshooting, refer to schemas/job.schema.json and skill/dsh-timer/SKILL.md in the repository.

Use Cases and Precautions

Who is it for

  • Users already running long-term profiles on DSH who want scheduled tasks to be consistent with the same set of presets, models, and sandbox policies.
  • Those who need systemd.timer-style semantics (persistent, overlap, runtime limits) but do not want to split Agent logic into system cron scripts.
  • Those who accept “one trigger = one complete Agent session,” suitable for workflows involving reports, inspections, and reminders.

Important Notices

  • The plugin runs with the identity and permissions of the current dsh process. Prompts and run.policy in jobs are executed automatically when due. Before installation, please read the source code and the MIT license, and only add jobs you fully understand.
  • The community directory SkillHub Plugin Page and the GitHub repository are independent of DeepSeek / High-Flyer and are not an official app store. Stars and versions are subject to the page and repository (as of data capture, the GitHub star count was 0, and the package version was 0.1.0).
  • Relies on Cordis and multiple @deepseek-ai/dsh-* peer packages. It must be compatible with the host DSH version (see the repository’s package.json).

Conclusion

dsh-timer consolidates “when to run” into the job directory under the profile and “how to run” into newly created Agent sessions for each run, making it suitable for in-process workflow scheduling within the DSH ecosystem. For further details and examples:

  • Directory Page: https://www.skillhub.cn/plugins/xuan25/dsh-timer
  • Source Code and README: https://github.com/xuan25/dsh-timer
羽毛球分组比赛记分
小程序二维码

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

Xiaoye