进阶 www.suna.so 2026-10-09 08:09:49 · 2 阅读

第4章 提醒功能详解 - Kortix

提醒 提醒会在稍后的某个时间点重新向同一会话发起提示,可以是单次触发,也可以循环触发,直到被删除为止。 提醒会将一条提示在指定时间发送给一个已存在的会话。它可以触发一次,也可以持续循环,直到有人将其移除。Agent 可以使用提醒来复查自己的工作,例如:“24 小时后,检查供应商是否回复”或“每小时检查一次部署状态是否为绿色”。 提醒是限定在单一会话范围内的触发器。区别如下:

| | 触发器 | 提醒 | |---|---|---| | 存储位置 | kortix.yaml,提交到默认分支 | 数据库。无需编辑清单,也无需提交。 | | 触发行为 | 通常启动一个新会话 | 仅向其所属的一个会话发送提示。它从不启动新会话。 | | 生命周期 | 直到有人从清单中移除 | 直到有人移除。如果会话被删除或失败,它会自动暂停。 | | 创建权限 | 项目经理 (project.trigger.create) | 任何能向该会话发送提示的人。Agent 只能在其所属的会话中创建提醒。 | | 列表查看 | kortix triggers ls,Triggers 页面 | kortix reminders ls,按会话列出 |

对于任何人可见的项目工作(例如每日摘要),请使用触发器。对于属于单个任务的后续跟进,请使用提醒。 开启提醒 提醒是一个按项目区分的功能标志(feature flag),默认处于关闭状态。您可以在 Settings → Feature flags 中开启,或者运行: kortix projects features enable reminders 当标志处于关闭状态时,所有提醒路由都会返回 403,并附带 code: "feature_disabled";提醒页面会显示如何开启该功能;且现有的提醒不会触发。重新开启标志后,那些在关闭期间错过的触发时段只会补触发一次,随后恢复正常日程。 设置提醒 在会话内部,CLI 默认指向当前会话。在会话外部,需通过 --session 指定会话。 # 单次触发,从现在起 24 小时后。 kortix remind "Check whether the vendor replied to the contract email." --in 24h

# 24 小时后首次触发,随后每小时触发一次,直到移除。 kortix remind "Did the vendor reply? If yes, summarize it and remove this reminder." --in 24h --every 1h

# 在指定时刻触发。 kortix remind "Post the launch checklist to #launch." --at 2026-10-01T09:00:00Z

# 使用时区的 cron 表达式循环触发。 kortix reminders add "Post the standup summary." --cron "0 0 9 * * 1-5" --timezone Europe/Berlin

命令会输出提醒 ID(例如 reminder.3f9a1c2e7b04)及其下一次触发时间。 调度规则

--in 或 --at 设置首次触发时间。单独使用时,提醒只触发一次。 --every 设置循环间隔。最小间隔为 5m。每个周期的起点是上一次触发被认领的时间。 --cron "" 使用 6 字段 cron 表达式(秒在前)进行循环触发。--timezone 设置时区,默认为 UTC。Cron 提醒的最小间隔必须超过 5 分钟。它不接受 --in 或 --at 参数。 时间间隔可以是 30m、24h、2d 或整秒数。 --in、--at 和 --every 的最大接受值为 366 天。 单个会话最多容纳 20 个活跃提醒。单个项目最多容纳 200 个。超出限制均返回 409。

触发行为 每次触发会将提醒文本作为提示加入会话队列,提示开头带有标头: [REMINDER reminder.3f9a1c2e7b04 — recurring scheduled check-in on this session, not a new user message. When it is no longer needed, run `kortix reminders rm reminder.3f9a1c2e7b04`.]

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

处于挂起(parked)状态的会话会被唤醒。Agent 拥有该会话的完整对话历史和工作台空间。 触发操作永远不会启动新会话。如果会话被删除或失败,触发器会暂停提醒,并在 last_error 中记录原因。 触发操作会保留会话的个人连接(如成员自己的 Gmail)。如果您正在为某个非您代理的会话设置提醒,这些连接会被清除,效果等同于向该会话发送提示。 项目级别的触发器暂停(kortix triggers pause)也会停止提醒。

每次触发都是一次模型轮次。一旦条件满足,请立即移除循环提醒。 管理提醒

| 命令 | 效果 | |---|---| | kortix reminders ls [--json] | 列出会话的提醒:id、状态、日程、下次触发时间、文本。 | | kortix reminders pause | 停止触发,但保留提醒。 | | kortix reminders resume | 重新触发,从现在开始重新计时。已触发过一次的单次提醒保持完成状态。 | | kortix reminders rm | 删除提醒。别名:stop, delete。 |

提醒状态分为:active(已调度)、paused(已暂停)或 done(已完成的单次提醒)。 API 和 SDK 路由是按会话范围的:

| 路由 | 效果 | |---|---| | GET /v1/projects/:projectId/sessions/:sessionId/reminders | 列出提醒。 | | POST /v1/projects/:projectId/sessions/:sessionId/reminders | 创建一个。Body: prompt, 可选 name, 以及 every, cron + timezone, at, 或 in。返回 201。 | | PATCH /v1/projects/:projectId/sessions/:sessionId/reminders/:reminderId | Body { "enabled": false } 暂停,{ "enabled": true } 恢复。 | | DELETE /v1/projects/:projectId/sessions/:sessionId/reminders/:reminderId | 删除一个。 |

无效的日程返回 400 及原因。已删除的会话返回 409。指向其他会话的 Agent 凭证返回 403。 const reminders = kortix.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);

评论 (0)