Skip to content
dsh.fish
Bundle

dsh-schedule-enable

在 DeepSeek Harness 的组合 profile 中启用内置持久化调度器 dsh-schedule,让活跃根 Agent 获得 schedule_create / schedule_list / schedule_delete 工具。Enable the built-in durable scheduler in a composing profile.

Source
shixiong0529
stars
1 stars
License
MIT
Updated
Updated 13 days ago

Readme

# dsh-schedule-enable

一个 DeepSeek Harness **纯 patch-only bundle**(配置层),用于在组合它的 profile 中**启用内置持久化调度器**(`@deepseek-ai/dsh-schedule`),让**活跃的根 Agent** 拥有 3 个 Agent 作用域的调度管理工具:

| 工具 | 作用 |
| --- | --- |
| `schedule_create` | 在当前会话创建一条持久化提醒。需提供非空 `prompt`,并恰好选择一个选择器:`after_seconds`(正整数延迟秒数)、`at`(带偏移的 RFC 3339 字符串,或 `{date,time,time_zone}` 本地时间对象)、或 `every_seconds`(固定频率,至少 300 秒)。 |
| `schedule_list` | 按创建顺序列出当前会话的全部活跃提醒,含精确 id、UTC 目标时间、`scheduled`/`overdue` 状态、`session-local` 投递方式。 |
| `schedule_delete` | 按精确 id 删除一条活跃提醒。未知或已结束的 id 返回 `deleted: false`。 |

你安装的是 **bundle**;真正的调度引擎是 Harness 自带的内置包 `@deepseek-ai/dsh-schedule`。本 bundle 只贡献一个配置层,没有模块入口、没有依赖,因此非常小,且完全从平台解析。

## 安装

bundle 声明了 `dsh.bundle.patch`,所以 `dsh plugin add` 会把它作为 profile 层安装(外部包通过安装的扁平模块回退解析它们的 peer 依赖)。Web 界面运行在 `web` profile(`dsh web` 即 `--profile web` 的别名),所以安装到 `web`:

```sh
# 从 GitHub 安装(推荐,一条命令即可,无需先发布到 npm):
dsh plugin --profile web add github:shixiong0529/dsh-schedule-enable
# 或从本地 checkout / tarball 安装:
dsh plugin --profile web add ./dsh-schedule-enable-0.1.0.tgz
```

这条命令会自动把 `dsh-schedule-enable` 追加到该 profile 的 `dsh.profile.bundles`(无需手动编辑任何文件)。**安装后重启 profile**(重新启动 `dsh web`),组合配置就会插入 `time-context` 和 `schedule` 两行,调度器即可用。

## 常见问题

- **报 `ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`**:pnpm 11 对 lockfile 有 24 小时「最小发布年龄」供应链策略,如果目标 profile 里已有今天刚发布的其它包就会命中。在**同一命令**后追加 `--config.minimum-release-age=0` 即可(dsh 会原样转发参数给 pnpm,装完仍会自动加入 bundles):
  ```sh
  dsh plugin --profile web add github:shixiong0529/dsh-schedule-enable --config.minimum-release-age=0
  ```
- **安装后「插件列表」里看不到 `@deepseek-ai/dsh-schedule`**:先运行 `dsh --profile web --dump-config`,确认输出末尾有 `time-context` 与 `schedule` 两行且没有 `disabled: true`;同时检查该 profile 的 `cordis.patch.yml`(用户补丁层)没有把这两个 id 设为 `disabled: true`。
- **调度工具只在新建会话里出现**:调度器挂载到 profile 重启后**新建**的根 Agent 会话;已存在的旧会话不会自动获得 `schedule_create` / `schedule_list` / `schedule_delete`。

## 验证

```sh
# 只打印组合层,不启动服务:
dsh --profile web --dump-config
# 你应能在该 bundle 层里看到 schedule 和 time-context 两行。
```

然后启动 profile(`dsh --profile web`)。调度器会挂载到 profile 加载后创建的每个**新的活跃根 Agent** 上。

## 投递语义(继承自 `dsh-schedule`)

- **仅会话内**:提醒只在原会话仍然活跃时按时运行。冷会话不会收到外部通知,只能在会话恢复后按 overdue 处理。
- **固定频率下限**:`every_seconds` 至少 300(5 分钟),并以创建为锚点对齐。**不支持** Cron/日历表达式。
- **只取最新一次**:过期的固定频率规则只贡献其最近一次到期发生,不会回放错过的积压。
- **过期判定**:活跃干系人从持久化 session fold 重新计算最早目标。回拨时钟不会提前触发;向前跳时会标记为 overdue。
- **不保证精确一次**:在同步跟进入队之后、dispatch 落盘之前发生崩溃,可能重复触发一次提醒。该包不声称模型完成、用户确认或精确一次投递。
- 持久化状态位于会话事件日志(`schedule/change`);定时器与工具值只是该 fold 的可丢弃投影。

## 使用示例

重启服务后,在 Web 界面**新建一个会话**,对 Agent 说:

> 提醒我 3 天后检查备份,并把提醒内容定下来。

Agent 会调用 `schedule_create`(选择 `at` 或 `after_seconds`)。到点时,会话内会出现一条 `[SCHEDULE REMINDER]` 消息,由模型正常跟进处理。

## 要求

- DeepSeek Harness `0.1.1-rc.2`(或该基线的源码 checkout)。
- 目标 profile 需组合 `@deepseek-ai/dsh-base`(Web profile 还需 `@deepseek-ai/dsh-web-app`),它们提供 `sessions`、`agents`、`tools`、`sessionPersistence`。缺少任一必需服务时,Schedule 插件会组合失败。
- Node `^22.19.0 || >=24.0.0`。

## 许可

MIT

Install

dsh plugin --profile web add github:shixiong0529/dsh-schedule-enable

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source