Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(bots): guide teammates to maintain Todo commitments
zqchrisa2f52feffa9a
diff --git a/apps/desktop/src/main/maker-ipc/teammateGuide.ts b/apps/desktop/src/main/maker-ipc/teammateGuide.tsindex 877e03339f..f6b91e8e52 100644--- a/apps/desktop/src/main/maker-ipc/teammateGuide.ts+++ b/apps/desktop/src/main/maker-ipc/teammateGuide.ts@@ -2,7 +2,7 @@ import { TEAMMATE_CONTROL_GUIDANCE } from '@cindy/mcps';/** Single host-owned baseline: preloaded text and native SKILL.md share this source. */export const TEAMMATE_GUIDE_NAME = 'teammate-guide';-export const TEAMMATE_GUIDE_DESCRIPTION = 'Shared operating procedures for every teammate: manage tasks, contact and create teammates, change model defaults, use tools, and maintain personal Skills and memory.';+export const TEAMMATE_GUIDE_DESCRIPTION = 'Shared operating procedures for every teammate: maintain Todo commitments, manage tasks, contact and create teammates, change model defaults, use tools, and maintain personal Skills and memory.';export function buildTeammateGuide(options: { helperAvailable?: boolean; cindyAvailable?: boolean; ownSkillsEnabled?: boolean; pluginAuthorizationCardsEnabled?: boolean } = {},@@ -34,6 +34,11 @@ export function buildTeammateGuide('When the user asks to change the application’s default model, use `get_app_default_model` to read the actual current selection and enabled options, then `set_app_default_model` with the returned id and a supported effort if requested. Check the confirmed result. This changes the same default used by new tasks and following teammates; it does not overwrite existing task choices or explicit teammate/global teammate chains. Do not use this global setter when asked to change only this teammate, edit configuration files, guess providers, enable hidden models, or call an auxiliary model.',`Use \`get_capabilities\` with \`scope: runtime\` to inspect registered tools and explicit availability reasons when needed. Use direct teammate tools for your own memory and teammates. When work needs another capability, use \`find_teammate_capabilities\` through the helper’s teammate tools to search existing Skills, MCP connections or built-in tools, and inspect actual availability. Tools and MCP connections follow Cindy by default; use \`set_teammate_capability\` only to change an explicit selection. References reuse existing installations and authorization; do not copy credentials or edit shared sources. New mounts take effect next turn in this same task.${pluginGuidance} Discover only what the work needs; do not repeatedly list the whole tool surface.`,"A real background task is a standalone Session in the user's task list. Prefer completing work in the current chat. Use `start_session_task` when the user explicitly requests an independent task or the work needs separate ongoing execution, an isolated workspace, parallel delivery, or independent tracking. Use `check_session_task`, `message_session_task`, and `stop_session_task` to control that same task when needed. Completion returns automatically; you remain responsible for reviewing and presenting the result.",+ 'Todo maintenance is a shared operating responsibility alongside task execution. A Todo is a commitment you made to the user in conversation, including everyday work before any project or task exists. Projects, Sessions and PRs are optional references, not the identity or prerequisite of that commitment. Ordinary task titles, engine status and archive state belong to the existing task list; do not reinterpret them as Todo completion.',+ 'Each turn, check whether the conversation adds a clear commitment or changes its scope, progress, next step or completion evidence. Also check when you receive a task result, a user correction or new facts during authorized proactive follow-up. Only when something relevant changes, use the live Todo/workbench tools to read the relevant existing entries, reuse the same id for the same commitment, and update it through `set_workbench_task` or `set_workbench_tasks`. Retrying execution or linking a PR does not create a second commitment. Keep unaccepted suggestions distinct (`idea` where supported); recording an idea does not authorize starting work, and ongoing authorized work does not need repeated permission. No change means no fabricated Todo and no pointless read/write cycle.',+ 'Write the current title, facts and one next step together: setters replace the entire entry, so preserve its still-valid reference and project fields. Do not encode state in title prefixes or leave old PR prose after a verified merge. Use `done` only when evidence satisfies the agreed outcome; an idle/stopped task or a merged PR alone need not satisfy it. If acceptance remains, keep it unfinished and name the next verification; unknown facts remain explicitly unverified. For current tools, keep a concise completion basis in `next` and its supporting reference in `ref` where available; these are not structured completion metadata.',+ 'Current workbench tools are a limited project-scoped store: only a local active teammate main Session can use them, supported ids and references must pass the host checks, and even `idea` requires an entrusted project. They do not yet support project-free Todos, independent optional task/PR associations, or a browsable completed section. `done` is returned for retained project items by `get_workbench` but hidden in the current UI; the 200-entry bound can evict old completed judgments, and continuing an item as a background task can remove its judgment. Do not invent unsupported fields, create a fake project, disguise an everyday commitment as a project idea, write raw storage, or claim these gaps are implemented. State the specific recording limitation briefly and retain the commitment in the conversation until a supported tool can save it.',+ 'Inspect every write result, including each batch item, then read back the supported entries with `get_workbench` before claiming they were saved. A partial failure is not a successful whole update; report unsaved items plainly. Reply with only the useful result and remaining work, without tool logs or internal coordination messages. Update on received events and during already-authorized follow-up; guidance alone cannot run while you are not awakened. Do not install a timer merely to maintain Todo or promise unattended real-time updates.','Use `list_agents` to discover local and authorized remote teammates, including device identity. Use the exact returned id; never route by name. Use `send_to_agent` only to send one bounded asynchronous message to a named teammate. It is not a task and has no progress or cancellation. Do not substitute a message to a teammate for `start_session_task`.','An older remote host can receive an attributed message through its ordinary conversation. When `send_to_agent` returns `transport=remote-conversation`, use `check_agent_message` with its message_id on follow-up to read ordinary replies. Do not poll, resend uncertain deliveries, or describe a bridged reply as a remote tool call.',"A teammate message does not rewrite another teammate's identity or make that teammate obey. If the user asks for obedience or control, explain this boundary and offer either a message or a tracked Session task, whichever matches the work.",diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.mdindex 7c097b7f9c..2b72c75257 100644--- a/docs/product-rules/cindy-bots-runtime.md+++ b/docs/product-rules/cindy-bots-runtime.md@@ -457,7 +457,29 @@ Session 任务遵守同一套机制与呈现契约:此展示依赖服务端透传发送者和 `mutable-content`、以及包含通知扩展的新版 iOS 安装包;旧服务端或旧安装包继续显示原通知,不因客户端单侧升级停止推送。-### 6.3 工作台:主人交给伙伴的项目+### 6.3 工作台:项目任务与伙伴 Todo++Todo 是伙伴根据与用户的对话维护的承诺清单,可包括没有项目、没有执行任务的日常事务。+项目、Session 和 PR 只是可选关联,不是 Todo 的归属或前提;顶部项目筛选、移除项目不得+自动隐藏或删除这份清单。普通任务仍复用原有标题、状态、归档与引擎图标,不另造生命周期。+同一承诺多次执行仍沿用同一条记录;停止执行不等于完成,合并只有满足约定结果时才可作为+完成依据,仍需验收则保留明确下一步。已完成应可折叠查看,并能看见完成依据。++**实现边界**:上述 Todo 归属与完成查看是产品方向,现有项目绑定工具与 UI 尚未实现。+以下项目授权、读取与执行限制描述当前能力,不能用它们反推 Todo 必须归属于项目。+目前 `get_workbench` 仅返回项目范围内保留的判断,`done` 被 UI 隐藏、旧完成判断可被+200 条上限淘汰;继续为后台任务时也可能删除原判断。尚无无项目条目、独立关联列表或结构化+完成依据字段。解除项目绑定、保留完成历史的接口及 UI 需另行实施,不能用伪项目绕过。++**共用指南维护流程**:`teammate-guide` 将 Todo 维护与任务调用并列。每轮对话检查新增+承诺、范围、进展、下一步与完成依据;收到任务结果、用户纠正及已授权主动跟进中新事实时+同样检查。有变化才读相关已有记录、沿用 id 幂等更新;整条替换时保留仍有效的关联,多条+变化批量写。只写有依据的状态,建议与已接下的承诺区分,记录不等于开工。逐条核对结果并+读回后才说已更新;失败与不支持的事项如实说明,没有变化不造条目、不做无意义调用。+现工具仅能维护获准项目内的事项,无项目承诺先在对话中保留并说明无法持久记录;不得+写原始存储或把日常事务冒充项目建议。当前可在 `done.next` 写简短完成依据、`ref` 放证据,+不把它描述为已支持结构化完成记录或完成列表。提示词只规定收到事件时的维护行为,不能+保证无唤醒时实时运行,也不因维护 Todo 自行新增定时器。2026-10-01 产品裁决(用户已同意):伙伴可以查看、继续「用户明确交给它的项目」里的任务(停止走通用的`stop_session_turn`,沿用当前 Agent 权限)。2026-10-02 起工作台是伙伴的「负责范围」:不设项目数上限,主人可以口头交代。@@ -514,8 +536,9 @@ Session 任务遵守同一套机制与呈现契约:- `read_workbench_task`:digest 不够判断时才用;只读一件会话最近的用户 / 助手文字(约 4000 字),本机会话只读转录头尾,不写库、不导入。PR / issue / 建议没有对话记录,返回 `TASK_NOT_READABLE`。- `set_workbench_task` / `set_workbench_tasks`(批量 1–30 条,逐条校验、一次广播):伙伴写下理解——- 人话标题(≤ 40 字)、判断(`unfinished` 没做完 / `idea` 聊过没下文或值得做 / `done` 做完或无关)、一句- 下一步(≤ 120 字,done 可空)与可选 `ref`。条目 id 除会话外还可以是 `pr:<owner>/<repo>#<n>`、+ 人话标题(≤ 40 字)、判断(`unfinished` 约定未完成 / `idea` 尚未接下的建议 / `done` 有依据完成)、一句+ 进展与下一步(≤ 120 字,done 时可写完成依据)与可选 `ref`。无关内容和纯问答不新建记录。+ 条目 id 除会话外还可以是 `pr:<owner>/<repo>#<n>`、`issue:<owner>/<repo>#<n>`(仓库必须是某个已接手项目的 GitHub 远端)与 `idea:<slug>`(`[a-z0-9-]{3,40}`;交了多个项目时用 `project` 指明归属)。`ref` 只接受 https 链接(不带账号密码)或已接手项目内的绝对路径(不允许 `..` 越界),否则 `INVALID_REF`。按 taskId 整条替换存进@@ -527,10 +550,11 @@ Session 任务遵守同一套机制与呈现契约:话 + 参考与摘要,原条目从工作台移除,之后它就是一条普通的「你交代的」后台任务。没写过判断的 PR /issue / 建议不能继续。工作台不再有专用的停止工具:停止当前一轮用通用的 `stop_session_turn`。- 工具说明写清做法:先 `get_workbench`,再用自己的文件工具读 brief 里最前面的一两份文档(README / DESIGN /- AGENTS 之类),然后看提交(非 git 目录看最近改过的文件)和 digest,用 `set_workbench_tasks` 一次写完,只对+ AGENTS 之类),然后看提交(非 git 目录看最近改过的文件)和 digest,用 `set_workbench_tasks` 只写变化的相关事项,只对拿不准的几件 `read_workbench_task`;判断要体现对项目的理解,不只复述会话;文档、最近的 PR 与 issue 同样是素材。主人提到项目、让跟进或问进展时先看工作台。写完后在聊天里用几句话告诉主人没做完- 的几件与值得做的几件,问主人接着做哪件,不自作主张开始做。只有本机、在用的伙伴主任务可以调用;远程+ 的几件与值得做的几件;未获授权的建议不自行开工,已获同范围授权的跟进不重复求许可。+ 只有本机、在用的伙伴主任务可以调用;远程伙伴不提供工作台。读写工作台与继续任务沿用当前 Agent 权限(6.4)。- **校验位置**:每次调用在 main 里确定性校验(`maker-ipc/botWorkbenchAccess.ts`),越权返回明确错误码且不读、不写、不投递;工作台详情视图读同一份摘录时也按该伙伴已接手的项目判定范围。diff --git a/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts b/packages/lizi-mcps/src/xdt-helper/bot_workbench.tsindex adce2c3927..c943fe93a5 100644--- a/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts+++ b/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts@@ -210,8 +210,8 @@ const TASK_ID = zconst JUDGMENT_FIELDS = {task_id: TASK_ID,title: z.string().min(1).max(40).describe('人话标题'),- verdict: z.enum(['unfinished', 'idea', 'done']).describe('你的判断'),- next: z.string().max(120).optional().describe('一句下一步;done 可省略'),+ verdict: z.enum(['unfinished', 'idea', 'done']).describe('unfinished 承诺未完成;idea 尚未接下的建议;done 有依据完成(当前界面隐藏)'),+ next: z.string().max(120).optional().describe('一句当前进展与下一步;done 时记录完成依据,无专门的完成依据字段'),ref: z.string().max(2000)@@ -250,14 +250,16 @@ export function registerBotWorkbenchTools(description:'读取你的工作台:主人交给你的项目,每个项目的素材(brief:文档路径、git 分支与最近 14 天提交、我打开的 PR 与 issue;项目很多时只有最近交代的前 8 个带 brief,其余为 null,需要时用文件工具自己看),'+ '项目里最近 30 天的会话(项目里的 Cindy 任务——包括主人自己开的——不管你判断过没有都在,最多 30 条;再补本机 Claude Code / Codex / Pi 会话,合计最多 40 条;更早的只给 olderCount),你写过的 PR / issue / 建议条目,你的例行任务与项目里的自动化。'- + '主人提到这个项目、让你跟进或问进展时,先看工作台;主人自己在项目里开的任务也在里面,它们属于你知道的项目事务,不需要主人逐个告诉你。'+ + 'Todo 是你在对话中答应主人的事务,可早于项目或任务;当前工具只支持已接手项目内的记录,不支持无项目 Todo,不要创建伪项目或把日常事务塞成项目 idea。'+ + '主人提到这个项目、让你跟进或问进展,或对话/任务回传/已授权跟进中发现承诺变化时,读相关记录并沿用 id 更新;没有变化不反复读写。项目里的任务是上下文,不应逐条复制为 Todo。'+ '每条会话带 digest:起始目的与最后几条对话,足够大多数判断,不用逐个读全文。'+ '接手的做法:主人把项目交给你时,先调用它;再用你自己的文件工具读 brief.docs 里最前面的一两份(README / DESIGN / AGENTS 之类),弄清项目是做什么的、在往哪走;'- + '然后看最近的提交(不是 git 仓库时看 brief.recent)和会话 digest,一次性用 set_workbench_tasks 批量写下判断;只有拿不准的几件才 read_workbench_task。'+ + '然后看最近的提交(不是 git 仓库时看 brief.recent)和会话 digest,只对实际变化的相关事项用 set_workbench_tasks 批量写下判断;只有拿不准的几件才 read_workbench_task。'+ '判断与下一步要体现你对项目的理解(它在项目里处于什么位置、和哪份文档或哪次提交有关),不要只复述会话。'+ '项目文档(如 DESIGN.md)、最近的 PR 与 issue 同样是素材:值得做的写成 pr:<owner>/<repo>#<n>、issue:<owner>/<repo>#<n> 或 idea:<slug> 条目,带上 ref。'- + '判断标准:最后一条是没被执行的要求、报错中断、明确留下的待办 → unfinished;讨论过方案或想法但之后没人动 → idea;已交付、纯问答、与项目无关 → done。'- + '写完后在聊天里用几句话告诉主人:没做完的几件各一句下一步,值得做的几件各一句建议,问主人要接着做哪件。不要自作主张开始做;只有主人点头的那件才 continue_workbench_task。'+ + '判断标准:已接下但约定结果未达成 → unfinished;尚未接下的建议 → idea;有可核实依据达到约定结果 → done。纯问答与无关内容不新建条目;停止、空闲、PR 合并不自动等于承诺完成,仍待验收时写明下一步。'+ + 'get_workbench 会返回尚保留且仍在项目范围内的 done 条目,当前界面隐藏,最多 200 条且旧 done 优先淘汰;继续为后台任务时也可能移除原判断,不能当完整完成历史。'+ + '写后检查逐条结果并读回确认,聊天只简短说明结果与余项;记录建议不等于开工授权。已有同范围授权时继续跟进,不重复求许可;没有授权的建议不能自行开始。'+ '主人在工作台上点「跟进」时会发来「跟进「<标题>」」(其它语言如 Follow up on “<标题>”):先调用本工具按标题找到那一条,'+ '再 continue_workbench_task——会话条目发一句承接上文、收到就能接着做的指令;PR / issue / 建议条目会在项目目录开后台任务。'+ '找不到同名条目就问主人是哪一件,不要猜;有几条同名时列出候选让主人选。'@@ -294,10 +296,10 @@ export function registerBotWorkbenchTools(name: 'set_workbench_task',category: 'bots',description:- '写下你对一件事的理解,主人的工作台立刻显示。整条替换之前的判断。多件时用 set_workbench_tasks。'+ '维护一件已接手项目内的事务判断。按 task_id 整条替换,多件变化用 set_workbench_tasks;保留仍有效的 ref/project,写后检查结果并用 get_workbench 读回。当前不支持无项目 Todo 或独立的可选任务/PR 关联。'+ 'task_id:get_workbench 返回的会话 taskId,或你新写的 pr:<owner>/<repo>#<n>、issue:<owner>/<repo>#<n>(须是已接手项目的 GitHub 仓库)、idea:<slug>(小写字母数字与连字符,3–40 位)。'- + 'title:人话标题,不超过 40 字,说清这件事是什么;verdict:unfinished(没做完、可以接着做)/ idea(聊过但没下文,建议往下做)/ done(做完或与项目无关,工作台不显示);'- + 'next:一句下一步,不超过 120 字,unfinished / idea 必填;ref:可选参考(https 链接或项目内文件路径)。只写有依据的判断,不要编造。',+ + '同一承诺沿用原 id,重复执行不重复建条目。title:当前人话标题,不超过 40 字,不用状态前缀;verdict:unfinished(约定未完成)/ idea(尚未接下的建议)/ done(有依据完成,当前界面隐藏)。无关内容不新建;记录不自动开工。'+ + 'next:当前进展与下一步,不超过 120 字,unfinished / idea 必填;done 时写完成依据,ref 放支持依据的 https 链接或项目内文件路径。没有专门完成依据字段。停止或合并仍待验收则保持 unfinished;事实未知写待核实。只写有依据的判断,不要编造。',inputShape: JUDGMENT_FIELDS,handler: async (args) => {const sessionId = callerSessionId();@@ -314,7 +316,7 @@ export function registerBotWorkbenchTools(category: 'bots',description:`批量写下判断(1–${WORKBENCH_BATCH_MAX} 条),字段与 set_workbench_task 相同。逐条校验,一条不合格不影响其它条;返回每条的结果。`- + '接手项目时优先用它:看完 get_workbench 的 brief 与 digest 后一次写完。',+ + '对话承诺、任务回传、用户纠正或已授权跟进发现相关变化后才写,同一承诺沿用 id;没有变化不造条目。检查每条结果,部分失败不代表全部成功,再 get_workbench 读回。与单条工具一样,当前只支持项目内记录。',inputShape: {items: z.array(z.object(JUDGMENT_FIELDS)).min(1).max(WORKBENCH_BATCH_MAX).describe('判断列表'),},