feat: uwf thread resume command #590

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

Parent

RFC #587

What

新增 uwf thread resume <thread-id> -p "补充信息" 命令,恢复 suspended thread。

Flow

  1. 校验 thread status == suspended,否则报错
  2. 从 thread metadata 读取 suspendedRole
  3. 构造 prompt:原 role 的 graph prompt + resume 补充信息
  4. suspendedRole 执行一个新 step(复用 cmdThreadStep 逻辑)
  5. Thread 恢复为 idle 状态
  6. 清除 suspendedRole / suspendMessage

CLI

uwf thread resume <thread-id> -p "这是补充的信息"
uwf thread resume <thread-id>  # 无补充信息,仅 resume(让 agent 重新尝试)

Changes

  • cli-workflow: 新增 resume 子命令
  • 复用 step 执行逻辑,注入 resume prompt

Test

  • resume 非 suspended thread → 报错
  • resume suspended thread → 执行新 step → status 变 idle
  • resume 带 -p → 补充信息出现在 agent prompt 中
  • resume 不带 -p → agent 用原 prompt 重新执行
  • 多次 suspend/resume 循环

Ref

RFC #587, depends on #588, #589

## Parent RFC #587 ## What 新增 `uwf thread resume <thread-id> -p "补充信息"` 命令,恢复 suspended thread。 ## Flow 1. 校验 thread status == `suspended`,否则报错 2. 从 thread metadata 读取 `suspendedRole` 3. 构造 prompt:原 role 的 graph prompt + resume 补充信息 4. 以 `suspendedRole` 执行一个新 step(复用 `cmdThreadStep` 逻辑) 5. Thread 恢复为 `idle` 状态 6. 清除 `suspendedRole` / `suspendMessage` ## CLI ```bash uwf thread resume <thread-id> -p "这是补充的信息" uwf thread resume <thread-id> # 无补充信息,仅 resume(让 agent 重新尝试) ``` ## Changes - `cli-workflow`: 新增 `resume` 子命令 - 复用 step 执行逻辑,注入 resume prompt ## Test - resume 非 suspended thread → 报错 - resume suspended thread → 执行新 step → status 变 idle - resume 带 -p → 补充信息出现在 agent prompt 中 - resume 不带 -p → agent 用原 prompt 重新执行 - 多次 suspend/resume 循环 ## Ref RFC #587, depends on #588, #589
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#590