AI 导读
HumanLayer 完全开源了一套从 GitHub issue 自动创建 PR 的 serverless 后台 Agent 方案,包含 effect-channels 和 Fold 两个组件,基于 Cloudflare Workers 与 Durable Objects 构建。每个 issue/PR/频道有独立 mailbox,Agent 默认在虚拟文件系统上运行,仅在需要时经 FUSE 挂载启动容器执行更重的命令;工具由 webhook 事件生成并被严格限定范围,支持 Slack、Linear、GitHub 的实时进度更新,还可把工作移交给带厚沙箱的外部系统。代码见 github.com/humanlayer/effect-channels,示例见 github.com/humanlayer/fold/issues/60。
正文
he cook
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