bug: ocas gc deletes uwf thread/step CAS nodes (false orphans) #93

Closed
opened 2026-06-07 08:19:52 +00:00 by xiaoju · 0 comments
Owner

现象

ocas gc 把 uwf 的 workflow/thread/step CAS 节点全部删除。

# gc 前
total: 219, reachable: 29
# gc 后
total: 29, reachable: 29, collected: 190

uwf 的 solve-issue workflow hash、planner step hash 等全部消失,导致 uwf thread execCAS node not found

原因

ocas gc 的 mark 阶段从 variables (@ocas/*, @uwf/*) 开始遍历。uwf 的 thread/step 数据通过 @uwf/thread/* variables 指向 head step hash,但 gc 的 mark 可能没有完全遍历 step chain 里引用的所有 CAS 节点(workflow hash、detail hash、中间 step 等),导致它们被认为是不可达的孤儿节点。

也可能是 @uwf/registry/* 注册的 workflow hash 没被 gc mark 遍历到。

复现

  1. uwf workflow add examples/solve-issue.yaml — 注册 workflow
  2. uwf thread start solve-issue -p "..." — 创建 thread
  3. uwf thread exec <id> --agent uwf-hermes — 跑一个 step
  4. ocas gc — 观察 collected 数量,之后 uwf thread show <id> 会报 CAS not found

影响

  • 所有进行中的 uwf thread 数据丢失
  • 必须重新注册 workflow 和重开 thread
  • 今天已经被坑了两次

建议

gc mark 需要遍历所有 @uwf/* variables 指向的完整 CAS chain(包括 step 的 prev/detail/start refs)。

小橘 🍊(NEKO Team)

## 现象 `ocas gc` 把 uwf 的 workflow/thread/step CAS 节点全部删除。 ``` # gc 前 total: 219, reachable: 29 # gc 后 total: 29, reachable: 29, collected: 190 ``` uwf 的 `solve-issue` workflow hash、planner step hash 等全部消失,导致 `uwf thread exec` 报 `CAS node not found`。 ## 原因 `ocas gc` 的 mark 阶段从 variables (`@ocas/*`, `@uwf/*`) 开始遍历。uwf 的 thread/step 数据通过 `@uwf/thread/*` variables 指向 head step hash,但 gc 的 mark 可能没有完全遍历 step chain 里引用的所有 CAS 节点(workflow hash、detail hash、中间 step 等),导致它们被认为是不可达的孤儿节点。 也可能是 `@uwf/registry/*` 注册的 workflow hash 没被 gc mark 遍历到。 ## 复现 1. `uwf workflow add examples/solve-issue.yaml` — 注册 workflow 2. `uwf thread start solve-issue -p "..."` — 创建 thread 3. `uwf thread exec <id> --agent uwf-hermes` — 跑一个 step 4. `ocas gc` — 观察 collected 数量,之后 `uwf thread show <id>` 会报 CAS not found ## 影响 - 所有进行中的 uwf thread 数据丢失 - 必须重新注册 workflow 和重开 thread - 今天已经被坑了两次 ## 建议 gc mark 需要遍历所有 `@uwf/*` variables 指向的完整 CAS chain(包括 step 的 prev/detail/start refs)。 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#93