Skip to content
All projects

AutoCodeRover

One of the first coding agents, acquired by Sonar

early employee · research engineer · 2024–25

Why it exists

In early 2024, before Claude Code or Codex, coding agents were still a research question. AutoCodeRover was one of the first to answer it: give it a real GitHub issue, and it found the cause in the code and wrote the fix on its own.

What I built

I joined early and worked on lifting it to 51.6% on SWE-bench Verified. I built Self-Fix, which traces a rejected patch back to the step that went wrong and reruns from there. And I built the JetBrains plugin end to end, which put the agent inside the IDE and merges its fixes with the developer’s own edits.

AutoCodeRover · repair pipeline architecture

Scroll across to follow the full system

The JetBrains plugin collects developer context and streams feedback to the repair backend. Reproduction, context retrieval, patching, review, and selection are coordinated with Self-Fix and targeted replay. The developer receives a patch, test, intent, and review evidence.ACR plugin · Kotlin / IntelliJ Platform SDKAutoCodeRover backend · Python / DockerRESTSSE streamtargeted replayFeedbackContext / FeedbackPatchJetBrains IDE · IntelliJ IDEAPSI traversal · build and test listeners · Git4Idea · editor APIsChat UI + SSEStreamed reasoning and feedbackSonarLint engineJava / Python static analysisGumTree three-way mergeBaseline · local edits · agent patchContext enrichmentPSI references · cursor · open filesDeveloper feedbackCritique any reasoning stepDirect context and patch revisionsReview changes before applying themMeta-agent orchestratorCoordinate the repair workflowReproduceragentExpose the failureContextretrievaltree-sitterEight languagesPatching agentPropose the repairReviewer agentCheck patch and testSelectionagentCandidates +regressionSelf-Fix agentDiagnose & redirectPatched code + evidenceApply through a three-way AST mergeReconcile independent developer and agent editsIntent + reproducer + reviewThe reasoning and tests behind the repairAvailable for developer inspection51.6% on SWE-bench Verified · January 2025
Follow the GumTree three-way AST merge
GumTreeThree-way AST merge
SimpleNamelookup → findKeep local
InfixExpression&& → ||Take patch
Baseline codeRepository.java
User lookup(String key) {
  if (key == null && key.isEmpty())
    return User.missing();
  return cache.get(key);
}

Three versions become three syntax trees

The plugin parses the Git baseline, your working copy, and the repair applied to that baseline with GumTree’s JDT parser. The tree excerpt below follows one method.

01 / 04Parse
GumTree mapping & merge implementation

How it works

The plugin

Kotlin, end to end. It has chat with live streaming and build and test failure capture. SonarLint findings go straight to the agent. Context from the code itself (references, cursor history, open files) narrows the agent’s search.

The merge

When the developer edits a file the agent is patching, the plugin compares the baseline, the working copy and the patch as Java syntax trees (GumTree). It keeps each side’s independent changes, and falls back to the baseline where they conflict.

Self-Fix and targeted replay

When the reviewer rejects a patch, Self-Fix works out which earlier step caused it, writes feedback for that agent and replays from there, keeping everything upstream. The same replay lets a developer comment on any step from the IDE.

Two repositories, one system

auto-code-rover

Repair backend · Python · my additions

My additions to the team’s repair agent, which searches code in eight languages and runs reproducer, context, patch and review agents. When the reviewer rejects a patch, Self-Fix finds the step that caused it and replays from there; the same replay lets a developer correct any step.

Self-Fix

A four-step repair loop that starts when the reviewer rejects a patch or the patch does not apply: (1) collect failure reasons from the Reviewer; (2) diagnose via a Chain-of-Thought prompt with full agent-role context — an LLM-as-a-Judge critic step identifies which upstream agent produced the defective output; (3) generate targeted corrective feedback for that agent; (4) replay from the faulty stage only, preserving all upstream state.

Targeted replay

Each agent saves its state when it finishes. Feedback at any stage reruns only that agent and the ones after it: upstream results are reloaded, not recomputed. Every model response carries an ID, so a developer can comment on one step and the agent picks up from exactly there.

Feedback continuity

Rather than treating each feedback event as isolated, state preserves a feedback_history field — references to prior model responses and any patch that prompted commentary. Agents see the user's latest instructions and earlier commentary, maintaining a coherent chat-like flow of clarifications across iterations.

Python · LiteLLM · tree-sitter · Claude 3.5 Sonnet · GPT-4o

Private repository

jetbrains-ide-plugin

IDE plugin · Kotlin

Brings the agent into the IDE. It reads the developer’s working state, sends build and test failures and SonarLint findings to the agent, streams the agent’s reasoning, and lands the fix without leaving the editor.

Three-way merge on the syntax tree

Reconciles concurrent edits to the same function using syntax-tree mappings. When the developer has modified code while the agent patches the same file, the plugin reconciles three versions at the AST level: baseline (latest pushed commit), modified (working copy), and patched (diff applied to baseline). GumTree Matchers compute node mappings across all three. If you haven't changed a node but the agent did, it takes the agent's version; if you changed it and the agent didn't, it keeps yours; the same change on both sides is kept; where the two disagree, it falls back to the baseline. The merged tree is turned back into source and written to the editor.

SonarLint findings, fixed by the agent

SonarLint Core 10.3 runs Java and Python analysis inside the plugin, against the project's classpath from IntelliJ. Findings appear grouped by file and go to the agent one at a time or in a batch, with the running one highlighted as it is fixed.

Context from the code

ReferenceFinder uses PSI traversal to resolve symbol references with line numbers and enclosing context (method declaration vs. class field vs. property). CursorTracker records the last 10 cursor positions. Together they narrow where the agent's context retrieval looks.

Build and test failures, captured

BuildFailureListener attaches to IntelliJ's BuildViewManager, captures and deduplicates build errors in real-time, and surfaces them in chat with one-click ACR submission. Test failure listener intercepts Gradle HTML test reports, extracts class / method / stack trace.

Kotlin · IntelliJ Platform SDK · PSI · GumTree · SonarLint Core 10.3 · OkHttp · JGit

zanwenfu/jetbrains-ide-plugin·DeepWiki