GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Zanwen Fu
  • Work
  • Experience
  • About
  • Blog
  • Teaching
  • All projects
  • Writing
  • AutoCodeRover

This view

  • Original page
  • New address

GeezerVison is showing zanwenfu.com — Taking AutoCodeRover from SWE-bench to the IDE

AutoCodeRover is an AI agent that fixes software issues with no person involved. A research team at the National University of Singapore (NUS) built it. Sonar, a company that makes code quality tools, acquired it in February 2025. I joined the team in August 2024, as an undergraduate at NUS.
When I joined, the agent already did well on SWE-bench, a benchmark that counts how many real GitHub issues an agent solves. My job was to make the agent useful to a developer who is working in an editor (an IDE). This essay describes what I built for that, and why.
My partA plugin that puts the agent inside JetBrains editors. A way to comment on the code search or the patch and rerun from that step (replay). A way to rerun a failed run with no person involved (Self-Fix). A merge that keeps the developer's own edits when the agent's fix arrives
WhenAugust 2024 to May 2025
The agent's scoreIn January 2025 it solved 51.6% of SWE-bench Verified, a set of 500 checked issues. I worked with the team on raising the score to this number
What came nextSonar acquired AutoCodeRover in February 2025. The AutoCodeRover team then built on this foundation to create the Sonar Foundation Agent
The researchTwo papers from Professor Abhik Roychoudhury's group, at the conferences ISSTA 2024 and ICSE 2025
Built withKotlin (the plugin), Python (the agent), GumTree, JetBrains PSI, OkHttp

The pipeline, and what a developer needs

AutoCodeRover is a pipeline of steps. Each step is a language model with one job, and the steps have names such as Patching Agent. The first step writes a test that reproduces the issue. The Context Retrieval Agent searches the code by its structure, as classes and methods, and writes down what the code is meant to do. The Patching Agent writes a fix, which is called a patch. The Reviewer Agent checks the patch with the test. If the reviewer approves none of the patches, the final one is chosen by the project's existing tests or by the Selection Agent.
The pipeline, from the team's ICSE 2025 paper, where this version of AutoCodeRover is called SpecRover.The pipeline, from the team's ICSE 2025 paper, where this version of AutoCodeRover is called SpecRover.
On SWE-bench, this pipeline runs with no person involved. It receives a GitHub issue and returns a patch.
A developer in an editor has other needs. Their files have local changes that are not pushed yet. They describe a bug in a few vague words. They want to see why the agent chose a fix, and they want to tell the agent when it is looking in the wrong file. The plugin, replay and the merge below answer these needs.

The plugin

I wrote the AutoCodeRover plugin for JetBrains editors, such as IntelliJ IDEA and PyCharm, in Kotlin. It adds a chat panel to the editor. A developer describes a problem in plain words, and the plugin sends the description to the agent, which runs on a server.

Context for each request

A request such as "fix the broken function call in this file" does not tell a remote agent which file the developer means. So the plugin adds context to the description before it sends it. It records the developer's last ten cursor positions and the files that are open, so the agent knows where to start its search. It also asks a language model to pick out the class and the method that the description names. Then it uses PSI, the editor's own model of the program, to find every place in that class where the method is used. This works for Java and Kotlin files.

The agent's steps

The server sends each of the agent's steps to the plugin as soon as it happens. When the run ends, the plugin shows the steps inside the chat panel, as a list that the developer can open, with one row for each step. The rows show what the Context Retrieval Agent searched for, which search calls it chose and how the Patching Agent wrote the patch. I built this so that a developer can check the agent's work before accepting its patch.

Build and test failures

The plugin also listens to events in the editor. When a build fails, the plugin collects the errors, and the developer can send them to the agent with one click. When a test fails, the plugin reads the HTML test report written by Gradle, a build tool. It takes the failing class, the method and the first lines of the stack trace from the report, and prepares a request from them.

Code quality findings

Code quality checks are another source of tasks for the agent. SonarLint, a Sonar tool that is now called SonarQube for IDE, finds code quality problems with a set of rules. Each rule describes its problem exactly, which makes a finding a clear task for an agent. So I embedded SonarLint's analysis engine in the plugin, where it analyzes Java and Python code. A developer can run the analysis inside the same chat panel, see the findings grouped by file and send one finding or several to the agent.

Feedback and replay

The original AutoCodeRover took no input after it had started. If its patch was wrong, the developer had to start again from the beginning.
I changed the agent so that a developer can give feedback as a comment on the code search of the Context Retrieval Agent or on the patch of the Patching Agent. The agent then runs again from the step that received the comment. I call this replay.
I treat a comment on the patch as a sign that the developer accepts the code search. So the agent does not run the whole pipeline again. The original agent already saved each step's state. Replay reloads the saved state of the earlier steps. It reruns the step that received the comment, with the comment as input, and then runs the later steps with the new result.
Replay. A comment goes to the step it is about, and the run starts again from that step.Replay. A comment goes to the step it is about, and the run starts again from that step.
Each time the developer comments, the comment and the agent's answer are added to a feedback history. A developer can therefore correct the agent a little at a time, over several rounds.

Self-Fix

