Authors’ overview
Manual repair of program failures is time-consuming and disruptive for software developers, particularly during the pre-submit phase where test failures occur within continuous integration systems. While Automated Program Repair has seen significant advancement through Large Language Models, existing state-of-the-art techniques primarily focus on post-submit workflows, operating offline without the low-latency requirements necessary to assist developers in real-time within their flow before they switch context. In this paper, we introduce FlowAgent, an AI agent deployed at Google to automatically repair test failures in the pre-submit outer-loop workflow inside continuous integration systems. Integrated into Google’s internal developer tools, Critique and Cider,FlowAgent utilizes a ReAct-style generate-and-validate loop, as well as rigorous pre-execution and post-execution abstention filters to ensure high-quality suggestions under strict latency constraints. Based on our case studies, FlowAgent is highly effective. First, a manual evaluation conducted on 195 real-world test failures demonstrated 67.18% accuracy in suggesting correct fixes. Following its Google-wide deployment, FlowAgent suggested fixes on 295,508changes, of which developers previewed 65,069 and applied 28,554. Developer feedback from interviews indicate that the agent is useful in suggesting correct fixes, integration of autonomous repair agents into industrial software engineering workflows is received well, while interesting challenges and opportunities still remain.
Introduction
Software developers frequently modify codebases to add new features, fix bugs, or improve system security and performance. To ensure these modifications do not introduce regressions into the wider codebase, they must be rigorously tested. When code modifications result in test failures, developers must engage in program repair. This process is time-consuming and disruptive, particularly in the outer-loop pre-submit phase, where test failures occur outside the developers’ integrated development environments (IDE) within the continuous integration systems, like Google’s TAP, to identify global regressions before a change is submitted.
Upon notification of a failure, developers typically investigate the failure and implement fixes. Our analysis reveals that the median time between a failure notification and a developer’s subsequent code edit at Google is FixAttemptLatencyP50. This provides a critical window where automated repair assistance could meaningfully improve developer velocity and reduce frustration.
To alleviate the burden of manual debugging, the field of Automated Program Repair (APR) has received significant attention. Early APR solutions relied on manually described mutation rules, symbolic constraints, and static analysis. More recently, the advent of Large Language Models (LLMs) has driven a shift toward machine learning and autonomous agent-based APR. State-of-the-art tools such as SWE-Agent, AutoCodeRover, Google’s Passerine and Meta’s Engineering Agent utilize ReAct-style loops to autonomously navigate codebases, utilize tools, and generate fixes. However, these approaches primarily focus on the post-submit workflow, designed to repair programs in an offline capacity, operating without latency constraints required to assist developers in real-time before they switch context out of their flow.
In this paper, we introduce AutoRepair, an AI agent deployed at Google to automatically debug and repair test failures directly within the pre-submit outer-loop workflow. Successful fixes, alongside an AI-generated summary of the root cause and the fix, are surfaced in Google’s internal development tools, allowing developers to preview and apply fixes inside their habitual workflows.
To the best of our knowledge, unlike post-submit APR tools, AutoRepair is the first APR system in the pre-submit outer-loop workflow built to operate under critical latency requirements to catch developers in their active change modification flow.
We provide a comprehensive empirical evaluation of AutoRepair with, to the best of our knowledge, the largest industrial dataset reported to date, starting first with a manual evaluation, then continuing over a multi-month period in production. We discuss AutoRepair’s success in obtaining valid fixes for thousands of failures, and present detailed telemetry and qualitative insights derived from adoption and user interviews, highlighting developer preferences, tooling adoption behaviors, and the varying levels of trust developers place in AI-generated code repairs.
Manual Program Repair
Developers modify code for many reasons, e.g. to fix bugs, to add new features, to improve performance or security. Once code is modified, in one or more files, developers create a change, a mutation to the code repository, reviewed and submitted atomically.
Outer-Loop Pre-Submit Developer Tools
Critique: This is the internal web-based code review system at Google. After a developer changes code in Cider, they create a change with the modifications. Before sending the change to other developers for review, automated tools and regression tests run on the changed version of the code to help the owner with findings and suggested fixes by showing notifications on relevant parts of the code, or the entire change itself.
Developers typically start coding in Cider, as they get ready to finish their modifications, they create a change and run analyses in Critique, at which time TAP may uncover failing tests due to the changes. Once notified of failures, developers then investigate and attempt to fix the failing tests by modifying their change or the tests themselves in Cider, manually or using assistive tooling.
Fix attempt latency is the opportunity window to help developers with test failures, either by providing root cause analysis information or suggesting a potential fix, before they attempt to keep working on the change to fix the tests themselves, and it is FixAttemptLatencyP25 at p25, and FixAttemptLatencyP50 at p50.
Automated Program Repair With AutoRepair
With the recent advances in AI, autonomous AI coding agents have shown great success on automated program repair (APR). To help developers in program repair, we propose AutoRepair, an autonomous agent integrated into Google’s developer tooling to automatically debug and repair pre-submit outer-loop test failures.
Agentic Repair
If the loop finishes successfully and produces a fix diff, we conduct a final validation step, either by confirming that the agent executed the tests in its last validation cycle, or by executing the tests and checking the result again. This additional validation is necessary, as LLMs are known to hallucinate, and without final deterministic validation, there is a risk of showing a potentially invalid fix to developers.
If the verification is successful, we summarize the failure root cause and the fix by making a single call to the LLM and passing the transcript of the entire trajectory of the generate-and-validate loop above, with the prompt shown in Listing 4.
Showing Fixes to Developers
Developers have varying preferences on the environment where they tend to preview and apply fixes. Some developers prefer using Critique, as the fixes are posted there first, while others prefer going back to the Cider IDE, as they are more used to making changes there. To maximize developer adoption, AutoRepair is integrated into both Critique and Cider.
Manual Evaluation
Based on the experts’ reporting, AutoRepair was successful in suggesting correct fixes in TotalEvalExamplesGood of the failures, resulting in a TotalEvalAccuracy success rate. For the remaining 64 cases, the fixes were either incorrect or not exactly correct, discussed below with examples.
System Trigger
A significant subset of the changes get skipped at this stage, as AutoRepair targets human-authored, viable fix attempts. This points to future improvement opportunities to attempt fixing a wider set of code changes, including non-human authored, and larger changes.
Fix Attempts
AutoRepair successfully generated a suggested fix for TotalChangesAttemptedSuccessful changes. Unsuccessful attempts are due to the limits placed on the agent execution to avoid running for too long, as users may get notified of the failing tests and attempt to fix them manually themselves.
Successful but Dropped Fix Suggestions
Some of the fixes may still be relevant even though the developer modified the change, as they may have modified unrelated files. However, such fixes may confuse developers, and potentially cause conflicts with the developer’s changes. As a result, they are dropped entirely by post-execution filters.
Even though AutoRepair is optimized for low latency, a non-negligible share of successful fixes are still dropped by the post-execution filters, pointing to a need for further latency improvements to catch developers in their change modification flows.
Suggested Fixes
Then, there are cases where AutoRepair suggested reverting the modifications in the change, essentially undoing developer’s modification intent. Such suggestions should not be suggested to developers and have also been noted as future improvements to be addressed in the agent.
User Interviews
We conducted 45 minute in-person interviews with TotalInterviewedDevelopers developers from TotalInterviewedDevelopers different groups that have been working at Google for at least 6 months, that previewed and/or applied suggested fixes either in Critique or in Cider, with excerpts discussed below. In this section, we summarize key learnings based on the participants’ responses.
Perceptions on AutoRepair
Then, we asked participants their prediction on how AutoRepair works, and they all reported that it is most likely an AI-based product, as the fix suggestions it provides are not likely to come from a non-AI tool, and its name suggests it uses AI.
As a follow up, we asked them if this creates bias in their expectations of AutoRepair’s suggested fixes. As DeveloperA summarized it, participants reported that it does not matter where the suggestion comes from as long as it is relevant and accurate.
[DeveloperF]: This [workflow] is really great. It’s in-line with a lot of Critique workflows, so it’s following the same pattern to not have to think what type of review it is because the approach is always the same.
Root Cause Summaries in Findings
[DeveloperE]: It pulled out the conclusion and put it at the top of the message, […] know relatively fast glance what the error was; if this didn’t exist, it would have taken longer to dig through what the actual error was.
[DeveloperF]: This information is helpful; usually have to go into test logs, but now it’s putting all the information in front, saves time; wouldn’t have to go into logs, filter by error, don’t need to scan all of that, have summarized info; can skip step of finding the issue.
Previewed and Applied Fixes
[DeveloperG]: Did you guys implement AutoRepair on Critique? This thing is amazing! It fixed [change]. I updated some code, then the test failed cause it was using a bunch of mocks. I hate updating these types of tests.
[DeveloperH]: Thanks for developing and maintaining a tool which I find very promising and useful for developer velocity! Even my very first experience makes me excited about offloading the grungy task of looking at multiple documentation and past solved bugs to find easy parameter changes to fix tests.
Previewed but Not Applied Fixes
[DeveloperB]: To be honest, I was frustrated by the broken […] all day. I’ve manually debugged the problem, and it was cumbersome to find the root cause across so many different layers. I can confirm that your agent’s output is correct, and it would have saved me a lot of time if I had seen it before manually digging through the logs.
[DeveloperF]: I have a second monitor, or third monitor depending on where I am working […], but my Cider is already open there. So instead of going to click Show Fix, apply the fix, […], I just move my mouse over […] and amend my code, in case I get into a [conflict] or something weird.
Finally, participant DeveloperI reported that even if they fix the failures themselves, having an agent independently provide feedback is useful, as the agent has its own context on the intent of the change and the resulting failure.
Usability Feedback
During the interviews, several participants asked for a feature to have an estimate of the remaining time until AutoRepair finishes, so that they can decide whether to wait for its fix suggestion or to fix the failures themselves.
Although we could not add the feature immediately, as it is not supported in Critique, we observe that developers are adapting to working with AI agents to take decisions on their waiting behaviors. We are currently working on addressing this by adding additional mechanisms to notify users that AutoRepair is working on the failures on their change.
Threats To Validity
Manual evaluation: Our manual evaluation was conducted by three experienced developers. However, these developers did not own the production or test code of the failing tests, and may have made mistakes in their reporting of the accuracy of AutoRepair fixes.
Filters: The pre-execution filters are implemented based on early feedback from a small group of AutoRepair users. As a significant set of changes are skipped due to these filters, our evaluation results may not generalize to the changes with such characteristics.
Developer bias: AutoRepair suggests fixes for all eligible code changes across Google. However, developers have varying positive/negative judgments on the use of AI and AI assistance in their development journeys. As we do not control for such variables in our evaluation of the previews and applies of the fixes, this may have introduced a selection bias, and biased the accuracy and validity of our results.
Additionally, the interviews were conducted with code change authors that volunteered to give feedback. This constitutes a self-selected group, users who did not participate in our surveys and interviews might have different perspectives that could alter the qualitative insights gained from those sessions.
Developer infrastructure: Our case study was conducted within the specific context of Google’s development environment and infrastructure. Although all internal tools have corresponding products in the industry, our findings may not be generalizable to other organizational settings.
LLM: Our study uses an internal version of Gemini 2.5 Pro. Although popular large LLMs have been shown to perform well on tasks such as coding, the generalizability of our results to other LLMs may be limited.
Related Work
Non-machine learning based APR: Several techniques approach APR as a search problem with manually described mutation rules and repair patterns, or semi-automatic transformation rules derived from human implemented patches. Some approaches use symbolic constraints to extract fixes, while others use static analysis to identify and then repair bugs, and some methods replace faulty code with similar but correct code from the same codebase.
Machine learning based APR: Early work uses machine learning techniques to rank and choose fixes from among candidates. Recent work proposes using machine learning to generate fixes, including neural machine translation models to map faulty code to fixed code, tree transformation prediction models, neural models for more specific bug types, and approaches that train models for specific repairs. SelfAPR trains a model using training samples obtained by perturbing a previous version of the program being repaired, enforcing the neural model to capture project specific knowledge.
Several techniques use a one-shot prompt technique, where a single prompt is sent to the model with problem descriptions or error messages, and the model responds with the proposed code fix. More recent techniques use iterative approaches, where the LLM is prompted several times and the feedback obtained from the previous repair attempts are passed to the subsequent iterations. ChatRepair is a dialogue based technique that works through a conversation with the engineer as it incrementally collects more information, proposes potential patches and generates better patches over time to locate and repair the bug. ITER improves partial patches until they become plausible and correct.
AutoCodeRover is an agent leveraging program metadata including class and method definitions. SpecRover builds upon AutoCodeRover to introduce a natural-language specification for expected behavior and incorporates an agent that reviews potential patches to guide the repair agent.
Google’s Passerine is a ReAct-style agent employing tools including a test-suite-based metric calculator for verification, is deployed to production use, and is reported to be three times more successful on fixing machine generated bugs. Passerine has recently been improved with techniques to filter out patches unlikely to be accepted by humans.
Meta’s Engineering Agent also implements a ReAct-style loop to automatically fix failing unit-tests using an iterative loop to provide feedback on potential patches using validation and verification tools. Extending this work, Meta’s MetaMateCR provides AI-assisted fixes for reviewer comments.
Conclusion
In this paper, we presented AutoRepair, an autonomous AI coding agent deployed at Google to automatically debug and repair test failures during the pre-submit outer-loop workflow. By integrating directly with Google’s internal tools, Critique and Cider, AutoRepair provides suggested fixes before developers switch context from their change modification flow.
Our evaluation demonstrates the efficacy and practical viability of this approach at an industrial scale. In a manual evaluation by TotalEvalDevelopers expert developers, AutoRepair successfully suggested accurate fixes for TotalEvalAccuracy of evaluated test failures. Following its production deployment on AutoRepairLaunchDate, the system suggested TotalChangesPostedTo fixes, with developers accepting and applying TotalChangesApplied of the suggestions.
Qualitative feedback from user interviews provides insights into adoption and user behaviors. Developers reported time savings and reduced frustration when diagnosing and fixing complex test failures. Challenges also remain, such as optimizing execution latency to catch developers before they context-switch, and mitigating unhelpful fix suggestions like commenting out tests.


