Accept hook_created in event batches so a run's boot hooks can go out in one write

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

The request sits between the client batch path (createWorkflowRunEventBatch, which only rejects hook_received) and the backend batch route, which currently refuses hook_created with "Unsupported eventType 'hook_created' in an event batch". Start by reading the batch response validator, since it expects each item's event type to match its request and would reject a hook_created answered with hook_conflict. Done means the backend accepts hook_created batches with per-item conflict reporting and the validator accepts that response. This touches the backend service, so it needs maintainer input on the protocol before a first-timer should attempt it.

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

描述

A run's first delivery writes its boot suspension's events one at a time through the in-band writer. On the Vercel World, each hook_created is its own fenced POST (~50–80ms), and inline step claims wait behind them. eve creates a Workflow AbortController for its first turn at boot (one hook as of vercel/eve#6446, previously two), so every new session pays for that write before its first step can start. A message resumed into the run while those writes are in flight also waits for them.

I tried writing a suspension's plain hook creations (distinct tokens, no metadata, abort, force or dispose) as one createBatch from startSuspensionHookWrites. The backend refuses it:

Unsupported eventType 'hook_created' in an event batch

The client side already allows it: createWorkflowRunEventBatch only rejects hook_received. One gap there: the batch response validator expects each item's event type to match its request, so a hook_created answered with hook_conflict would fail validation, where the single-event path accepts it.

Would it be possible for the batch route to accept hook_created (and answer a taken token with a per-item hook_conflict)? With that, a boot's hooks and its inline step claims could go out as one write. Rough estimate from eve's boot traces: 50–150ms off a new session's first output, depending on how many hooks it creates.

🤖

主要语言
TypeScript
星标
2.5k
派生
401
平均合并
2 天 36 分钟
30 天内合并 PR
150

环境准备

  • 没有 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 摘要。