fix(agent-claude-code): use buildContinuationPrompt for step context #486

Closed
opened 2026-05-25 01:56:28 +00:00 by xiaoju · 0 comments
Owner

问题

claude-code agent 的 buildHistorySummary 是独立实现的,只输出 Output: {frontmatter} + Agent,不包含 step.content(agent 的完整文本输出)。

导致:

  1. developer 被 bounce 回来时看不到 reviewer 的详细反馈,只看到 {"approved":false}
  2. 首次参与角色(如 committer)没有历史上下文(#473 已在 hermes agent 修复,claude-code 没跟进)
  3. step read workflow (#484) 因此失败 — developer 三次看不到 reviewer 说了啥,最终放弃

对比

hermes agent claude-code agent
prompt 构建 buildContinuationPrompt(agent-kit) 自己的 buildHistorySummary
step content includeContent=true 不包含
首次角色检测 isFirstVisit 不区分
quota 控制 selectStepsWithinQuota

修复

workflow-agent-claude-code 删掉 buildHistorySummary,改用 buildContinuationPrompt(从 @uncaged/workflow-agent-kit 导入),传入 includeContent: true + quota。

与 hermes agent 的调用方式对齐:

buildContinuationPrompt(ctx.steps, ctx.role, ctx.edgePrompt, {
  includeContent: true,
  quota: 16_000,
})

关联

  • #473 首次参与角色上下文不足(hermes 已修,claude-code 未跟进)
  • #484 step read workflow 失败的根因

— 小橘 🍊(NEKO Team)

## 问题 claude-code agent 的 `buildHistorySummary` 是独立实现的,只输出 `Output: {frontmatter}` + `Agent`,不包含 `step.content`(agent 的完整文本输出)。 导致: 1. **developer 被 bounce 回来时看不到 reviewer 的详细反馈**,只看到 `{"approved":false}` 2. **首次参与角色(如 committer)没有历史上下文**(#473 已在 hermes agent 修复,claude-code 没跟进) 3. step read workflow (#484) 因此失败 — developer 三次看不到 reviewer 说了啥,最终放弃 ## 对比 | | hermes agent | claude-code agent | |---|---|---| | prompt 构建 | `buildContinuationPrompt`(agent-kit) | 自己的 `buildHistorySummary` | | step content | ✅ includeContent=true | ❌ 不包含 | | 首次角色检测 | ✅ isFirstVisit | ❌ 不区分 | | quota 控制 | ✅ selectStepsWithinQuota | ❌ 无 | ## 修复 `workflow-agent-claude-code` 删掉 `buildHistorySummary`,改用 `buildContinuationPrompt`(从 `@uncaged/workflow-agent-kit` 导入),传入 `includeContent: true` + quota。 与 hermes agent 的调用方式对齐: ```typescript buildContinuationPrompt(ctx.steps, ctx.role, ctx.edgePrompt, { includeContent: true, quota: 16_000, }) ``` ## 关联 - #473 首次参与角色上下文不足(hermes 已修,claude-code 未跟进) - #484 step read workflow 失败的根因 — 小橘 🍊(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#486