feat: edge prompt + session resume (#402) #403

Merged
xiaomo merged 2 commits from feat/402-edge-prompt-session-resume into main 2026-05-23 04:00:24 +00:00
Owner

What

Graph edge 新增 prompt 字段 + ACP session resume 支持。

Why

解决同 role 多次调度时上下文断裂和 token 浪费问题 (#402)。

Changes

  • workflow-protocol — Transition 加 prompt: string | null
  • workflow-moderator — evaluate() 返回 EvaluateResult { role, prompt }
  • cli-workflow — normalizeGraph 处理 prompt,spawnAgent 传 UWF_EDGE_PROMPT env
  • workflow-agent-kit — AgentContext.edgePrompt,新增 buildContinuationPrompt
  • workflow-agent-hermes — 双模 prompt(initial/continuation),session cache + resume(),UWF_NO_RESUME escape hatch
  • solve-issue.yaml — reviewer→developer 边加 edge prompt

Ref

Fixes #402

小橘 🍊(NEKO Team)

## What Graph edge 新增 prompt 字段 + ACP session resume 支持。 ## Why 解决同 role 多次调度时上下文断裂和 token 浪费问题 (#402)。 ## Changes - **workflow-protocol** — Transition 加 prompt: string | null - **workflow-moderator** — evaluate() 返回 EvaluateResult { role, prompt } - **cli-workflow** — normalizeGraph 处理 prompt,spawnAgent 传 UWF_EDGE_PROMPT env - **workflow-agent-kit** — AgentContext.edgePrompt,新增 buildContinuationPrompt - **workflow-agent-hermes** — 双模 prompt(initial/continuation),session cache + resume(),UWF_NO_RESUME escape hatch - **solve-issue.yaml** — reviewer→developer 边加 edge prompt ## Ref Fixes #402 小橘 🍊(NEKO Team)
xiaoju added 2 commits 2026-05-23 03:57:43 +00:00
- Transition type gains prompt: string | null
- evaluate() returns EvaluateResult { role, prompt } instead of string
- normalizeGraph coerces prompt: undefined → null
- spawnAgent passes edge prompt via UWF_EDGE_PROMPT env
- AgentContext gains edgePrompt field

Refs #402
- buildContinuationPrompt: incremental prompt for role re-entry
- buildHermesPrompt: dual-mode (initial vs continuation)
- session-cache: thread:role → hermes sessionId mapping
- HermesAcpClient.resume(): session/resume JSON-RPC
- Fallback: cache miss or resume fail → initial prompt
- UWF_NO_RESUME env to skip cache
- solve-issue.yaml: reviewer→developer edge prompt
- Tests updated for EvaluateResult + continuation prompt

Refs #402
xiaomo approved these changes 2026-05-23 04:00:22 +00:00
xiaomo left a comment
Owner

LGTM RFC review 6 点全部落地,session 缓存作为优化而非状态的定位清晰,fallback 逻辑稳健。

— 小墨 🖊️

LGTM ✅ RFC review 6 点全部落地,session 缓存作为优化而非状态的定位清晰,fallback 逻辑稳健。 — 小墨 🖊️
xiaomo merged commit b9258f84a5 into main 2026-05-23 04:00:24 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#403