Self-Fix starts a replay in the runs that no developer is watching.
It starts when the Patching Agent has tried three times and none of its patches could be applied to the code. Self-Fix gathers the results of the code search and every patch attempt up to that point, with the reason why the last patch could not be applied. It asks a language model to explain the failure and to say which step most likely caused it. When that step is the Context Retrieval Agent or the Patching Agent, Self-Fix writes a note for it and replays from there. The note takes the place of a developer's comment. The number of such replays is limited, and the default is one.
The pipeline with Self-Fix, which names the step that most likely caused a failure and reruns from it.The pipeline with Self-Fix, which names the step that most likely caused a failure and reruns from it.

Merging the patch with the developer's edits

The merge was the hardest part to build, and it is the part I am proudest of. The agent runs on a server and writes its patch for the latest pushed commit. The developer's file can have changes that are not pushed yet, and the developer keeps editing while the agent works. So when the patch arrives, the local file differs from that commit. A patch lists changed lines together with the unchanged lines around them. The command git apply rejects the patch when those surrounding lines no longer match the file. I could have asked the developer to commit, push and then wait for the patch, but that would interrupt their work.
So the plugin merges the two sets of changes as syntax trees, not as text. It uses GumTree, a tool that compares two versions of a program by their abstract syntax trees. An abstract syntax tree is the program's structure as a tree of nodes, such as classes, methods and statements.
Suppose a developer renames a parameter from data to input everywhere in a function, while the agent adds a null check for a different parameter at the top of the same function. The lines around the agent's change are now different, so git apply rejects the patch. On the trees, the rename changes existing nodes and the null check is a new node, so the merge keeps both.
The plugin first prepares three versions of the file. The baseline is the file in the latest pushed commit. The developer's version is the current file in the editor. The patch's version is the baseline with the agent's patch applied. The plugin parses all three into syntax trees. The parser reads only Java, so the merge works only on Java files.
GumTree then matches the nodes of the baseline with the nodes of the other two versions. For each node of the baseline, the plugin decides which version to keep.
CaseThe merge keeps
All three versions are the sameThe baseline
Only the patch changed the nodeThe patch's version
Only the developer changed the nodeThe developer's version
Both changed the node in the same wayThat change
Both changed the node in different waysThe baseline
A node that is new in the developer's version or in the patch's version has no matching node in the baseline. For each new node, the plugin checks the nodes above it, starting with the closest one, until it finds a node that also exists in the baseline. It attaches the new node to that node.
Last, the plugin turns the merged tree back into Java source code, with the help of a language model. It writes the result to the editor, with the changed lines highlighted.
A developer and the agent can therefore add or change code in different parts of the same function, and both edits are kept. A deletion by only one of them is not kept, and the node stays in the merged file. When they change the same node in different ways, the merge keeps neither change.

What I learned

A good SWE-bench score did not tell me whether a developer could see the agent's reasoning, correct it without starting again or keep working without interruptions. Most of my work was on these.
The models we used then were sometimes wrong, so the agent needed a way to recover. A developer's comment starts a replay in the runs that a developer watches, and Self-Fix starts one in the rest.
The merge taught me that a conflict in the text is often not a conflict in the syntax tree, because the two changes touch different nodes. I think more tools that merge code should work on the syntax tree, as this merge does.

What came after AutoCodeRover

After the acquisition, the AutoCodeRover team built on this foundation to create the Sonar Foundation Agent. In February 2026 Sonar announced that the Sonar Foundation Agent had reached first place on the SWE-bench leaderboard with no filters applied. The leaderboard is the public ranking of agents on this benchmark. The Sonar Foundation Agent solved 79.2% of SWE-bench Verified, the set on which AutoCodeRover had scored 51.6%. It solved 52.62% of the full benchmark. Sonar gave the agent's average cost as $1.26 per issue.
AutoCodeRover was a pipeline of steps in an order that never changed. The Sonar Foundation Agent is one language model that chooses its own next step. It takes the place of that pipeline, which replay and Self-Fix were built on. Its instructions still ask it to work in steps, such as searching the code before it writes a patch, and it still uses AutoCodeRover's code search, which works on the program's structure. Replay and Self-Fix were built for models that needed more guidance. As models improved, the team gave the Sonar Foundation Agent more freedom.
The work in this essay was my final-year project at NUS, supervised by Professor Abhik Roychoudhury. If you are building agent systems and have met the same problems, I would like to hear about them. You can email me or find me on LinkedIn.

Cite this essay

If you build on or quote this essay, please cite it.

Zanwen Fu. 2026. “Taking AutoCodeRover from SWE-bench to the IDE.” zanwenfu.com, March 27, 2026. https://zanwenfu.com/blog/acr_blog

BibTeX
@misc{fu2026research,
  author       = {Fu, Zanwen},
  title        = {Taking {AutoCodeRover} from {SWE}-bench to the {IDE}},
  year         = {2026},
  month        = mar,
  howpublished = {\url{https://zanwenfu.com/blog/acr_blog}},
  note         = {Published March 27, 2026, as ``From Research Agent to Acquired Product: What I Learned Building the {AutoCodeRover} {IDE} Plugin''}
}

Published March 27, 2026, as “From Research Agent to Acquired Product: What I Learned Building the AutoCodeRover IDE Plugin”. The Internet Archive captured it on April 7, 2026.

Read next

An Operating System for AI Agents, with Git as Its Memory

Agent harnesses are operating systems built one feature at a time. This essay designs one as a whole, with git, not markdown, as its memory.

You are visitor 01402860 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.