feat: uwf thread read — human-readable markdown output with pagination #349

Closed
opened 2026-05-19 02:31:23 +00:00 by xiaoju · 0 comments
Owner

需求

uwf thread read <thread-id> 以 markdown 格式输出 thread 内容,支持分页。

输出格式

直接输出 markdown 文本(不走 --format json|yaml)。

分页参数

  • --quota <number> — 字符配额,回溯逐个 step 加载直到超出 quota 后停止(可以超但超后停止回溯)。不传给默认值。
  • --before <step-hash> — 不含指定 hash,从该 hash 之前开始回溯。
  • --start — 包含 start step。

不传 before 时(默认)

打印 start step + 最新的 N 个 step(按 quota 计算):

{start step}

*(skip N steps, query with `uwf thread read <id> --before <hash>`)*

{latest steps within quota}

传 before 时

不打印 start:

*(skip N steps, query with `uwf thread read <id> --before <hash>`)*

{steps before the specified hash, within quota}

steps 里不包含 start。

Markdown 格式参考

# Thread 06F3VR64X0JYZ0HCD348TJQ4HG

**Workflow:** 8AA1TK356FY1Z (solve-issue)
**Prompt:** Write a hello world Python script...

---

*(3 earlier steps, load with `uwf thread read 06F3... --before ABCDEF1234567`)*

---

## Step 2: planner \`A6GRTB8AJ0F9F\`
**Agent:** uwf-hermes | **Time:** 2026-05-19 01:37

plan: The issue has been successfully resolved...
steps:
  - Created hello.py...

---

## Step 3: developer \`XXXXXXXXXXXX\`
...

实现要点

  • output 用 yaml stringify 展示(更 readable)
  • timestamp 转 human-readable 时间
  • 复用现有的 walkChain / resolveHeadHash / expandOutput
  • 这是独立的子命令,不影响现有 thread steps(JSON/YAML 结构化输出)
## 需求 `uwf thread read <thread-id>` 以 markdown 格式输出 thread 内容,支持分页。 ## 输出格式 直接输出 markdown 文本(不走 `--format json|yaml`)。 ## 分页参数 - `--quota <number>` — 字符配额,回溯逐个 step 加载直到超出 quota 后停止(可以超但超后停止回溯)。不传给默认值。 - `--before <step-hash>` — 不含指定 hash,从该 hash 之前开始回溯。 - `--start` — 包含 start step。 ### 不传 before 时(默认) 打印 start step + 最新的 N 个 step(按 quota 计算): ``` {start step} *(skip N steps, query with `uwf thread read <id> --before <hash>`)* {latest steps within quota} ``` ### 传 before 时 不打印 start: ``` *(skip N steps, query with `uwf thread read <id> --before <hash>`)* {steps before the specified hash, within quota} ``` steps 里不包含 start。 ## Markdown 格式参考 ```markdown # Thread 06F3VR64X0JYZ0HCD348TJQ4HG **Workflow:** 8AA1TK356FY1Z (solve-issue) **Prompt:** Write a hello world Python script... --- *(3 earlier steps, load with `uwf thread read 06F3... --before ABCDEF1234567`)* --- ## Step 2: planner \`A6GRTB8AJ0F9F\` **Agent:** uwf-hermes | **Time:** 2026-05-19 01:37 plan: The issue has been successfully resolved... steps: - Created hello.py... --- ## Step 3: developer \`XXXXXXXXXXXX\` ... ``` ## 实现要点 - output 用 yaml stringify 展示(更 readable) - timestamp 转 human-readable 时间 - 复用现有的 `walkChain` / `resolveHeadHash` / `expandOutput` - 这是独立的子命令,不影响现有 `thread steps`(JSON/YAML 结构化输出)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#349