---
title: "提醒"
description: "提醒会在之后的某个会话中再次提示一次或重复提示，直到你将其移除。"
---

提醒会在你设定的时间，向一个现有的 [会话](/docs/zh/work/sessions)发送提示。它可以仅触发一次，也可以重复触发，直到有人将其移除。代理会用提醒来检查自己的工作进度，例如：“24 小时后检查供应商是否回复了”“每小时检查部署是否正常”。

提醒是一个作用范围限定为单个会话的[触发器](/docs/zh/connect/triggers)。两者的区别：

| | 触发器 | 提醒 |
| --- | --- | --- |
| 存储位置 | `beeuni.yaml`，提交到默认分支 | 数据库。无需修改清单，也无需提交。 |
| 触发时 | 通常会启动新会话 | 向其指定的会话发送提示。不会启动会话。 |
| 有效期 | 直到有人从清单中将其移除 | 直到有人将其移除。如果其会话被删除或失败，提醒会自动暂停。 |
| 谁可以创建 | 项目经理（`project.trigger.create`） | 任何可以向该会话发送提示的人。代理只能在自己的会话中创建提醒。 |
| 查看位置 | `beeuni triggers ls`，触发器页面 | `beeuni reminders ls`，每个会话各自显示 |

对于任何人都应该看到的项目工作（例如每日摘要），请使用触发器。对于属于单项任务的后续跟进，请使用提醒。

<a id="turn-reminders-on"></a>

## 开启提醒

提醒是项目级的[功能标记](/docs/zh/feature-flags)，`reminders`，默认关闭。可在 **Settings → Feature flags** 中开启，或运行：

```sh
beeuni projects features enable reminders
```

标记关闭时，所有提醒路由都会返回 `403` 和 `code: "feature_disabled"`，提醒页面会说明如何开启，现有提醒也不会触发。重新开启标记后，关闭期间错过的时段会触发一次，之后按计划继续。

<a id="set-a-reminder"></a>

## 设置提醒

在会话内使用 CLI 时，命令会针对当前会话。在会话外使用时，请传入 `--session <id>`。

```sh
# Fire once, 24 hours from now.
beeuni remind "Check whether the vendor replied to the contract email." --in 24h

# First fire in 24 hours, then every hour until removed.
beeuni remind "Did the vendor reply? If yes, summarize it and remove this reminder." --in 24h --every 1h

# Fire at an exact instant.
beeuni remind "Post the launch checklist to #launch." --at 2026-10-01T09:00:00Z

# Repeat on a cron expression in a time zone.
beeuni reminders add "Post the standup summary." --cron "0 0 9 * * 1-5" --timezone Europe/Berlin
```

命令会输出提醒 ID（例如 `reminder.3f9a1c2e7b04`）以及下一次触发时间。

<a id="schedule-rules"></a>

## 计划规则

- `--in <duration>` 或 `--at <ISO-8601>` 用于设置首次触发时间。单独使用时，提醒仅触发一次。
- `--every <duration>` 用于重复触发。最短周期为 `5m`。每个周期从上一次触发被领取时开始计算。
- `--cron "<expr>"` 按 6 字段 cron 表达式重复触发（秒在第一位）。`--timezone` 用于设置时区；默认值为 `UTC`。Cron 提醒的触发频率不得超过每 5 分钟一次。它不接受 `--in` 或 `--at`。
- 时长格式为 `30m`、`24h`、`2d` 或整数秒。
- `--in`、`--at` 和 `--every` 最多接受 366 天。
- 每个会话最多可有 20 个启用中的提醒。每个项目最多可有 200 个。超出任一限制都会返回 `409`。

<a id="what-a-fire-does"></a>

## 触发时会发生什么

每次触发都会将提醒文本作为提示排入会话，提示以以下标头开头：

```text
[REMINDER reminder.3f9a1c2e7b04 — recurring scheduled check-in on this session, not a new user message. When it is no longer needed, run `beeuni reminders rm reminder.3f9a1c2e7b04`.]

Did the vendor reply? If yes, summarize it and remove this reminder.
```

- 处于停放状态的会话会唤醒。代理可以访问该会话的完整对话和工作区。
- 触发不会启动新会话。如果会话被删除或失败，提醒会暂停，原因会记录在 `last_error` 中。
- 触发时会保留会话的个人连接，例如成员自己的 Gmail。如果你为一个并非由你操作的会话设置提醒，这些连接会被清除，与向该会话发送提示的行为相同。
- 项目级的触发器暂停设置（`beeuni triggers pause`）也会停止提醒。

每次触发都会产生一个模型轮次。条件满足后，请立即移除重复提醒。

<a id="manage-reminders"></a>

## 管理提醒

| 命令 | 效果 |
| --- | --- |
| `beeuni reminders ls [--json]` | 列出会话的提醒：ID、状态、计划、下一次触发时间和文本。 |
| `beeuni reminders pause <id>` | 停止触发，但保留提醒。 |
| `beeuni reminders resume <id>` | 再次触发，并从现在开始重新计时。已触发过的一次性提醒仍保持 `done`。 |
| `beeuni reminders rm <id>` | 删除提醒。别名：`stop`、`delete`。 |

提醒状态可以是 `active`（已计划）、`paused`（已关闭）或 `done`（已触发的一次性提醒）。

<a id="api-and-sdk"></a>

## API 和 SDK

这些路由的作用范围限定为会话：

| 路由 | 效果 |
| --- | --- |
| `GET /v1/projects/:projectId/sessions/:sessionId/reminders` | 列出提醒。 |
| `POST /v1/projects/:projectId/sessions/:sessionId/reminders` | 创建提醒。请求体：`prompt`、可选的 `name`，以及 `every`、`cron` + `timezone`、`at` 或 `in`。返回 `201`。 |
| `PATCH /v1/projects/:projectId/sessions/:sessionId/reminders/:reminderId` | 请求体为 `{ "enabled": false }` 时暂停，为 `{ "enabled": true }` 时恢复。 |
| `DELETE /v1/projects/:projectId/sessions/:sessionId/reminders/:reminderId` | 删除提醒。 |

计划无效时，会返回 `400` 和原因。会话已删除时，会返回 `409`。代理凭据指定了其他会话时，会返回 `403`。

```ts
const reminders = beeuni.session(projectId, sessionId).reminders;
const reminder = await reminders.create({ prompt: 'Did the vendor reply?', in: '24h', every: '1h' });
await reminders.update(reminder.id, { enabled: false });
await reminders.remove(reminder.id);
```
