I Run a Fleet of AI Agents Across Three Machines. Here's What Broke. - Kyle Jaejun Lee, KRAFTON https://www.youtube.com/watch?v=4kYl2_mqmnQ AI Engineer · 9 min · 165 sentences · sentence-level transcript from YouTube's caption track; each line begins at the time shown [00:00] Hello, I'm Kyle. [00:01] I run a fleet of AI coding agents across three machines every day, and this is the story of what broke, starting with me. [00:08] This is my fleet, three machines I run every single day. [00:12] The MacBook is where I do my heavy coding and my personal projects, and it sleeps because, well, it's a laptop. [00:18] Then two Linux boxes, both headless and always on. [00:21] Linux A takes the long-running coding tasks. [00:24] Linux B runs my short-lived personal side projects. [00:28] Two operating systems, one control plane tying it all together. [00:31] And to be clear, this isn't a demo I spun up for the talk. [00:35] This is what I actually use all day, every day. [00:39] And here it is live, the whole thing running on one screen. [00:42] Real agents, real work. [00:43] This is a normal Tuesday for me. [00:45] So, let's go back to the beginning because before any machine broke, I broke. [00:49] When I started, it was just me and a terminal. [00:53] A few tmux panes, a few agents, then a few more. [00:56] And really fast, I'm sitting in front of four, five, six live contexts at the same time. [01:02] And here's what nobody warns you about. [01:04] At that point, I'm not running agents anymore. [01:07] I've become the scheduler, deciding who does what. [01:09] I'm the memory, holding what every one of them is doing, and I'm the reviewer, checking all of it. [01:14] One human, three roles, six contexts. [01:17] It does not scale. [01:19] This This is the mess that broke me. [01:22] I just couldn't hold what six agents were doing at once. [01:25] My own attention was the bottleneck. [01:28] So, I asked myself kind of a strange question. [01:30] How does a handful of executives run a company of thousands of people? [01:34] They don't hold all of it in their heads. [01:36] They separate context. [01:37] Each person only ever sees their own slice. [01:40] And that was the unlock. [01:41] What if my agents weren't a flat pile? [01:43] What if they were an organization? [01:46] So, that's what I built, a hierarchy, CEO, VP, manager, worker. [01:50] And please hear me on this. [01:51] These are real entity types in the system. [01:54] It is not a cute metaphor. [01:55] Each one is its own agent with its own scoped context and its own approval boundary. [02:00] Context flows down. [02:02] Each layer only gets the slice it needs. [02:04] Results flow back up and I only review what reaches the very top. [02:08] So, instead of holding six contexts in my head, I hold exactly one. [02:12] Next problem, where does an agent's state actually live? [02:16] Normally, it lives inside the model's context window and that window fills up. [02:20] So, I moved it out. [02:21] Every entity gets its own workspace on disk. [02:24] Shared context that everyone has to honor lives in shared. [02:28] Machine-bound state lives under machines. [02:30] And inside each workspace, the mission, the current status, and a handoff folder, the actual work product that gets passed along. [02:38] The state lives in files. [02:40] It is not trapped inside one model. [02:42] And this is the single most practical thing I learned all year. [02:46] When that window fills up, the built-in move is to compact, summarize the history, make room. [02:52] I stopped doing it. [02:53] It's slow. [02:54] I can't choose what survives. [02:55] And whatever it throws away is just gone. [02:57] So, instead, I don't compact, I reset. [03:00] And by reset, I mean right inside Claude, I clear the context completely. [03:05] And then it just reads back the handoff and the history files it wrote for itself and picks up exactly where it left off. [03:13] The context can get wiped, the machine can even crash, and the work still survives because it was never only in the model. [03:20] But there was still one problem, alignment. [03:22] Plans flow down the hierarchy, but they drift. [03:26] And I'd only catch it by walking into each pane by hand. [03:29] So, I built a review gateway. [03:31] Any layer that wants to act submits its plan and then it blocks. [03:34] It waits. [03:35] Nothing runs until I approve. [03:37] And the second I approve, a hook fires the work off automatically. [03:40] One web inbox, one control point, I never walk into the work windows anymore. [03:45] Here's one full cycle. [03:47] A plan comes in, I approve, the work resumes. [03:50] That's the whole loop. [03:51] And honestly, I didn't build this gateway by hand. [03:54] An infra team inside the fleet built it. [03:57] Agents building the tools that run the agents. [03:59] I think that's kind of the whole point. [04:02] So on one machine, all of this works beautifully. [04:05] And then it didn't. [04:06] Then one machine wasn't enough. [04:08] Five things broke. [04:10] Failure. [04:10] One, my agents kept doing the work themselves instead of dispatching it down to a worker. [04:15] The orchestrator is supposed to delegate. [04:18] Instead, it just rolls up its sleeves and does the task itself. [04:21] Wrong. [04:22] So I forced its hand. [04:24] A CLI harness with skills that call those CLIs. [04:27] So dispatching becomes the only path it can take. [04:30] Failure two, and this one's almost funny. [04:33] As I kept throwing more tasks at my managers, they kept spinning up more and more worker panes inside a single window until it was so crowded the panes were too small to read. [04:44] Even tmux capture pane, the thing I used to read a pane programmatically, couldn't pull anything meaningful out of them anymore. [04:51] I'd literally run out of room to see what my own fleet was doing. [04:55] Failure three, out of memory. [04:56] Look at this. [04:57] That's my activity monitor, completely buried under cloud code and MCP processes. [05:02] Swap almost full. [05:03] Basically no free memory left. [05:05] The sessions just stacked up until the machine couldn't breathe. [05:09] Failure four, get credentials. [05:11] The expectation is clean. [05:13] Credential A to workspace A, credential B to workspace B, one to one. [05:18] The reality, they collided, crossed over, bound to the wrong workspaces. [05:23] The fix was a clean, fully separated environment for each workspace. [05:27] And failure five, the one that really hurt. [05:31] The MacBook is a laptop, so the moment it loses power or drops off the network, every in progress job dies with it. [05:38] And one time I'd pushed so many workers onto it that the whole machine just gave out. [05:43] I came back later, opened the lid, and it had already restarted itself. [05:48] Everything in flight just gone. [05:50] So, the very first thing I did was build a boot command, one overlord boot, and the whole fleet comes straight back up because all the state was sitting in files. [05:59] But a machine that can just vanish on you like that, that's when I knew one machine wasn't going to cut it. [06:04] Every single one of these pointed at the same answer. [06:07] So, I added machines. [06:09] Here's the split. [06:10] The MacBook was carrying everything, heavy coding and my personal projects. [06:14] So, I offloaded it. [06:15] Long-running coding tasks went to Linux A, short-lived personal projects went to Linux B, both always on. [06:21] More resources, the long-running work finally off the laptop, and still one control plane over all of it. [06:27] But now I've got context on one machine that I need on another. [06:31] How do I move it? [06:32] Git. [06:32] I commit the context files and push. [06:34] Then I poke the other machine with tmux send-keys over SSH and tell it to pull. [06:39] It pulls, the agent there reads the files, and picks up exactly where the first one left off. [06:44] Of course, it wasn't that clean. [06:45] When two machines point at the same directory and both change it, you get conflicts. [06:50] The same context quietly diverged, so I separated it. [06:53] Per-machine directories for machine-specific state, and the shared stuff only changes through a pull request. [07:00] It's boring, but boring is what stops the two machines from silently disagreeing. [07:04] Then the gateway came back to bite me. [07:07] I now had one on every machine, so I was checking multiple inboxes again. [07:12] So, I collapsed them. [07:13] Every machine sends its review requests over SSH into one main gateway, and that main one lives on an always-on Linux box because, remember, the Mac sleeps. [07:23] Your one point of control can't be a thing that falls asleep. [07:27] And then, my absolute favorite failure of the whole project. [07:30] I was developing across all of these, bouncing back and forth, and at one point I went looking for a feature I'd built, and I genuinely could not remember which machine I'd built it on. [07:40] And that's when it clicked. [07:42] I need one place to root from. [07:44] So, Discord became my single router. [07:46] One bot per machine. [07:47] Mac, Linux A, Linux B. My phone is now the remote control for the entire fleet. [07:53] So, where am I now? [07:54] Honestly, with a pile of things I have not solved. [07:56] Four of them. [07:57] Consistency across machines, abstracting away the local only tools that are still stuck on my Mac, the MCP servers, the browser, secure credential handoff between instances, and resource management. [08:08] I really want to stop being the one who decides what runs where. [08:12] And when I lined those four up, I realized these aren't new questions at all. [08:16] An agent should just declare what it needs, not where it runs. [08:20] Above it sits the orchestrator, the review gate, the logical hierarchy. [08:24] Below it, compute, secrets, tools. [08:27] A scheduler places it, and the machines just disappear underneath. [08:31] These are the exact questions Kubernetes already answers. [08:35] So, that's where I'm headed. [08:36] I'm not going to reinvent compute, secrets, and tools. [08:39] Kubernetes already nailed those. [08:41] I'm stacking them underneath, and building my orchestration manager on top. [08:45] Task orchestration, review flow, context management. [08:48] Reuse what exists, build the new part on tops. [08:52] And that's the honest state of it. [08:54] One machine, I solved. [08:56] Across machines, still rough, still building. [08:58] If you're running agents at any kind of scale, I'd genuinely love to compare notes, because this is the part nobody has figured out yet. [09:05] I'm on LinkedIn and on X. Links are in the description. [09:08] Thank you so much.