Phase Testing: Dashboard SSE live stream (#131) #133

Closed
opened 2026-05-08 09:37:46 +00:00 by xingyue · 0 comments
Owner

验证目标

Thread detail 页面实时显示 thread 输出,无需刷新。

前置条件

# Terminal 1: 启动 API server
cd ~/Code/workflow && uncaged-workflow serve

# Terminal 2: 启动 dashboard
cd ~/Code/workflow/packages/dashboard && bun run dev

测试步骤

  • Step 1: useSSE hook 文件存在且导出正确

    cat packages/dashboard/src/use-sse.ts
    

    预期: 文件存在,导出 useSSE 函数,接受 threadId: string | null 参数,返回 { records, connected, completed }

  • Step 2: SSE endpoint 连接测试

    # 假设有一个 running thread
    curl -N http://localhost:7860/api/threads/<thread-id>/live
    

    预期: 返回 SSE 流(event: record + data: {...}),连接保持打开

  • Step 3: Dashboard build 通过

    cd packages/dashboard && npx vite build
    

    预期: build 成功,无 TS 错误

  • Step 4: 全量测试通过

    cd ~/Code/workflow && bun test
    

    预期: 所有测试通过

  • Step 5: Thread detail 页面显示 Live badge
    打开 http://localhost:5173,点击一个 thread,查看页面
    预期: 如果 thread 正在运行,显示绿色 "● Live" 徽章

  • Step 6: 代码规范

    bunx biome check packages/dashboard/
    

    预期: 无 error(warning 可接受)

  • Step 7: 无 ?: 可选属性

    grep -rn '?:' packages/dashboard/src/use-sse.ts
    

    预期: 无匹配(使用 T | null 代替)

验证完成标准

所有 checkbox 打勾
代码 review 通过
build 成功

Ref

Part of #131, #118

## 验证目标 Thread detail 页面实时显示 thread 输出,无需刷新。 ## 前置条件 ```bash # Terminal 1: 启动 API server cd ~/Code/workflow && uncaged-workflow serve # Terminal 2: 启动 dashboard cd ~/Code/workflow/packages/dashboard && bun run dev ``` ## 测试步骤 - [ ] **Step 1: useSSE hook 文件存在且导出正确** ```bash cat packages/dashboard/src/use-sse.ts ``` **预期:** 文件存在,导出 `useSSE` 函数,接受 `threadId: string | null` 参数,返回 `{ records, connected, completed }` - [ ] **Step 2: SSE endpoint 连接测试** ```bash # 假设有一个 running thread curl -N http://localhost:7860/api/threads/<thread-id>/live ``` **预期:** 返回 SSE 流(`event: record` + `data: {...}`),连接保持打开 - [ ] **Step 3: Dashboard build 通过** ```bash cd packages/dashboard && npx vite build ``` **预期:** build 成功,无 TS 错误 - [ ] **Step 4: 全量测试通过** ```bash cd ~/Code/workflow && bun test ``` **预期:** 所有测试通过 - [ ] **Step 5: Thread detail 页面显示 Live badge** 打开 http://localhost:5173,点击一个 thread,查看页面 **预期:** 如果 thread 正在运行,显示绿色 "● Live" 徽章 - [ ] **Step 6: 代码规范** ```bash bunx biome check packages/dashboard/ ``` **预期:** 无 error(warning 可接受) - [ ] **Step 7: 无 `?:` 可选属性** ```bash grep -rn '?:' packages/dashboard/src/use-sse.ts ``` **预期:** 无匹配(使用 `T | null` 代替) ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ 代码 review 通过 ✅ build 成功 ## Ref Part of #131, #118
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#133