Frozen state: start cold rebuilds and inspection from the latest whole copy

未关闭
#5,324 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

Read the implementation of recoverStateContext, createRunStateHydrator, and workflow inspect, along with the events API and the whole-copy format described in #5215. First trace how each reader currently pages and applies events; then investigate descending pagination, skip-step-inputs, multi-log inputs, and StateSrcV1 hook payloads. Done means the three readers can start from the latest usable whole copy while replay still reads the full log.

由索引模型根据 Issue 内容生成。

描述

Follow-up from #5215.

Frozen state is now written whole each time it doubles, and after every 1,000 changes, so a rebuild never has to apply more than about the value's own size of changes. But every reader still reads the run's log from the start:

  • cold recovery (recoverStateContext) pages through every event from the beginning;
  • the o11y hydrator (createRunStateHydrator) and workflow inspect do the same.

So the whole copies bound the apply work, not the read. On a 180-turn eve session, a cold rebuild at turn 180 took 228 ms: 60 ms parsing and 168 ms applying, both proportional to the whole log.

Proposal: have these readers read the log newest-first until they reach the latest whole copy of each version they need, then apply forward from there. A cold read is then bounded by about twice the value's size rather than the length of the run. Replay is unaffected: it reads the full log anyway.

Open questions:

  • the events API needs to support descending pages with skip-step-inputs;
  • a step input can refer to more than one log, so the reader has to keep going until every needed log has reached a whole copy;
  • hook payloads that hold strings a patch refers to (StateSrcV1) may come before that whole copy.

🤖 Generated with Claude Code

主要语言
TypeScript
星标
2.5k
派生
401
平均合并
1 天 21 小时
30 天内合并 PR
201

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vercel/workflow 的其他 Issue

查看 vercel/workflow 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。