dex· @dexhorthy · X·· 3 小时前AI 评分57
AI 导读
HumanLayer 的 @0xblacklight 展示了一个完全开源的方案:从 GitHub issue 出发,由无服务器后台 Agent 自动创建 PR。其核心是轻量 Agent 运行在带虚拟文件系统的运行时中,仅在需要执行较重命令时才通过 FUSE 挂载启动容器,以更快更省。配套开源两个组件:effect-channels 提供 effect 原生的 Slack/Linear/GitHub webhook 订阅,fold 提供可随处运行的 Agent harness。基础设施基于 Cloudflare Workers 和 Durable Objects(经 alchemy.run 构建),每个 thread/channel/issue/PR 有独立 mailbox,Agent 会话由 mailbox 消息唤醒,使用 cloudflare/computer 提供基于 DO 的虚拟文件系统,工具由 webhook 事件生成并严格限定作用域,支持实时进度更新,还可把工作移交到 k8s 等其他系统并回传流式状态。示例见 https://github.com/humanlayer/fold/issues/60,代码在 https://github.com/humanlayer/effect-channels/tree/main/examples/alchemy-cloudflare。
正文
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