Courses / Design a Software Factory for Your Coding AgentsFreeLesson 6 of 103:45

Isolate Every Agent Run

Run locally while you are one or two people, move execution to a cloud VM as the team grows, and give each task its own worktree. A hook cleans up the worktrees the agent leaves behind.

Play Isolate Every Agent Run

Transcript

So when you when you are a very small team, when you are just one person, you can just execute in your local environment. That's completely fine. when you are actually a larger team, then automatically your local will become a bottleneck because whatever memory that has been added to your coding session, it will be inside your local, it is not shared. So, how you are going to consolidate that context or what are all the processes that can be done. We are not talking about, you know, we are not going to talk very depth about the context and all those things, context engineering in that sense. In terms of execution, when you are just one or two, then you can use local execution. When you are three, four, then you can you know create your own execution layer in a VM. Like now, yesterday, I believe digital ocean have created digital ocean managed agent or something like that, like agentic runtime or something like that. So you can rent it's more like E2B, it's a sandbox environment where you can spin up, spin down, and you can execute whatever agentic task you want, and they they rent CPU in a mini-scale like a serverless kind of, but it is not exactly serverless. It it holds for long-running process. So that that is what I'm saying, like digital ocean have released something like that, and of course, it's not that difficult to run on a on a VM. even in a static Hetzner or you know Vulture kind of or digital ocean machine can be enough to run these agents because we are not going to run any bigger LLM or anything, mostly it is spinning up one or two headless processes and so on, so it will be much easier to run on a cloud VM, and then verification. Now, each task, this is one of the things related to the execution. I think one of the main things which you can do when even when you are doing it in your local is creating work tree. So you can even run 10 different tasks and you can create each individual work tree, and you can you know, without with having isolated context, you can run one, two, three, and your branches untouched. So your main branch, and then you can create enough work tree and branches, and then you can create on that. So even though your code is in local, it is not going to be corrupted because of someone else, some other agent is going to write to that same branch. Now look at it in a factory level. So that's that's a post hook that we need to write. that is where I think cloud VMs are better, You spin up, you spin down, and the memory is destroyed from there. But in local, it always creates the branch and work tree, but it won't clean it up. That's a very good actual point where you can define the boundary that whenever you do spin up work tree and you can create a post hook that you know, always clean up these these these steps and always finish with that. And even you know, you can commit and push it to the branch. you can define that as a as a hook.

This lesson is cut from the free Lightning session Design a Software Factory for Your Coding Agents. The Live Labs build the same system with you, free, on Thursdays: see the Live Labs.