跳到正文
dex· @dexhorthy · X·· 2 小时前AI 评分58
AI 导读

HumanLayer 的 @0xblacklight 展示了通过 serverless 后台 agent 从 GitHub issue 直接创建 PR 的方案,全部开源。方案包含 effect-channels(effect-native 的 slack/linear/github webhook 订阅)和 fold agent 运行时,基于 Cloudflare Workers 与 Durable Objects,每个 issue/PR 有独立 mailbox,agent 默认在虚拟文件系统上运行,仅在需要时通过 FUSE 挂载启动容器执行重型命令,工具由 webhook 事件生成并支持将工作移交外部系统(如 k8s 集群)后回传流式更新。代码见 github.com/humanlayer/effect-channels 与 github.com/humanlayer/fold。

正文

he cook

引用Kyle Mistele 🏴‍☠️@0xblacklight
Just created a PR from a github issue via a serverless background agent, and it's entirely open-source at humanlayer we have been thinking a lot about what good open-source software factory building blocks look like to push on this I built something I've wanted for a long time: a hands-outside-the-box approach of running a lightweight agent in a runtime with a virtual fs, and only using a container when necessary - faster, cheaper, etc combined with really good webhook / event bindings for GitHub, slack, and linear we built two components for it: 1. http://github.com/humanlayer/effect-channels - effect-native webhook subscriptions for slack/linear/github; like the @vercel chat SDK but effect + more opinionated about software factories; handles threading & debouncing event deliveries and stuff like that 2. mentions & other events spin up our Fold harness (http://github.com/humanlayer/fold, think kinda like @pidotdev in effect; fully isomorphic, runs anywhere) infra is built on @cloudflare workers and durable objects via @alchemy_run - each thread/channel/issue/pr gets its own mailbox, subject to delivery policies (queue, debounce, batch) mailbox messages wake a fold agent session running in a Durable object, without a sandbox to start it uses cloudflare/computer for a virtual DO-backed filesystem for each issue/PR's git branch the agent can run most commands it wants against the DO's virtual filesystem and the agent can boot a container with the FS mounted into it via FUSE only when it decides it needs one to run heavier commands tools are generated from the webhook event so the agent gets tightly-scoped tools to e.g. create a pr from the issue it's on, or to list failing checks only from the PR it's bound to; plus it's easy to interleave deterministic code it has live progress updates, can react to issues in its thread, etc (linear + slack modules support their respective streaming agent activity & agent plan APIs; for github we fudge it a bit by editing issues in live time) it even has an API so agent work can be handed off to another system (e.g. a k8s cluster that has super thick sandboxes if you need > standard-4 sized-containers from cloudfalre) and that system can post back streaming updates & update the status of the agent run, so it's pretty de-coupled it's wired to automatically investigate CI failures and some other neat stuff open-source at https://github.com/humanlayer/effect-channels/tree/main/examples/alchemy-cloudflare a good example of it in action: https://github.com/humanlayer/fold/issues/60 https://alchemy.run https://www.npmjs.com/package/@cloudflare/computer
在 X 查看被引用的帖子

来源:dex · x.com