fix(planner): planner agent 未使用 CAS CLI 存储 phase 详情 #26

Closed
opened 2026-05-07 09:39:28 +00:00 by xiaoju · 0 comments
Owner

问题

全链路测试 (#23 CAS 集成) 中发现:planner agent 没有按预期使用 uncaged-workflow cas put <thread-id> "..." CLI 命令存储 phase 详情,而是自己发明了路径 (/tmp/plan-cas/)。

Thread: 06F03H5V6JTMDST6P3TVH42RWM

Planner 输出:

Phases are stored in CAS at /tmp/plan-cas/. Each hash can be retrieved with createThreadCas("/tmp/plan-cas").get("<hash>") to get the full phase description with acceptance criteria.

原因

Planner 的 system prompt 提到了 uncaged-workflow cas put 但没有足够明确地:

  1. 告知 agent 当前 thread ID(agent context 里有 threadId 但 prompt 没说怎么拿到)
  2. 强调必须用 CLI 命令而不是其他方式
  3. 给出完整的命令示例(带 thread-id 占位符)

修复方案

更新 packages/workflow-role-planner/src/planner.ts 中的 PLANNER_SYSTEM

  1. 明确告知 agent:thread ID 在 thread context 的 start record 中,或通过 uncaged-workflow threads 查看
  2. 给出 完整命令模板uncaged-workflow cas put <THREAD_ID> "# <name>\n\nDescription: ...\n\nAcceptance: ..."
  3. 强调:必须使用此 CLI 命令,不要用其他方式存储
  4. 告知 agent:hash 由命令输出到 stdout,直接使用该 hash

验收标准

  • planner prompt 更新后,agent 正确使用 uncaged-workflow cas put CLI
  • CAS 文件出现在 ~/.uncaged/workflow/logs/<hash>/<thread-id>.cas/
  • coder 能通过 uncaged-workflow cas get <thread-id> <hash> 读取 phase 详情

—— 小橘 🍊(NEKO Team)

## 问题 全链路测试 (#23 CAS 集成) 中发现:planner agent 没有按预期使用 `uncaged-workflow cas put <thread-id> "..."` CLI 命令存储 phase 详情,而是自己发明了路径 (`/tmp/plan-cas/`)。 Thread: `06F03H5V6JTMDST6P3TVH42RWM` Planner 输出: > Phases are stored in CAS at `/tmp/plan-cas/`. Each hash can be retrieved with `createThreadCas("/tmp/plan-cas").get("<hash>")` to get the full phase description with acceptance criteria. ## 原因 Planner 的 system prompt 提到了 `uncaged-workflow cas put` 但没有足够明确地: 1. 告知 agent 当前 thread ID(agent context 里有 threadId 但 prompt 没说怎么拿到) 2. 强调**必须**用 CLI 命令而不是其他方式 3. 给出完整的命令示例(带 thread-id 占位符) ## 修复方案 更新 `packages/workflow-role-planner/src/planner.ts` 中的 `PLANNER_SYSTEM`: 1. 明确告知 agent:thread ID 在 thread context 的 start record 中,或通过 `uncaged-workflow threads` 查看 2. 给出 **完整命令模板**:`uncaged-workflow cas put <THREAD_ID> "# <name>\n\nDescription: ...\n\nAcceptance: ..."` 3. 强调:必须使用此 CLI 命令,不要用其他方式存储 4. 告知 agent:hash 由命令输出到 stdout,直接使用该 hash ## 验收标准 - planner prompt 更新后,agent 正确使用 `uncaged-workflow cas put` CLI - CAS 文件出现在 `~/.uncaged/workflow/logs/<hash>/<thread-id>.cas/` 下 - coder 能通过 `uncaged-workflow cas get <thread-id> <hash>` 读取 phase 详情 —— 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#26