See it in action β ACR autonomously localizes a bug, retrieves context, and generates a patch, all from a natural-language description:
ACR.Run.mp4
- Demo
- Overview
- Key Features
- Architecture
- Tech Stack
- Prerequisites
- Getting Started
- Usage Guide
- After an ACR Agent Run
- Project Structure
- Technical Deep Dive
- Troubleshooting
- Contact
AutoCodeRover (ACR) is a fully automated approach for resolving GitHub issues β combining Large Language Models (LLMs) with program analysis and debugging capabilities to autonomously localize faults, reason about code context, and generate targeted patches.
AutoCodeRover JetBrains Plugin brings this autonomous program improvement agent directly into your JetBrains IDE (IntelliJ IDEA, PyCharm, etc.). Instead of context-switching between the terminal, web consoles, and your editor, developers interact with the ACR Agent through a conversational tool window embedded in the IDE β enabling a seamless, human-in-the-loop workflow for:
- π Bug fixing β Describe the issue in natural language; ACR autonomously localizes and patches the code.
- β¨ Feature addition β Describe the desired feature; ACR generates the implementation.
- π¨ Build failure troubleshooting β Automatically captures build errors and submits them to ACR for resolution.
- π§ͺ Test failure diagnosis β Automatically captures test failure reports (including HTML Gradle reports) and prompts ACR for a fix.
- π Code-quality remediation β Runs SonarLint static analysis, displays categorized issues, and sends them to ACR for automated fixes β individually or in batch.
| Feature | Description |
|---|---|
| Conversational Agent UI | Chat-based interface with real-time SSE streaming, typewriter animation, and full conversation history. |
| Autonomous Bug Fixing | Describe a bug β ACR localizes the fault, retrieves context, and generates a unified diff patch. |
| Feature Addition | Describe a feature β ACR analyzes the codebase and produces implementation code. |
| Build Failure Auto-Capture | Listens to IntelliJ's BuildViewManager and automatically surfaces build errors with one-click ACR submission. |
| Test Failure Auto-Capture | Intercepts Gradle HTML test reports, extracts class/method/stack trace details, and prompts ACR. |
| SonarLint Integration | Embedded SonarLint analysis engine for Java and Python with expandable issue trees, per-file grouping, individual/batch ACR fixes, and live progress tracking. |
| Intelligent Patch Application | Parses unified diffs, applies patches file-by-file, and opens modified files with temporary line highlighting. |
| Three-Way Merge (Patch Alignment) | When local code has diverged from ACR's baseline, performs AST-based three-way merge using GumTree to auto-resolve non-conflicting changes. |
| Agent Reasoning Transparency | Collapsible panel showing all intermediate agent steps (Context Retrieval, API Selection, Patch Generation) with per-step feedback. |
| Feedback Loop | Submit targeted feedback on any agent reasoning step or the final patch β triggers a guided re-run with your instructions. |
| Patch Rating | Thumbs-up/down rating sent to the ACR WebConsole for satisfaction tracking and system improvement. |
| Multi-Provider LLM Support | Configure OpenAI (GPT-4o, GPT-4 Turbo), Anthropic (Claude 3.5 Sonnet, Claude 3 Opus), or Google Gemini models. |
| Context Enrichment | Automatically enriches prompts with code references (PSI-based), cursor history, and currently open files. |
| IDE Event Listeners | Real-time monitoring of build/test events via IntelliJ's BuildProgressListener API. |
| Cross-IDE Support | Compatible with IntelliJ IDEA (Ultimate & Community), PyCharm, and other JetBrains IDEs. |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JetBrains IDE β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ACR Tool Window (Swing UI) β β
β β βββββββββββββββ ββββββββββββββββ βββββββββββββββββββββββ β β
β β β Chat History β β Input Area β β Send/Stop/Reset/SL β β β
β β ββββββββ¬βββββββ ββββββββ¬ββββββββ ββββββββββββ¬βββββββββββ β β
β βββββββββββΌβββββββββββββββββΌβββββββββββββββββββββββΌββββββββββββββ β
β β β β β
β βββββββββββΌβββββββββββββββββΌβββββββββββββββββββββββΌββββββββββββββ β
β β ACRToolWindowFactory β β
β β (Orchestration: state management, coroutines, UI updates) β β
β βββββ¬βββββββββββ¬βββββββββββββ¬βββββββββββββββ¬ββββββββββββββββ¬βββββ β
β β β β β β β
β βββββΌββββ βββββΌβββββ βββββΌβββββββ βββββΌβββββββββββ ββββΌβββββ β
β βActionsβ βListenersβ β Parser β β Settings β β UI β β
β βββββ¬ββββ βββββ¬βββββ βββββ¬βββββββ βββββ¬βββββββββββ ββββ¬βββββ β
β β β β β β β
β βββββΌββββββββββΌβββββββββββββΌββββββββββββββΌββββββββββββββββΌβββββ β
β β IntelliJ Platform SDK β β
β β (PSI, VFS, Editor API, Build API, Git4Idea, Document API) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β HTTPS + SSE
βΌ
ββββββββββββββββββββββββββ
β AutoCodeRover Backend β
β (Cloud API Server) β
β β
β POST /repo/task β
β POST /repo/rerun β
β POST /repo/task/rate β
β POST /repo/task/stop β
β GET /subscribe (SSE) β
ββββββββββββββββββββββββββ
| Layer | Component | Responsibility |
|---|---|---|
| UI | ACRToolWindowFactory |
Main orchestrator β creates the chat panel, manages state, handles user input, coordinates API calls and UI updates via Kotlin coroutines. |
| UI | addACRMenu / addSonarLintMenu |
Renders collapsible menus for ACR agent reasoning steps and SonarLint issue trees with interactive checkboxes and per-issue action buttons. |
| UI | SharedItems / MenuData / ProgressBorder |
Reusable UI primitives β shared menu components, animated rainbow progress border, Menu/MenuItem data models. |
| Actions | applyDiff |
Core patch application engine β parses unified diffs, applies changes file-by-file, triggers three-way merge for diverged files, and highlights modified lines in the editor. |
| Actions | SonarLintReportCollector |
Embedded SonarLint analysis engine β loads SonarLint plugins, configures analysis for Java/Python, captures issues with suggested fixes. |
| Actions | LLMClient |
Direct OpenAI API client for auxiliary tasks (AST-to-code conversion, element/class extraction from issue descriptions). |
| Actions | CursorTracker |
Tracks the developer's last 10 cursor positions across files for context enrichment in ACR prompts. |
| Actions | getRepoURL |
Retrieves the Git remote URL and latest commit hash using IntelliJ's Git4Idea API. |
| Actions | retrieveFailureDetailsFromHtml |
Parses Gradle HTML test reports to extract class names, method names, and stack traces. |
| Actions / Git | GitDiffUtils |
JGit-based utility β computes changed files against a baseline commit, retrieves file content at specific commits. |
| Actions / Git | GitRepositoryUtils |
JGit-based utility β repository resolution, remote branch detection, latest pushed commit retrieval. |
| Listeners | BuildFailureListener |
Attaches to IntelliJ's BuildViewManager to capture build/test failure events in real-time, deduplicates messages, and triggers the chat callback. |
| Parser | applyDiffToBaseline |
Creates a temporary Git repository, commits the baseline file, and applies a unified diff patch using JGit's git apply. |
| Parser | converter |
Converts GumTree AST nodes back into Java source code β handles packages, imports, classes, fields, methods, and control flow. |
| Parser | ReferenceFinder |
PSI-based reference finder β traverses Java/Kotlin PSI trees to locate all usages of a given symbol with line numbers and context. |
| Parser / GumTree | Parser |
Wraps GumTree's JdtTreeGenerator to parse Java source code (from strings or files) into ASTs. |
| Parser / GumTree | Matcher |
Three-way AST merge engine β computes node triples (baseline/modified/patched), resolves conflicts via isomorphism checks, produces merged code with LLM-assisted AST-to-code conversion. |
| Parser / GumTree | ThreeVersionAST |
Constructs the three AST versions (baseline from Git, current working copy, patched from diff) for three-way merge. |
| Settings | ACRToolWindowSettings |
Persistent project-level settings (API key, URL, project ID, LLM provider/model) stored via IntelliJ's PersistentStateComponent. |
| Settings | ACRToolWindowConfigurable |
Settings UI panel β provider/model dropdowns with dynamic model population based on provider selection. |
| Entry Points | OpenIDE |
JBProtocolCommand handler for apply-diff β enables external tools to trigger diff application via JetBrains protocol URLs. |
| Entry Points | ApplyCodeToEditorAction |
Manual action (Tools menu) β opens a dialog for pasting and applying a unified diff patch directly. |
| Entry Points | ShowRepoInfoAction |
Manual action (Tools menu) β displays the current repository URL and latest commit hash. |
| Category | Technology |
|---|---|
| Language | Kotlin 1.8.21 |
| Build System | Gradle (Kotlin DSL) with IntelliJ Gradle Plugin 1.13.3 |
| IDE Platform | IntelliJ Platform SDK 2023.1.5 (compatible with builds 231β242.*) |
| HTTP Client | OkHttp 4.9.2 (with SSE support for real-time streaming) |
| JSON Processing | org.json 20220320 |
| AST Diffing | GumTree 4.0.0-beta3 (core, client, gen.jdt) + gumtree-spoon-ast-diff 1.100 |
| Git Operations | JGit (via GumTree dependency) + IntelliJ Git4Idea plugin API |
| Static Analysis | SonarLint Core 10.3.0 + Sonar Plugin API 10.11.0 |
| Testing | JUnit 5, Mockito, Kotlin Test |
| Code Coverage | JaCoCo |
| License Reporting | dependency-license-report 2.0 |
| Requirement | Version |
|---|---|
| JDK | 17 or later |
| IntelliJ IDEA | 2023.1 or later (Ultimate or Community) |
| Git | Installed and configured with a remote repository |
# Clone the repository
git clone https://github.com/AutoCodeRoverSG/jetbrains-plugin.git
cd jetbrains-plugin
# Build the plugin distribution
./gradlew buildPluginThe plugin ZIP file will be generated at build/distributions/jetbrains-plugin-ACR-1.0.zip.
To launch a sandboxed IntelliJ IDEA instance with the plugin pre-loaded for development and testing:
./gradlew runIdeThis starts an isolated IDE environment with auto-reload enabled. The plugin is automatically installed in the sandbox β ideal for iterating on changes without affecting your primary IDE installation.
- Open IntelliJ IDEA.
- Navigate to File β Settings β Plugins (or IntelliJ IDEA β Preferences β Plugins on macOS).
- Click the gear icon (βοΈ) β Install Plugin from Disk...
- Select the
jetbrains-plugin-ACR-1.0.zipfile frombuild/distributions/. - Click OK and restart the IDE to activate the plugin.
Navigate to File β Settings β AutoCodeRover Plugin Settings and fill in:
| Setting | Description | Where to Find |
|---|---|---|
| AutoCodeRover Authentication Token | Your ACR API auth token. | ACR WebConsole |
| AutoCodeRover API Domain | Backend API base URL (default: https://uat.autocoderover.dev/). |
Provided by your ACR admin. |
| Project ID | The ACR project ID for your repository. | Projects page on the WebConsole. |
| LLM Key Name | The key name for your configured LLM API key. | User page on the WebConsole. |
| Provider | LLM provider: OpenAI, Anthropic, Gemini, or trial variants. |
Dropdown in settings. |
| Model | Specific model (e.g., gpt-4o-2024-11-20, claude-3-5-sonnet-20240620). |
Auto-populated based on provider selection. |
Click Apply and OK to save.
- Click the "AutoCodeRover Assistant" tab on the right-hand side of your IDE window.
- The plugin interface has three sections:
- Chat History β Displays the conversation between you and the ACR Agent with real-time streaming updates.
- Input Area β Text field at the bottom for typing messages and descriptions.
- Button Panel β Action buttons: Send / Stop, Reset Chat, and Run SonarLint.
- Click "Fix a Bug" or "Add a Feature" in the chat panel.
- Describe the issue or desired feature in the input area.
- Click Send β the plugin will:
- Enrich your description with detected code references (via PSI analysis), cursor history, and open files.
- Submit the task to the ACR backend via HTTPS POST.
- Subscribe to a real-time Server-Sent Events (SSE) stream for agent updates.
- Display intermediate reasoning steps and the final patch with a typewriter animation.
- After the run completes, review the patch and choose to Apply or Not Apply.
Watch the full demonstration of prompting ACR Agent to fix a bug / add a feature β also featured at the top of this README.
When a build failure occurs inside your IDE, the plugin automatically:
- Captures the build error log via IntelliJ's
BuildViewManagerlistener. - Deduplicates and cleans the error messages (strips XML tags, normalizes whitespace).
- Displays the structured error in the chat panel with "Ask ACR" / "Not Ask" buttons.
- One click sends the error to ACR for autonomous resolution.
No manual intervention required β the plugin monitors build events in real-time.
When a test failure occurs, the plugin automatically:
- Detects the
FinishBuildEventwithFailureResultstatus. - Extracts the Gradle HTML test report link from the build output.
- Parses the HTML report to extract class names, method names, and stack traces (limited to 6 lines for clarity).
- Displays the structured failure details in the chat with one-click ACR submission.
Watch the full demonstration of prompting ACR Agent to diagnose a test failure:
Test.Failure.mp4
The plugin embeds a full SonarLint analysis engine supporting both Java and Python.
-
Run Analysis β Click the "Run SonarLint" button to perform static analysis on all source files under the project's
src/directory. -
View Results β Issues are displayed in an expandable tree menu:
- Grouped by file (clicking a file path opens it in the editor).
- Each issue shows: violation message, line number, rule key, and suggested fix (if available).
- Per-file and global select all checkboxes for batch operations.
-
Fix Individual Issues β Click the "Run" (βΆ) icon next to any issue to send it to ACR for a targeted fix.
-
Batch Fix β Use checkboxes to select multiple issues across files, then click "Run All" to queue sequential fixes.
- Each issue shows a live animated rainbow progress border during processing.
- Completion status is indicated via βοΈ (success) or β (failure) icons next to each issue.
Watch the full demonstration of prompting ACR Agent to fix SonarLint issues:
SonarLint.mp4
Once AutoCodeRover completes its run, the plugin displays both the intermediate reasoning steps and the final patch in the chat interface. This section outlines all post-run capabilities.
- Click "AutoCodeRover Response Details" to expand the collapsible panel showing all intermediate agent outputs.
- Each step is displayed as a row with:
- Agent name (e.g.,
Context Retrieval Agent) - Agent subtype (e.g.,
Model response (API selection)) - Full output text
- Agent name (e.g.,
- Click the π¬ feedback icon next to any step to submit targeted feedback:
- Feedback is tied to the specific agent step and model response ID.
- Submitted feedback triggers a guided re-run β ACR re-executes with your instructions incorporated into the reasoning pipeline (via
/ide/jetbrains/repo/rerun).
After reviewing the patch, two buttons appear:
-
Apply β Applies the unified diff to your codebase:
- Parses the diff and applies changes file-by-file.
- Detects whether each file has local modifications since the latest pushed commit (using JGit).
- For unmodified files: Applies the patch directly using
git applyin a temporary repository, then writes the result to the working tree. - For locally modified files: Triggers Patch Alignment (three-way AST merge):
- Constructs three ASTs using GumTree: baseline (from latest pushed commit) β modified (current working copy) β patched (diff applied to baseline).
- Computes node mappings between all three versions using GumTree's
Matchers. - For each node, applies merge logic: if baseline = modified β accept patched (ACR's change); if baseline = patched β accept modified (your change); if modified = patched β accept either.
- New nodes from either version are attached to their nearest matched ancestor.
- The merged AST is converted back to source code using an LLM-assisted converter.
- All modified files are opened automatically.
- Changed lines are temporarily highlighted in yellow for quick visual reference. Highlights are dismissed on the first click in the editor.
-
Not Apply β Dismisses the patch. It remains visible in chat history but does not modify your code.
Watch the full demonstration of ACR Plugin performs Patch Alignment:
GumTree.mp4
At the top-right of the patch bubble:
- Click π to rate the patch as helpful (button turns blue, both buttons disabled).
- Click π to indicate dissatisfaction (button turns red, both buttons disabled).
Ratings are sent to the ACR WebConsole via /ide/jetbrains/repo/task/rate, enabling continuous system improvement through aggregated user satisfaction tracking.
jetbrains-plugin/
βββ build.gradle.kts # Build config, dependencies, plugin metadata
βββ settings.gradle.kts # Gradle project settings
βββ gradle.properties # Kotlin compiler flags
βββ gradlew / gradlew.bat # Gradle wrapper scripts
β
βββ src/
β βββ main/
β β βββ kotlin/com/example/jetbrainsplugin/
β β β βββ ACRToolWindowFactory.kt # Main orchestrator (3000+ lines)
β β β βββ ApplyCodeToEditorAction.kt # Manual diff application via dialog
β β β βββ ChatGPT.kt # Development notes / changelog
β β β βββ OpenIDE.kt # JBProtocol handler for external diff
β β β βββ ShowRepoInfoAction.kt # Tools menu: show repo URL & commit
β β β β
β β β βββ actions/
β β β β βββ applyDiff.kt # Patch application & merge trigger
β β β β βββ CursorTracker.kt # Developer cursor position tracking
β β β β βββ getRepoURL.kt # Git remote URL & commit retrieval
β β β β βββ LLMClient.kt # OpenAI API client (auxiliary)
β β β β βββ retrieveFailureDetailsFromHtml.kt # Gradle HTML report parser
β β β β βββ SonarLintReportCollector.kt # Embedded SonarLint engine
β β β β βββ ZipProjectAction.kt # Project zipping utility
β β β β βββ git/
β β β β βββ GitDiffUtils.kt # Changed files & baseline code
β β β β βββ GitRepositoryUtils.kt # Repo resolution & remote tracking
β β β β
β β β βββ listeners/
β β β β βββ BuildFailureListener.kt # Build/test failure event listener
β β β β
β β β βββ parser/
β β β β βββ applyDiffToBaseline.kt # Temp Git repo + JGit patch apply
β β β β βββ converter.kt # GumTree AST β Java source code
β β β β βββ ReferenceFinder.kt # PSI-based symbol reference search
β β β β βββ gumtree/
β β β β βββ Matcher.kt # Three-way AST merge engine
β β β β βββ Parser.kt # GumTree JDT AST parser wrapper
β β β β βββ ThreeVersionAST.kt # Three-version AST construction
β β β β
β β β βββ settings/
β β β β βββ ACRToolWindowConfigurable.kt # Settings UI panel
β β β β βββ ACRToolWindowSettings.kt # Persistent state component
β β β β
β β β βββ ui/
β β β βββ addACRMenu.kt # ACR response details renderer
β β β βββ addSonarLintMenu.kt # SonarLint issue tree renderer
β β β βββ MenuData.kt # Menu/MenuItem data models
β β β βββ ProgressBorder.kt # Animated rainbow progress border
β β β βββ SharedItems.kt # Shared UI builder functions
β β β
β β βββ resources/
β β βββ icon/ # SVG icons for the plugin UI
β β βββ META-INF/plugin.xml # Plugin descriptor & extensions
β β βββ sonarlint-analysis-engine/ # SonarLint engine resources
β β βββ sonarlint-intellij/plugins/ # SonarLint plugin JARs
β β
β βββ test/
β βββ kotlin/
β βββ ACRTest.kt # Core ACR integration tests
β βββ BuildFailureListenerTest.kt # Build listener unit tests
β βββ ButtonTest.kt # UI button interaction tests
β βββ ParserTest.kt # AST parser unit tests
β βββ SonarLintTest.kt # SonarLint analysis tests
β βββ TypeWriterEffectTest.kt # Typewriter animation tests
β βββ data/ # Test fixtures (Java source files)
The plugin communicates with the AutoCodeRover backend over HTTPS with acr-auth-token header authentication using four REST endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/ide/jetbrains/repo/task |
POST | Submit a bug-fix or feature-addition task. Returns a subscribe_link for SSE streaming. |
/ide/jetbrains/repo/rerun |
POST | Submit user feedback to trigger a guided re-run of a specific agent step. |
/ide/jetbrains/repo/task/rate |
POST | Submit a thumbs-up (1) or thumbs-down (2) rating for a patch. |
/ide/jetbrains/repo/task/stop |
POST | Stop a running ACR task and cancel the SSE subscription. |
{
"agent": "IntelliJ IDEA",
"language": "Java",
"description": "<user description + code references + cursor history + open files>",
"type": "bug fixing | feature addition",
"provider": "OpenAI",
"model": "gpt-4o-2024-11-20",
"keyName": "my-llm-key",
"projectId": "project-123",
"localPath": "/path/to/project",
"branch": "main",
"commit": ""
}After task submission, the plugin subscribes to a Server-Sent Events stream via OkHttp's EventSource:
- Agent intermediate outputs (context retrieval, API selection, patch generation) are streamed in real-time.
- Messages are accumulated and parsed as JSON objects.
- When
status == "Finished", the plugin extracts the final patch from the second-to-last message. - Connection timeouts: 120s connect, 120s read, 120s write. TLS 1.2 enforced.
When the developer has made local changes that conflict with ACR's patch:
- Baseline AST β Parsed from the latest pushed commit (retrieved via JGit) using GumTree's
JdtTreeGenerator. - Modified AST β Parsed from the current working copy on disk.
- Patched AST β Generated by applying the ACR diff to the baseline file in a temporary Git repository, then parsing the result.
- Merge β GumTree's
Matcherscompute node mappings between all three versions. For each baseline node, aNodeTriple(baseline, modified, patched)is constructed, and the merge decision is:baseline == modified && baseline != patchedβ accept patched (ACR's change)baseline == patched && baseline != modifiedβ accept modified (developer's change)modified == patched && modified != baselineβ accept either (both agree)- All three differ β fallback to baseline
- New nodes (present in modified or patched but absent in baseline) are attached to their nearest matched ancestor in the merged tree.
- The merged AST is converted back to source code using an LLM-assisted AST-to-code converter that first determines declaration order, then reconstructs the full Java source.
The plugin embeds the SonarLint Core 10.3.0 analysis engine:
- Loads SonarLint plugin JARs from the bundled resources directory via
PluginsLoader. - Supports Java and Python languages with language-specific configurations.
- Dynamically resolves source directories, binary paths, test paths, and library classpaths.
- Captures issues with rule keys, line numbers, primary messages, and suggested fixes (including text edit ranges and replacement text).
- Runs per-file analysis with configurable Sonar properties (JDK version, source level, Python version, etc.).
- Utilizes IntelliJ's
ModuleManagerandOrderEnumeratorto resolve project dependencies for accurate analysis.
Before submitting a task to ACR, the plugin enriches the user's description:
- Code References β Uses
ReferenceFinder(PSI-based traversal of Java and Kotlin files) combined withLLMClientto extract symbol names from the description, then locates all usages with line numbers, enclosing method/class names, and visibility modifiers. - Cursor History β The developer's last 10 cursor positions (file name, line, column) from
CursorTrackerare appended, providing implicit signal about the area of interest. - Open Files β All currently open editor tabs are listed for additional context.
| Issue | Solution |
|---|---|
| Plugin not appearing after install | Ensure you're running IntelliJ IDEA 2023.1+ and restart the IDE. |
| "Setup Required" dialog on startup | Configure all required fields in Settings β AutoCodeRover Plugin Settings. |
| Build/test failures not captured | Ensure the project uses Gradle or IntelliJ's built-in build system. |
| SonarLint analysis fails | Verify SONARLINT_HOME and JDK_HOME environment variables are set correctly. |
| Patch application fails | Ensure your project has a Git remote configured and a valid pushed commit on the tracking branch. |
| SSE connection timeout | Check network connectivity to the ACR API domain. Verify the API URL in settings. |
| GumTree classes not found | The plugin auto-loads JARs from the sandbox /lib directory. Ensure the plugin build completed successfully. |
| Plugin logs | Check Help β Show Log in Explorer/Finder for detailed plugin diagnostic logs. |
For additional help, refer to the official JetBrains Plugin Development Guide.
For questions, feedback, or collaboration inquiries:
- π§ Email: zanwen@u.nus.edu
- π Website: https://autocoderover.dev/
- π GitHub: AutoCodeRoverSG