ux: thread list defaults to active threads only #147

Closed
opened 2026-06-07 05:15:43 +00:00 by xiaoju · 1 comment
Owner

现状

uwf thread list 默认输出所有 thread(包括 completed/cancelled),当前有 440 条,其中 296 completed + 143 cancelled + 1 idle。输出巨大且无用信息过多。

期望

  • 默认:只显示 active thread(idle + running
  • --status <status>:按状态过滤(已有,保持不变)
  • --all:显示所有状态(包括 completed/cancelled)

改动范围

packages/cli/src/commands/thread.tscmdThreadList 里改默认 filter 逻辑。

很小的改动,一行代码级别。

小橘 🍊(NEKO Team)

## 现状 `uwf thread list` 默认输出所有 thread(包括 completed/cancelled),当前有 440 条,其中 296 completed + 143 cancelled + 1 idle。输出巨大且无用信息过多。 ## 期望 - **默认**:只显示 active thread(`idle` + `running`) - `--status <status>`:按状态过滤(已有,保持不变) - `--all`:显示所有状态(包括 completed/cancelled) ## 改动范围 `packages/cli/src/commands/thread.ts` — `cmdThreadList` 里改默认 filter 逻辑。 很小的改动,一行代码级别。 小橘 🍊(NEKO Team)
Author
Owner

补充建议

1. 默认行为(核心改动)

  • 无参数 → 只显示 idle + running
  • --status <status> → 按状态过滤(已有,保持不变)
  • --all → 显示所有状态(含 completed/cancelled)

2. 输出精简

当前输出每条都带 workflow: "" 等空字段(CAS 丢失后 workflow hash 无法解析)。建议:

  • 空的 workflow / currentRole 不输出或显示 -
  • completed/cancelled 的输出可以更紧凑(不需要 suspendedRole, suspendMessage 等字段)

3. 数量统计(--all 时)

全量输出时在末尾加 summary:

{ "active": 1, "completed": 296, "cancelled": 143, "total": 440 }

让用户快速了解规模,不需要数 JSON 行。

4. thread clean / thread prune(后续可选)

当前 440 条里 439 条是历史。可以考虑加一个清理命令:

uwf thread clean              # 清理所有 completed/cancelled
uwf thread clean --before 7d  # 清理 7 天前的

这个可以开独立 issue,不必在本 issue 做。

— 小橘 🍊(NEKO Team)

## 补充建议 ### 1. 默认行为(核心改动) - 无参数 → 只显示 `idle` + `running` - `--status <status>` → 按状态过滤(已有,保持不变) - `--all` → 显示所有状态(含 completed/cancelled) ### 2. 输出精简 当前输出每条都带 `workflow: ""` 等空字段(CAS 丢失后 workflow hash 无法解析)。建议: - 空的 `workflow` / `currentRole` 不输出或显示 `-` - completed/cancelled 的输出可以更紧凑(不需要 `suspendedRole`, `suspendMessage` 等字段) ### 3. 数量统计(`--all` 时) 全量输出时在末尾加 summary: ``` { "active": 1, "completed": 296, "cancelled": 143, "total": 440 } ``` 让用户快速了解规模,不需要数 JSON 行。 ### 4. `thread clean` / `thread prune`(后续可选) 当前 440 条里 439 条是历史。可以考虑加一个清理命令: ``` uwf thread clean # 清理所有 completed/cancelled uwf thread clean --before 7d # 清理 7 天前的 ``` 这个可以开独立 issue,不必在本 issue 做。 — 小橘 🍊(NEKO Team)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#147