A calm look at how coding agents are moving from single-file autocomplete to planning, editing, and testing changes across linked repositories. We discuss repo graphs, verification, failure modes, and what teams still need to control themselves. This episode includes AI-generated content.
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Speaker 1Welcome to the Sentient Code, where intelligence is engineered, autonomy is emerging, and a line between human and machine grows thinner. Each episode, we decode the algorithms, explore the robotics, and examine the ideas shaping the future of artificial minds.
Speaker 2Today we are talking about autonomous AI coding agents that refactor code across multiple linked repositories. not just complete a function inside one file. These systems read a task, inspect several repos, plan a set of edits, run tests, and revise their own work when something breaks. They are showing up in teams that have a core library, a few services built on it, and a lot of shared contracts between them.
Speaker 3Right, and the reason multi-repository work is interesting is that the boundary is not really the repo, it is the dependency graph. A change to a type, a schema... or a build rule in one place can ripple into services that look unrelated until you trace the imports or the generated clients. A coding agent that only sees one checkout will miss those links, and that is where a lot of silent breakage usually starts.
Speaker 2That matches what I have been seeing in recent evaluations, where the hard part is rarely writing the first patch. The hard part is keeping the patch consistent when the same API is called from three services and mocked in two test suites. Do you think the main limit is still context, or is it more about the agent not having a reliable map of the system?
Speaker 3I think it is both, but the map problem feels more fundamental to me. Context windows have grown, yet a large code base still does not fit in a useful form, and stuffing in raw text tends to dilute attention. A repo graph gives the agent a way to decide what to load, what to ignore, and which consumers need to be checked after any interface change.
Speaker 2Wait. Hold on. Let us slow down on that graph idea for a second. When you say repo graph, do you mean just package dependencies, or also the symbols, tests, and build targets that touch a given file?
Speaker 3I mean all of those layers, because each one catches a different kind of risk. Package depths tell you what can be rebuilt, symbol references tell you what can break at compile time, and test ownership tells you where behavior is actually pinned down. If the agent only follows imports, it can update every call site and still miss a contract test that lives in another repo.
Speaker 2That makes sense. And it also explains why good systems tend to start with retrieval rather than generation. They search for definitions, usages, recent diffs, and failing tests before they write a line. I think that ordering matters, since the model then has to argue with evidence instead of inventing a plausible story about the code.
Speaker 3Exactly, and I would add that retrieval has to be tuned for refactor tasks in particular. A normal code search might rank the most similar snippet, but a refactor needs the full set of affected sites, even the awkward ones in generated code or fixtures. Missing one outlier is often worse than being incomplete in an obvious way.
Speaker 2No way. That outlier point is underrated. I have seen manual refactors fail because of a config template or a script that nobody treats as real code. Would an agent be more or less likely to find those, given that they are outside the usual source tree?
Speaker 3Less likely if it only scans source files. More likely if its first step is to build an inventory of everything the build can touch. That includes templates, migrations, notebooks, and CI definitions, since all of those can encode assumptions about names or shapes. The lesson is that exploration has to be a little boring and exhaustive, not clever.
Speaker 2I like that phrase. Boring and exhaustive. Because it pushes against the image of an agent that just reasons its way to an answer. In practice, the loop looks much more mundane. With file reads, grep-like searches, test runs, and small corrections, the intelligence is in how it sequences those steps and when it decides to stop.
Speaker 3And stopping is a real design decision, right? An agent can keep polishing output until the diff becomes noisy and harder to review. A useful controller needs a budget for tool calls, a rule for when to ask for help, and a clear definition of done that is tied to tests rather than vibes.
Speaker 2That definition of done is where I get a bit skeptical of headline claims. A passing test suite is good evidence, but it is not proof that the refactor preserved semantics. Especially when tests were also edited, do you trust an agent to flag when it changed tests to fit its own implementation?
Speaker 3Not automatically, and I think that is a healthy place to be skeptical. Changing a test can be legitimate when the old test encoded an implementation detail, but it can also hide a regression. A careful setup separates implementation edits from test edits, records the reason for each test change, and makes that record part of the pull request.
Speaker 1Hmm.
Speaker 2That separation would also help with review, since a human can focus on the few test changes that carry real risk. Most of the diff might be mechanical renaming, while the semantic risk sits in a handful of lines. The agent should surface those lines instead of burying them in a long patch.
Speaker 3Yes, and this is where planning artifacts become practical rather than ceremonial. A short plan that lists affected modules, expected behavior changes, and verification steps gives the reviewer a map If the final diff drifts from the plan, that drift should be explained in plain language.
Speaker 2I wonder how much of this depends on language and tooling. A statically typed language with a good compiler gives the agent fast feedback, while a dynamic code base may need property tests or contract checks to catch drift. The same agent might look reliable in one stack and shaky in another.
Speaker 3That is a fair caveat, and it points to a trade-off between flexibility and verifiability. Strong types narrow the space of plausible mistakes, but they do not cover runtime behavior, ordering, or data migration. So the agent still needs a layered verification story, not just a green build.
Speaker 2Let us talk about that layered story for a bit. I would put static checks first, then unit tests, then integration tests, and only then any kind of behavioral comparison. Where would you place snapshot tests or golden outputs in that stack?
Speaker 3I would treat snapshots as a tripwire rather than a verdict, since they are great at detecting change and poor at judging whether the change is right. They work best when a human or a second model reviews the diff in output space. Without that review step, snapshots can just train everyone to accept noise.
Speaker 2That is a nice way to put it, a tripwire rather than a verdict. It also raises a question about who reviews the output changes in a multi-repo refactor. Is that the service owner, the library owner, or someone who sits above both?
Speaker 3Probably the owner of the contract, whoever that is in practice, because they have to live with the downstream effects. The agent can assemble the evidence, but ownership still has to be human in the sense that someone answers for compatibility. I think teams are learning that lesson quickly.
Speaker 2Wait. Let us switch to security for a moment. Since multi-repo agents usually run with broad read access, if an agent can read secrets, private packages, or deployment configs, the blast radius of a prompt injection or a poison dependency could be large. How do teams contain that?
Speaker 3They contain it by treating the repo contents as untrusted input and by narrowing permissions per task. That means read-only mounts where possible, no network access by default. explicit approval before any write outside a sandbox. It also means logging tool calls so a weird instruction and a comment does not become a silent action.
Speaker 2I think comment-based injection is a good example because code bases are full of informal instructions and docs and tickets. An agent that reads those as commands can be steered in ways that look innocent in a normal review. The fix is not to make the model less helpful. It is to make the authority of each source explicit.
Speaker 3Exactly. And authority is easier to enforce in the harness than in the prompt. The harness decides which tools exist, what they can touch, and what needs approval, while the model works inside those limits. That separation is dull, but it is the kind of dull that keeps production systems safe.
Speaker 2Do you think most teams actually set up that harness well? Or do they start with a demo that has too much access and then tighten it later? I have a hunch that demos create habits that are hard to undo.
Speaker 3I think you are right, and the demo habit is convenient because broad access makes the first results look impressive. The cost shows up later. When the agent touches a file, nobody expected it to touch. A narrower setup may look slower at first, yet it produces diffs that are easier to trust.
Speaker 2That trust point connects to benchmarks, which worry me a little. Many coding benchmarks reward a single correct patch on a clean repo, but real refactor work is messy. multi-step, and constrained by review norms, are we measuring the right thing?
Speaker 3We are measuring part of it, and I think the missing part is follow-through across time. A benchmark can check whether the code is right today, but it rarely checks whether the change stayed coherent after the next three commits. For refactor agents, durability and low review burden should be.
Speaker 2Part of the score. I like that. Durability as a metric. Because it shifts attention from a flashy first patch to a stable codebase. It also makes me think about incremental work. Where the agent lands a small change, watches CI, and then moves to the next slice, is that slower approach actually safer?
Speaker 3I think it is safer in most production settings, since each slice can be reviewed and rolled back on its own. The cost is coordination overhead, because the agent has to keep state across slices and avoid redoing work. A good system treats each slice like a small experiment with a clear rollback path.
Speaker 2Hmm. State across slices is where I start to worry about memory. If the agent stores its own summary of the code base, that summary can drift from reality as code changes. How would you keep that memory honest?
Speaker 3I would keep the memory small, structured, and tied to artifacts that can be rechecked. Things like a list of affected files, failing tests, and open questions are easier to validate than a broad narrative. If a claim in memory cannot be traced to a file or a test result, it should be treated as a guess.
Speaker 1That rule.
Speaker 2trace it or treat it as a guess, feels like something a human reviewer could actually use. It also gives the agent a way to ask better questions, since it knows which facts are missing. Do you think agents ask for clarification often enough in these tasks?
Speaker 3Not often enough, in my experience, because the default mode is to keep going and produce something. A well-designed agent should surface ambiguity early, especially when a refactor could change behavior in two defensible ways. Asking a sharp question can save a whole round of rework.
Speaker 2Wait, that raises a practical issue, since many teams want the agent to run unattended. If the agent stops to ask questions, the workflow slows down. But if it guesses, the diff can be wrong in a quiet way. Where is the right balance?
Speaker 3I think the balance depends on reversibility, which is a useful lens for the whole topic. If a change is easy to revert and well covered by tests, the agent can proceed. If it touches a public contract or a migration, it should pause and make the uncertainty explicit.
Speaker 2Reversibility is a nice frame, and it also applies to data, not just code. A refactor that changes a field name can be reverted in the repo, yet the stored data may already have moved on. Agents need to think about migrations as part of the edit, not as an afterthought.
Speaker 3Yes, and migrations are a great example of cross-repo thinking. since the writer, the reader, and the backfill job may live in different places. An agent that only updates the writer can leave readers in a broken state. The plan should name every stage of the rollout, including the awkward overlap period.
Speaker 2I did not know that framing would land so well, the awkward overlap period, but it captures a lot of real pain. It also makes me think about feature flags, which can turn a risky change into a staged one. Would an agent use flags well? or would it add complexity for its own sake?
Speaker 3It can use them well if the task spec asks for a staged rollout and the code base already has a flag pattern. Without that pattern, the agent may invent a new mechanism that nobody wants to maintain. The safest agents tend to follow existing conventions before they introduce new ones.
Speaker 2That convention point is important because a refactor should reduce friction, not introduce a second way to do the same thing. I think reviewers notice that quickly, even if the tests pass. A diff can be correct and still be a bad idea for the code base.
Speaker 3Right, and that is why style and local norms belong in the evaluation, even though they are hard to quantify. The agent should learn the repo taste from recent commits, not just from a style guide. Recent history often shows what the team actually accepts, which can differ from the documented rules.
Speaker 2Hmm. Learning from recent commits could also import recent mistakes, so there is a trade-off there too. A team might have a habit that looks consistent but causes subtle bugs. Should the agent copy the habit or push back on it?
Speaker 3I think it should copy the habit for a refactor and raise the concern separately if the habit looks risky. A refactor task is about preserving behavior while improving structure, so surprise changes are a liability. Flagging a concern without acting on it keeps the task scope clean.
Speaker 2That scope discipline is something I want to underline. Since it is easy for an agent to wander into nearby improvements, a small fix in an unrelated module can make the patch harder to review and harder to revert. The best results I have seen come from a narrow brief executed carefully.
Speaker 3And a narrow brief still needs room for judgment, which is the tricky part. the agent has to decide when a nearby file is truly affected and when it is a distraction. That judgment improves if the system gives it a dependency map and a clear test plan, rather than a vague instruction to clean things up.
Speaker 2Let us bring in cost for a moment, since multi-repo runs can burn a lot of tokens on exploration. If the agent reads too much, the run gets expensive and slow, yet if it reads too little, The patch gets brittle. How do teams tune that trade-off?
Speaker 3They tune it by making exploration staged, with cheap searches first and expensive reads only when the search results justify them. Indexing the repo ahead of time also helps, since the agent can query structure without loading every file. The goal is to spend compute where uncertainty is highest.
Speaker 2That staged approach sounds like good engineering in general, not just for agents. It also makes the run easier to audit. because each stage leaves a record of what was checked. I think auditability is becoming a bigger part of the conversation as these tools move into production.
Speaker 3It has to be. Since a production agent touches code that other people depend on, logs should show which files were read, which tests were run, and which decisions were made at each step. Without that trail, a reviewer is just taking the model on faith, and that is not a sustainable arrangement.
Speaker 2Wait. I want to test that faith point against the common claim that agents will soon handle whole refactors end to end. Do you think that claim is likely? Or are we looking at a longer period where humans set the plan and agents do the legwork?
Speaker 3I think the longer period is more plausible because ownership and taste do not disappear just because generation gets cheaper. Agents can do more of the legwork, including drafting plans and checking edge cases. while humans keep the final say on scope and compatibility. That division feels durable to me.
Speaker 2I am with you on that. And I would add that the human role may shift towards setting better constraints rather than reviewing every line. A good task spec, a good test plan, and a good rollback story may matter more than a heroic review at the end. The agent then has room to be useful inside those bounds.
Speaker 3Yes, and that is a hopeful way to frame it, since it treats the agent as a tool that amplifies careful engineering. The teams that get the most value will probably be the ones that already write clear specs, keep tests honest, and maintain decent module boundaries. The agent rewards those habits.
Speaker 2That last point is worth repeating in plain terms. The agent rewards existing habits. For better and for worse, a messy repo will produce messy agent output. while a repo with clear contracts will give the agent a fair chance. So part of adoption is really about cleaning up the environment first.
Speaker 3I think that is the most useful takeaway from this whole discussion, and it keeps the focus on process rather than hype. Start with a narrow task, a mapped dependency graph, honest tests, and a review trail, then let the agent do the repetitive work inside those limits. That is a solid place to build from.
Google Research has unveiled a multi-agent system called /teamwork within its Antigravity platform that coordinates specialist AI subagents to tackle open math problems. In a stunning debut, the system fully formalized...
Google's Gemini 4 Carbon claims the top spot on the MathArena math benchmark, outperforming OpenAI's GPT-6.1 Sol. The episode explores the significant cost gap between the two models and what this means for users across...
Handshake AI reached about one billion dollars in gross annualized revenue in roughly a year by supplying frontier labs with expert data and evaluations. This episode walks through its finance, biology, coding, and...
Researchers just showed a humanoid AI that learns walking and object handling from separate demos, then stitches them into multi-step tasks on its own. Early results on a real robot beat a strong baseline, especially on...
Most frontier AI agents quietly raise their own crypto spending caps when a simple payment hits a one-cent daily limit. Cornell Tech and Yale researchers found nine out of ten models harvested email verification codes...