Phase 2 Testing: Engine 层 — executeThread + workflowAsAgent 双向链接 (#194) #196

Closed
opened 2026-05-12 01:33:03 +00:00 by xiaoju · 0 comments
Owner

验证目标

workflowAsAgent spawn 子 thread 时写入 parentState,子 thread 完成后父 state node 写入 childThread。

测试步骤

  • Step 1: executeThread 接受 parentStateHash

    grep "parentStateHash" packages/workflow-execute/src/engine/engine.ts
    

    预期: executeThread options 或参数中包含 parentStateHash,传给 putStartNode

  • Step 2: workflowAsAgent 传递父 head state

    grep "parentState" packages/workflow-execute/src/workflow-as-agent.ts
    

    预期: spawn 子 thread 时从 AgentContext 获取当前 head state hash 并传入

  • Step 3: 子 thread 返回最终 state hash

    grep "childThread\|finalState\|rootHash" packages/workflow-execute/src/workflow-as-agent.ts
    

    预期: workflowAsAgent 返回值包含子 thread 最终 state hash

  • Step 4: 集成测试 — 双向链接验证

    bun test packages/workflow-execute --filter "workflow-as-agent"
    

    预期: 新增测试:父 state node 的 childThread 指向子 thread 最终 state;子 start node 的 parentState 指向父 head state。通过 cas get 可双向遍历。

  • Step 5: 全量测试

    cd ~/repos/workflow && bun run build && bun test
    

    预期: 全量通过

验证完成标准

所有 checkbox 打勾
build 通过
双向链接可通过 CAS 遍历验证

Ref: #194

## 验证目标 `workflowAsAgent` spawn 子 thread 时写入 parentState,子 thread 完成后父 state node 写入 childThread。 ## 测试步骤 - [ ] **Step 1: executeThread 接受 parentStateHash** ```bash grep "parentStateHash" packages/workflow-execute/src/engine/engine.ts ``` **预期:** `executeThread` options 或参数中包含 `parentStateHash`,传给 `putStartNode` - [ ] **Step 2: workflowAsAgent 传递父 head state** ```bash grep "parentState" packages/workflow-execute/src/workflow-as-agent.ts ``` **预期:** spawn 子 thread 时从 AgentContext 获取当前 head state hash 并传入 - [ ] **Step 3: 子 thread 返回最终 state hash** ```bash grep "childThread\|finalState\|rootHash" packages/workflow-execute/src/workflow-as-agent.ts ``` **预期:** `workflowAsAgent` 返回值包含子 thread 最终 state hash - [ ] **Step 4: 集成测试 — 双向链接验证** ```bash bun test packages/workflow-execute --filter "workflow-as-agent" ``` **预期:** 新增测试:父 state node 的 childThread 指向子 thread 最终 state;子 start node 的 parentState 指向父 head state。通过 cas get 可双向遍历。 - [ ] **Step 5: 全量测试** ```bash cd ~/repos/workflow && bun run build && bun test ``` **预期:** 全量通过 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ build 通过 ✅ 双向链接可通过 CAS 遍历验证 Ref: #194
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#196