Skip to content

chore: add official Cloudflare PiHarness spike - #437

Merged
bubbleptr merged 1 commit into
mainfrom
chore/durable-cloudflare-spike
Oct 4, 2026
Merged

bubbleptr merged 1 commit into
mainfrom
chore/durable-cloudflare-spike

Conversation

@bubbleptr

@bubbleptr bubbleptr commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

变更

新增隔离的 Cloudflare Spike,验证官方 agents@0.26.0 的 PiHarness + Lifecycle 能否承载 Pi Durable。一个具名 Durable Object 持有一个 Harness,通过 HTTP 提交、查询操作和输出原生 Pi 事件流;稳定 operation ID 支持重试去重。SQLite 适配与 alarm 唤醒直接使用官方实现。

本地 workerd 实验覆盖双客户端观察、重连快照、观察者退出后继续执行、整个 runtime 重建后的数据保持,以及专用恢复 fixture 中的安全工具重放和不安全工具中断。恢复测试等待新实例主动报告操作完成后才查询结果,避免查询本身制造恢复证据。

范围是本地确定性 faux 模型;未部署云端、未调用真实 LLM,也未接入现有 Pace / Web / TUI 协议。运行指南和证据边界见 docs/research/durable-cloudflare-spike.md。现有生产会话路径无修改。

验证

  • 根目录 bun run typecheck、bun run lint、bun run test、bun run build 通过;168 个测试文件、1977 项测试。
  • Spike bun run typecheck、bun run test、bun run build 通过;2 个文件、6 项测试。恢复实验使用 SDK 原始约 30 秒 alarm,未修改内部时钟。
  • bun install --frozen-lockfile 通过;Worker 构建为 Wrangler dry-run,没有上传。
  • 真实 wrangler dev HTTP 冒烟通过:首次接受、结果完成、重复提交拒绝重复接受、事件快照只有一条用户输入。

依赖与 bundle 固定到当前实验版本;PiHarness 为 Beta。恢复 fixture 与 HTTP 网关使用不同 Worker 入口,结果不应解读为生产容灾验收。


Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment on lines +76 to +77
if (request.method === "GET" && path[3] === "operations" && path[4]) {
return Response.json(await this.harness.wait(path[4], { signal: request.signal }));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 Unbounded operation IDs reach operation waits

A request with an oversized or malformed operationId reaches harness.wait without the submit endpoint's validation. Untrusted IDs can consume resources or cause unexpected errors instead of returning a validation response.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@bubbleptr
bubbleptr merged commit 2315db6 into main Oct 4, 2026
2 checks passed
@bubbleptr
bubbleptr deleted the chore/durable-cloudflare-spike branch October 4, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant