refactor: unified thread storage + resume completed threads #45
Reference in New Issue
Block a user
Delete Branch "refactor/39-unified-thread-storage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
统一 thread 存储 + 支持 resume completed thread(衔尾蛇:end → start)。
Why
Changes
Phase 1: 统一存储(3 commits)
protocol 包:
ThreadIndexEntry加status+completedAt字段markThreadCompleted()新函数createThreadIndexEntry/updateThreadHead/markThreadSuspended适配新字段cli 包 store.ts:
@uwf/thread/*,用 tag 表达 statusHISTORY_VAR_PREFIX、ThreadHistoryLine、deleteThreadloadActiveThreads、loadHistoryThreads、completeThread@uwf/history/*→@uwf/thread/*cli 包 thread.ts:
deleteThread + addHistoryEntry→completeThread()findHistoryEntryfallbackPhase 2: 衔尾蛇 resume
uwf thread resume支持 completed 状态$START重新进入 workflow graph--supplement传递新信息测试
425 tests pass (protocol + cli)
Tag 模型
statusidle | suspended | completed | cancelledsuspendedRolesuspendMessagecompletedAtCloses #39, #40, #41, #42, #43
LGTM ✅
统一存储 + 衔尾蛇 resume 实现很干净。迁移逻辑幂等安全,测试覆盖全面。
一个小问题不 block:
collectCompletedThreads里workflow: ""— 完成的 thread 在 list 里会显示空 workflow,旧代码从 history entry 带了 workflow hash。可以后续用resolveWorkflowFromHead补上。