Skip navigation
Just created a PR from a github issue via a serverless background agent, and it's entirely…
0:00 / 3:44

Just created a PR from a github issue via a serverless background agent, and it's entirely…

Kyle Mistele 🏴‍☠️

@0xblacklight8.5K followers

Visit on X
203 likesDownloadOriginal post

32,746 views

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. - 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 ( think kinda like Pi in effect; fully isomorphic, runs anywhere) infra is built on Cloudflare workers and durable objects via alchemy - 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 a good example of it in action:

15 Comments

Comments from the original post on X (Twitter)

  • geoff's profile picture

    @GeoffreyHuntley

    Kyle, ya'll just rebuilt the OTP, but a little bit weirdly.

    4 likes

  • Kyle Mistele 🏴‍☠️'s profile picture

    @0xblacklight

    the one-time password?

    1 like

  • geoff's profile picture

    @GeoffreyHuntley

    ya, if you need one you’ll find em in the mailbox. sometimes in the dlq

  • Kyle Mistele 🏴‍☠️'s profile picture

    @0xblacklight

    i mean yeah

  • geoff's profile picture

    @GeoffreyHuntley

    rewrite human layer in erlang. dax said it’s fine and dex approves.

    1 like

  • Kyle Mistele 🏴‍☠️'s profile picture

    @0xblacklight

    built in @EffectTS_ btw

    3 likes

  • parsa's profile picture

    @ParsaKhaz

    Do u ever sleep

    3 likes

  • Leonardo Trapani's profile picture

    @leo_trapani

    So bullish

    2 likes

  • Dan van der Merwe's profile picture

    @danieljvdm

    I've also built this and have been considering open sourcing it as some reusable layer... cf computer + artifacts is such a nice combo. Though I find cf computer a little less attractive now since containers got way faster

    1 like

  • Alex Kolovsky's profile picture

    @kolovskydev

    does the write-access check cover the other comments in a mention's batch, or just whoever did the mention?

    1 like

  • Rohan Bhanot's profile picture

    @RohanBhanotAI

    Issue to PR without babysitting the session is the real factory win. Does the agent get a spend and egress cap on that serverless run, or is the merge review the only gate?

  • Jun's profile picture

    @cloneisjun

    replaying a github delivery twice would test whether the mailbox can create duplicate pull requests.

  • Alex | Wu's profile picture

    @DavidAgentic

    When the agent decides it needs the container, does it pay a cold start mid-session, or do you pre-warm on certain event types like CI failures? Curious where the line ended up between "virtual fs is enough" and "boot it".

  • kartik bhardwaj's profile picture

    @kartikb753

    Going from a github issue to a PR through a serverless background agent is a clean building block for a software factory. I would be curious how you handle the agent getting stuck midway, whether it retries from a checkpoint or restarts the run.

  • Carlos's profile picture

    @heyimcarlos_dev

    very frigging cool.