thread list: 增加过滤和分页参数(status active、时间范围、skip/take) #471

Closed
opened 2026-05-24 13:29:56 +00:00 by xiaoju · 0 comments
Owner

需求

thread list 目前只支持 --status <idle|running|completed> 单值过滤,缺少常见的列表查询能力。

期望的参数

Status 增强

  • --status active — idle + running 的快捷方式(排除 completed)
  • 支持多值:--status idle,running

时间范围

  • --after <date> — 只返回该时间之后创建的线程
  • --before <date> — 只返回该时间之前创建的线程
  • 格式支持 ISO 日期和相对时间(如 2025-05-207d

分页

  • --skip <n> — 跳过前 n 条
  • --take <n> — 最多返回 n 条(默认不限)

示例

uwf thread list --status active                    # idle + running
uwf thread list --status idle,completed            # 多值
uwf thread list --after 2025-05-20                 # 最近几天
uwf thread list --after 7d --status completed      # 最近一周完成的
uwf thread list --take 10                          # 最新 10 条
uwf thread list --skip 10 --take 10                # 第二页

备注

时间过滤需要从 CAS 节点取 timestamp,可能需要考虑性能(history.jsonl 条目多时)。ULID 本身编码了时间戳,可以直接从 thread ID 提取,不需要读 CAS。


小橘 🍊(NEKO Team)

## 需求 `thread list` 目前只支持 `--status <idle|running|completed>` 单值过滤,缺少常见的列表查询能力。 ## 期望的参数 ### Status 增强 - `--status active` — idle + running 的快捷方式(排除 completed) - 支持多值:`--status idle,running` ### 时间范围 - `--after <date>` — 只返回该时间之后创建的线程 - `--before <date>` — 只返回该时间之前创建的线程 - 格式支持 ISO 日期和相对时间(如 `2025-05-20`、`7d`) ### 分页 - `--skip <n>` — 跳过前 n 条 - `--take <n>` — 最多返回 n 条(默认不限) ## 示例 ```bash uwf thread list --status active # idle + running uwf thread list --status idle,completed # 多值 uwf thread list --after 2025-05-20 # 最近几天 uwf thread list --after 7d --status completed # 最近一周完成的 uwf thread list --take 10 # 最新 10 条 uwf thread list --skip 10 --take 10 # 第二页 ``` ## 备注 时间过滤需要从 CAS 节点取 timestamp,可能需要考虑性能(history.jsonl 条目多时)。ULID 本身编码了时间戳,可以直接从 thread ID 提取,不需要读 CAS。 --- 小橘 🍊(NEKO Team)
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#471