Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [v4.210.0] - 2026-01-02

### Added

#### AI Code Reviews

- 1-click AI code reviews for all your agentic and manual changes
- Get all the review comments, suggestions and 1-click Apply all

![Demo](https://github.com/MatterAIOrg/public-assets/blob/a5bf692ecb15f62a8148b5bf998917b6566991ea/axon-ide-code-reviews.gif)

### Changed

- Improved ripgrep with file extension normalising
- UI improvments

---

## [v4.206.0] - 2025-12-29

### Added
Expand Down
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@

Axon Code delivers frontier model performance directly into your development environment, providing intelligent workflows, autonomous task execution, and deep codebase understanding. Built for enterprise-grade productivity with cutting-edge AI capabilities.

![Demo](https://res.cloudinary.com/dxvbskvxm/image/upload/v1763355416/axon-code_pe7tmc.gif)
![Demo](https://github.com/MatterAIOrg/public-assets/blob/34ba86e008bae7a8b41283222947249edd822b93/axon-vscode-demo-fast.gif)

## ✨ Key Features

| Feature | Status | Description |
|---------|--------|-------------|
| **Agent Mode** | ✅ | Autonomous task execution with intelligent planning |
| **Plan Mode** | ✅ | Structured approach to complex coding challenges |
| **Agentic Tool Calling** | ✅ | Advanced tool integration for comprehensive workflows |
| **Advanced Reasoning** | ✅ | Deep code understanding and problem-solving |
| **Codebase Indexing** | ✅ | Intelligent code navigation and search |
| **Tab Auto-Complete** | 🔄 | Smart code completion (Coming Soon) |
| Feature | Status | Description |
| ------------------------ | ------ | ------------------------------------------------------ |
| **Agent Mode** | ✅ | Autonomous task execution with intelligent planning |
| **Plan Mode** | ✅ | Structured approach to complex coding challenges |
| \*\*AI Code Reviews | ✅ | Detailed code reviews with suggestions and 1-click fix |
| **Agentic Tool Calling** | ✅ | Advanced tool integration for comprehensive workflows |
| **Advanced Reasoning** | ✅ | Deep code understanding and problem-solving |
| **Codebase Indexing** | ✅ | Intelligent code navigation and search |
| **Tab Auto-Complete** | 🔄 | Smart code completion (Coming Soon) |

## AI Code Reviews Demo

![Demo](https://github.com/MatterAIOrg/public-assets/blob/a5bf692ecb15f62a8148b5bf998917b6566991ea/axon-ide-code-reviews.gif)

## 🛠️ Supported Platforms

Expand All @@ -44,26 +49,31 @@ Axon Code delivers frontier model performance directly into your development env
Axon Code provides a comprehensive suite of intelligent tools:

### Core Development Tools

- **`fileEdit`** - Advanced diff-patch application system
- **`executeCommand`** - Secure CLI command execution
- **`read_multi_file`** - Multi-file reading and analysis
- **`writeToFile`** - Intelligent file creation and updates
- **`searchFiles`** - Advanced file search capabilities

### Web Integration

- **`web_search`** - Comprehensive web search
- **`web_fetch`** - Targeted link data extraction

### Task Management

- **`newTask`** - Create and manage complex tasks
- **`updateTodoList`** - Dynamic todo list management
- **`runSlashCommand`** - Execute custom slash commands

### Code Intelligence

- **`listCodeDefinitionNames`** - Code structure analysis
- **`listFiles`** - Intelligent file system navigation

### Communication

- **`askFollowupQuestion`** - Interactive user engagement
- **`attemptCompletion`** - Task completion verification
- **`fetchInstructions`** - Dynamic instruction retrieval
Expand All @@ -72,28 +82,31 @@ Axon Code provides a comprehensive suite of intelligent tools:

Choose the right model for your workflow:

| Model | Use Case | Capabilities |
|-------|----------|--------------|
| **`axon-code`** | Daily coding tasks | High intelligence, balanced performance |
| Model | Use Case | Capabilities |
| ------------------------- | --------------------- | -------------------------------------------- |
| **`axon-code`** | Daily coding tasks | High intelligence, balanced performance |
| **`axon-code-2-preview`** | Complex agentic tasks | Maximum intelligence, long-running workflows |
| **`axon-mini`** | Quick tasks | Lightweight, low-effort operations |
| **`axon-mini`** | Quick tasks | Lightweight, low-effort operations |

## 📦 Installation

### VS Code Extension

1. Open VS Code
2. Navigate to Extensions (`Ctrl+Shift+X`)
3. Search for "Axon Code"
4. Click Install

### JetBrains Plugin

1. Open JetBrains IDE
2. Go to Settings/Preferences
3. Navigate to Plugins
4. Search for "Axon Code"
5. Install and restart IDE

### CLI Installation

```bash
npm install -g @matterai/axon-code
```
Expand Down Expand Up @@ -121,6 +134,7 @@ Visit our [pricing page](https://www.matterai.so/pricing) for detailed plans and
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/matterai/axon-code.git
Expand Down
214 changes: 214 additions & 0 deletions src/core/kilocode/api/codeReviewService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
// kilocode_change - AI Code Review Service (Async Pattern)
import { getKiloUrlFromToken } from "@roo-code/types"
import axios from "axios"
import { CodeReviewResultsPayload } from "../../../shared/WebviewMessage"

export interface CodeReviewRequest {
git_diff: string
git_owner: string
git_repo: string
git_branch: string
git_user: string
}

export interface CodeReviewStartResponse {
requestId: string
status: "pending"
message: string
}

export interface CodeReviewStatusResponse {
status: "pending" | "processing" | "completed" | "failed"
result?: any
error?: string
createdAt: string
updatedAt: string
}

export class CodeReviewService {
private readonly POLLING_INTERVAL = 2000 // 2 seconds
private readonly MAX_POLLING_DURATION = 5 * 60 * 1000 // 5 minutes
private readonly REQUEST_TIMEOUT = 30 * 1000 // 30 seconds

constructor(private kilocodeToken: string) {}

async requestCodeReview(request: CodeReviewRequest): Promise<CodeReviewResultsPayload> {
return this.requestCodeReviewWithRetry(request, 3) // Max 3 retries for initial request
}

private async requestCodeReviewWithRetry(
request: CodeReviewRequest,
maxRetries: number,
): Promise<CodeReviewResultsPayload> {
const headers: Record<string, string> = {
Authorization: `Bearer ${this.kilocodeToken}`,
"Content-Type": "application/json",
}

try {
// Step 1: Start the async code review
const startResponse = await this.startCodeReview(request, headers)

// Step 2: Poll for results
const result = await this.pollForResults(startResponse.requestId, headers)
return result
} catch (error) {
// Check if this is a retryable error (timeout, network, 524, etc.)
const isRetryable = this.isRetryableError(error)

if (isRetryable && maxRetries > 0) {
// Exponential backoff: 1s, 2s, 4s
const delay = Math.pow(2, 3 - maxRetries) * 1000

await new Promise((resolve) => setTimeout(resolve, delay))
return this.requestCodeReviewWithRetry(request, maxRetries - 1)
}

throw new Error(`Code review failed: ${this.getErrorMessage(error)}`)
}
}

private async startCodeReview(
request: CodeReviewRequest,
headers: Record<string, string>,
): Promise<CodeReviewStartResponse> {
const url = getKiloUrlFromToken("https://api.matterai.so/codereview", this.kilocodeToken)

const response = await axios.post<CodeReviewStartResponse>(url, request, {
headers,
timeout: this.REQUEST_TIMEOUT,
})

return response.data
}

private async pollForResults(
requestId: string,
headers: Record<string, string>,
): Promise<CodeReviewResultsPayload> {
const startTime = Date.now()
let attempt = 0

while (Date.now() - startTime < this.MAX_POLLING_DURATION) {
attempt++

try {
const statusResponse = await this.getCodeReviewStatus(requestId, headers)

switch (statusResponse.status) {
case "pending":
break

case "processing":
break

case "completed":
return this.extractResults(statusResponse.result)

case "failed":
throw new Error(`Code review failed: ${statusResponse.error || "Unknown error"}`)

default:
throw new Error(`Unknown status: ${statusResponse.status}`)
}

// Wait before next poll
await new Promise((resolve) => setTimeout(resolve, this.POLLING_INTERVAL))
} catch (error) {
// If it's the final polling attempt, throw the error
if (Date.now() - startTime >= this.MAX_POLLING_DURATION) {
throw new Error(
`Code review polling timed out after ${this.MAX_POLLING_DURATION / 1000} seconds: ${this.getErrorMessage(error)}`,
)
}

// For network errors during polling, wait a bit longer before retry
if (this.isRetryableError(error)) {
await new Promise((resolve) => setTimeout(resolve, 3000))
} else {
// For non-retryable errors, don't retry
throw error
}
}
}

throw new Error(`Code review polling timed out after ${this.MAX_POLLING_DURATION / 1000} seconds`)
}

private async getCodeReviewStatus(
requestId: string,
headers: Record<string, string>,
): Promise<CodeReviewStatusResponse> {
const url = getKiloUrlFromToken(`https://api.matterai.so/codereview/${requestId}`, this.kilocodeToken)

const response = await axios.get<CodeReviewStatusResponse>(url, {
headers,
timeout: this.REQUEST_TIMEOUT,
})

return response.data
}

private extractResults(result: any): CodeReviewResultsPayload {
// Handle the new async response format
if (result?.codeChangeGeneration) {
return {
reviewBody: result.codeChangeGeneration.reviewBody,
reviewComments: result.codeChangeGeneration.reviewComments || [],
}
}

// Fallback if structure matches CodeReviewResultsPayload directly
return {
reviewBody: result?.reviewBody || "",
reviewComments: result?.reviewComments || [],
}
}

private isRetryableError(error: any): boolean {
// Check for timeout errors
if (axios.isAxiosError(error)) {
// ECONNABORTED = timeout
if (error.code === "ECONNABORTED") {
return true
}

// 524 = Cloudflare timeout
if (error.response?.status === 524) {
return true
}

// Network errors
if (error.code === "ENOTFOUND" || error.code === "ECONNREFUSED" || error.code === "ETIMEDOUT") {
return true
}
}

// Check for timeout in error message
const errorMessage = error instanceof Error ? error.message : String(error)
if (errorMessage.includes("timeout") || errorMessage.includes("524")) {
return true
}

return false
}

private getErrorMessage(error: any): string {
if (axios.isAxiosError(error)) {
if (error.response?.status === 524) {
return "Cloudflare timeout (524) - backend took too long to respond"
}
if (error.code === "ECONNABORTED") {
return "Request timeout"
}
if (error.response?.status) {
return `HTTP ${error.response.status}: ${error.response.statusText || "Unknown error"}`
}
if (error.code) {
return `Network error: ${error.code}`
}
}

return error instanceof Error ? error.message : String(error)
}
}
Loading
Loading