Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(bots): allow progress reads without Todo changes

zqchris9f3142a54621
diff --git a/apps/desktop/src/main/maker-ipc/teammateGuide.ts b/apps/desktop/src/main/maker-ipc/teammateGuide.ts
index 793f3a97dd..175891e269 100644
--- a/apps/desktop/src/main/maker-ipc/teammateGuide.ts
+++ b/apps/desktop/src/main/maker-ipc/teammateGuide.ts
@@ -35,9 +35,9 @@ export function buildTeammateGuide(
`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.',
+ '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. Use the live Todo/workbench tools to read relevant existing entries when the user asks for current progress, requests follow-up, or something relevant changes. Only write changes through `set_workbench_task` or `set_workbench_tasks`, reusing the same id for the same commitment. 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 or redundant write; a progress query can still require a read.',
'Write the current title, facts and one next step together: setters replace the entire entry, so preserve its still-valid reference and project fields. For Session judgments, `get_workbench` omits `ref` and `read_workbench_task` returns only conversation text. An omitted field is not proof that no reference exists: recover it from a confirmed prior write receipt matching the current judgment’s updatedAt if available; otherwise do not overwrite that judgment and explain the safe-update limitation briefly. 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.',
+ '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. `get_workbench` returns retained project PR/issue/idea items with `done`; Session judgments, including `done`, appear only if their Sessions pass the recent-window and count filters. The current UI hides done judgments, 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 attempt to read back supported entries with `get_workbench`. Its Session list is limited to recent candidates and a count bound, so an older or omitted Session judgment can save successfully without appearing in that read. An explicit successful write receipt confirms saving; if readback cannot show it, distinguish saved-but-not-visible from a failed write and from content verified by readback. Do not retry a successful write just to make it appear. 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.',
diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.md
index 1044c44555..441edfd195 100644
--- a/docs/product-rules/cindy-bots-runtime.md
+++ b/docs/product-rules/cindy-bots-runtime.md
@@ -467,13 +467,15 @@ Todo 是伙伴根据与用户的对话维护的承诺清单,可包括没有项
**实现边界**:上述 Todo 归属与完成查看是产品方向,现有项目绑定工具与 UI 尚未实现。
以下项目授权、读取与执行限制描述当前能力,不能用它们反推 Todo 必须归属于项目。
-目前 `get_workbench` 仅返回项目范围内保留的判断,`done` 被 UI 隐藏、旧完成判断可被
+目前 `get_workbench` 返回项目范围内保留的 PR / issue / idea 判断,会话判断另受近期窗口和
+数量过滤,不保证查回全部已存 `done`。`done` 被 UI 隐藏、旧完成判断可被
200 条上限淘汰;继续为后台任务时也可能删除原判断。尚无无项目条目、独立关联列表或结构化
完成依据字段。解除项目绑定、保留完成历史的接口及 UI 需另行实施,不能用伪项目绕过。
**共用指南维护流程**:`teammate-guide` 将 Todo 维护与任务调用并列。每轮对话检查新增
承诺、范围、进展、下一步与完成依据;收到任务结果、用户纠正及已授权主动跟进中新事实时
-同样检查。有变化才读相关已有记录、沿用 id 幂等更新;整条替换时保留仍有效的关联,多条
+同样检查。询问当前进度、要求跟进或发现变化时读取相关已有记录;只有变化才沿用 id 写回,
+纯进度查询允许只读。整条替换时保留仍有效的关联,多条
变化批量写。只写有依据的状态,建议与已接下的承诺区分,记录不等于开工。逐条核对结果并
尝试读回并区分回执确认保存、列表可见性和内容核对;失败与不支持的事项如实说明,没有变化不造条目、不做无意义调用。
会话判断的读取不含旧 `ref`;没有 updatedAt 与当前判断一致的已确认写入回执可恢复原引用时,不整条覆盖该判断,不能把
diff --git a/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts b/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts
index fc24282c4b..d99ce6782e 100644
--- a/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts
+++ b/packages/lizi-mcps/src/xdt-helper/bot_workbench.ts
@@ -251,14 +251,14 @@ export function registerBotWorkbenchTools(
'读取你的工作台:主人交给你的项目,每个项目的素材(brief:文档路径、git 分支与最近 14 天提交、我打开的 PR 与 issue;项目很多时只有最近交代的前 8 个带 brief,其余为 null,需要时用文件工具自己看),'
+ '项目里最近 30 天的会话(项目里的 Cindy 任务——包括主人自己开的——不管你判断过没有都在,最多 30 条;再补本机 Claude Code / Codex / Pi 会话,合计最多 40 条;更早的只给 olderCount),你写过的 PR / issue / 建议条目,你的例行任务与项目里的自动化。'
+ 'Todo 是你在对话中答应主人的事务,可早于项目或任务;当前工具只支持已接手项目内的记录,不支持无项目 Todo,不要创建伪项目或把日常事务塞成项目 idea。'
- + '主人提到这个项目、让你跟进或问进展,或对话/任务回传/已授权跟进中发现承诺变化时,读相关记录并沿用 id 更新;没有变化不反复读写。项目里的任务是上下文,不应逐条复制为 Todo。'
+ + '主人提到这个项目、让你跟进或问进展,或对话/任务回传/已授权跟进中发现承诺变化时,读相关记录;只有实际变化才沿用 id 写回,纯进度查询也可只读。项目里的任务是上下文,不应逐条复制为 Todo。'
+ '每条会话带 digest:起始目的与最后几条对话,足够大多数判断,不用逐个读全文。会话 judgment 不返回 ref,不能把缺字段当成没有旧引用;找不到 updatedAt 与当前判断一致的已确认写入回执时不要覆盖该判断。'
+ '接手的做法:主人把项目交给你时,先调用它;再用你自己的文件工具读 brief.docs 里最前面的一两份(README / DESIGN / AGENTS 之类),弄清项目是做什么的、在往哪走;'
+ '然后看最近的提交(不是 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。纯问答与无关内容不新建条目;停止、空闲、PR 合并不自动等于承诺完成,仍待验收时写明下一步。'
- + 'get_workbench 会返回尚保留且仍在项目范围内的 done 条目,当前界面隐藏,最多 200 条且旧 done 优先淘汰;继续为后台任务时也可能移除原判断,不能当完整完成历史。'
+ + 'get_workbench 返回尚保留且仍在项目范围内的 PR/issue/idea done 条目;会话 done 判断还受前述近期窗口和数量过滤,不能保证查回所有已存完成记录。当前界面隐藏 done,最多 200 条且旧 done 优先淘汰;继续为后台任务时也可能移除原判断,不能当完整完成历史。'
+ '写后检查逐条结果并尝试读回确认。会话列表受近期窗口和数量上限约束,写入成功的旧会话可能不在返回中;成功回执确认保存,列表缺席不等于写失败,不能为此重复写。聊天简短区分已保存但列表不可见、已读回核对和未保存;记录建议不等于开工授权。已有同范围授权时继续跟进,不重复求许可;没有授权的建议不能自行开始。'
+ '主人在工作台上点「跟进」时会发来「跟进「<标题>」」(其它语言如 Follow up on “<标题>”):先调用本工具按标题找到那一条,'
+ '再 continue_workbench_task——会话条目发一句承接上文、收到就能接着做的指令;PR / issue / 建议条目会在项目目录开后台任务。'