feat: moderator recognizes $SUSPEND as pseudo-role target #588

Closed
opened 2026-06-02 03:58:44 +00:00 by xiaomo · 0 comments
Owner

Parent

RFC #587

What

Moderator 的 evaluate() 识别 $SUSPEND 伪 role target,类似 $END 的处理方式。

Changes

workflow-protocol

  • WorkflowPayload 类型/校验:graph target role 允许 $SUSPEND
  • 新增 thread status: suspended(与 idle/running/done 并列)

cli-workflow (moderator)

  • evaluate() 遇到 role: $SUSPEND 时返回特殊结果(类似 $END),包含:
    • action: 'suspend'
    • suspendedRole: 产生 suspend 的 role 名
    • prompt: 渲染后的 prompt 模板(给用户的消息)
  • Thread 状态设为 suspended

Test

  • evaluate: status 路由到 $SUSPEND → 返回 suspend action
  • evaluate: $SUSPEND prompt 模板正确渲染 mustache 变量
  • thread status 更新为 suspended

Ref

RFC #587

## Parent RFC #587 ## What Moderator 的 `evaluate()` 识别 `$SUSPEND` 伪 role target,类似 `$END` 的处理方式。 ## Changes ### workflow-protocol - `WorkflowPayload` 类型/校验:graph target role 允许 `$SUSPEND` - 新增 thread status: `suspended`(与 `idle`/`running`/`done` 并列) ### cli-workflow (moderator) - `evaluate()` 遇到 `role: $SUSPEND` 时返回特殊结果(类似 `$END`),包含: - `action: 'suspend'` - `suspendedRole`: 产生 suspend 的 role 名 - `prompt`: 渲染后的 prompt 模板(给用户的消息) - Thread 状态设为 `suspended` ## Test - evaluate: status 路由到 `$SUSPEND` → 返回 suspend action - evaluate: `$SUSPEND` prompt 模板正确渲染 mustache 变量 - thread status 更新为 suspended ## Ref RFC #587
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#588