Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
5 changes: 0 additions & 5 deletions .changeset/agents-md-documentation.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/append-system-prompt-cli.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/enable-jetbrains-autocomplete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Enable autocomplete by default in the JetBrains extension
5 changes: 0 additions & 5 deletions .changeset/stupid-mayflies-pay.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/worktree-migration.md

This file was deleted.

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# kilo-code

## 4.143.0

### Minor Changes

- [#4643](https://github.com/Kilo-Org/kilocode/pull/4643) [`bf89c48`](https://github.com/Kilo-Org/kilocode/commit/bf89c4849342d9c0f3cfa335d65e98980d869e36) Thanks [@marius-kilocode](https://github.com/marius-kilocode)! - Migrate worktree creation from CLI to extension for parallel mode sessions

### Patch Changes

- [#4804](https://github.com/Kilo-Org/kilocode/pull/4804) [`e83c30a`](https://github.com/Kilo-Org/kilocode/commit/e83c30a4160309c45bcfedf60faad3eedff0549e) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add comprehensive AGENTS.md documentation page to Agent Behavior section

- [#4810](https://github.com/Kilo-Org/kilocode/pull/4810) [`2d8f5b4`](https://github.com/Kilo-Org/kilocode/commit/2d8f5b4f823750d22701d962ba27885b01f78acb) Thanks [@kiloconnect](https://github.com/apps/kiloconnect)! - Add `--append-system-prompt` CLI option to append custom instructions to the system prompt

- [#4808](https://github.com/Kilo-Org/kilocode/pull/4808) [`3253a5f`](https://github.com/Kilo-Org/kilocode/commit/3253a5f0a9ef3db176b0cc027a9a0f246faa27e6) Thanks [@markijbema](https://github.com/markijbema)! - Rename and reorganize autocomplete settings to use more familiar terminology

- [#4815](https://github.com/Kilo-Org/kilocode/pull/4815) [`1530050`](https://github.com/Kilo-Org/kilocode/commit/15300507c8febd2096282e97148e39a0bfda9e23) Thanks [@chrarnoldus](https://github.com/chrarnoldus)! - Allow null for tool arguments

## 4.142.0

### Minor Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
sidebar_position: 3
title: "Annual Billing"
---

# Annual Billing

# Overview

we want to switch to doing annual billing for teams and enterprise with a 1 month free and a "self-serve" sign up.

# Requirements

- no more 20$ of one time free credits on team signup per seat. **this is done**
- enable 30 day trial for both teams and enterprise
- no credit card required
- self-serve enterprise comes with no self-serve SSO. There's a button that puts them in touch with sales. (it costs us 125 a month for SSO per org)
- monthly plan is not accessible via the UI but is still in effect for existing customers and can be flagged back on easily.
- trial users can only upgrade to annual plans, 348/teams seat or $3588/ent seat, but we always talk about pricing in monthly terms.
- once trial expires, the organization will be denied access to the openrouter proxy endpoint, effectively disabling their kilocode usage w/ our API provider, and any existing outstanding credits they purchased will be locked up until they subscribe.

### Non-requirements

- fully self-service SSO enrollment for enterprise. There's still a bit of a touch required. Its possible to implement, but out of scope for this spec.
- pro-rated cancellation or refunds handled in a self-serve way.
- elastic seat counts with custom billing agreements for enterprise organizations.
- a full redesign of the team/enterprise sign up and pre-creation / marketing flow.

# System Design

System design is pretty straight-forward as we can _mostly_ leverage existing infrastructure and code.

- System remains the same other than adding a `billing_cycle` column to `organization_seats_purcahses` where we can track if it is `monthly` or `yearly`. The migration will set the default to `monthly` so we backfill all existing customers.
- We will use `created_at` on the organization as the start date for the free trial. If the organization does not have a valid entry in `organization_seats_purchases` after 30 days, we will disable their access to the openrouter proxy endpoint.

## Engineering Scope

#### Migrations:

- add `billing_cycle TEXT NOT NULL DEFAULT 'monthly'` to `organization_seats_purchases`.
- add `plan TEXT NOT NULL DEFAULT 'teams'` to `organizations` table which can be `teams` or `enterprise`. (While not strictly required we shouldn't rely on `seats_required` to decide if an org is a team or enterprise account and now is a good opportunity to fix this. Manually go through and set the very small number of design partner orgs and our org into `enterprise.` for now.)

#### Tasks:

- create yearly billing subscription product for teams AND for enterprise in stripe.
- change the organization create flow to create organization on submit (it does this now) but instead of redirecting to stripe to pay, redirect to organization page. Do not require an ahead-of-time seat count on either teams or enterprise.
- update logic for checking & displaying seats to take into consideration the free trial period, and allow invites for an unlimited number of seats while the trial is active.
- update subscription management page to allow for creating a new subscription from the page.
- update logic to actually block organizations which are not active on seats (they are either over their paid seat count or do not have an active seats purchases subscription). [a ticket for this already exists](https://github.com/orgs/Kilo-Org/projects/11?pane=issue&itemId=126001076&issue=Kilo-Org%7Ckilocode-backend%7C2167) note: this can wait until the end as by definition no one can have their trial expire for at least 30 days so we have a 30 day buffer to implement this.

### Marketing Scope

As a fast follow or in parallel the seats pod will pair up with someone from marketing or devrel to work on our engagement with this feature.

- update / redesign team/enterprise "create" page in app with better CTAs
- work with eng to get the 'buy credits' action more importantly called out when a new org is created. General org onboarding flow (both teams and enterprise) needs help.
- significantly improve call-to-action flows around upgrading to paid subscriptions with potentially progressively louder noise as we get closer to the end of trial notice.
- send welcome email when org is created explaining the trail period.
- probably cut new videos to show off the enterprise features

# Compliance Considerations

No compliance concerns.

# Features for the future

Talks about what we might want to build or improve upon in the future but is out-of-scope of this spec.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 4
title: "Spec: Enterprise MCP Controls"
title: "Enterprise MCP Controls"
---

# Spec: Enterprise MCP Controls
# Enterprise MCP Controls

### Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 2
title: "Spec Template"
---

# SPEC: Template
# Template

# Overview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 1
title: "Architecture Overview"
---

Expand All @@ -13,85 +13,51 @@ Kilo Code is a VS Code extension built with TypeScript that connects to various

```
┌─────────────────────────────────────────────────────────────────────┐
│ VS Code Extension
│ VS Code Extension │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Extension Host │ │ Webview UI │ │
│ │ (src/) │◀───▶│ (webview-ui/) │ │
│ └────────┬─────────┘ └──────────────────┘ │
│ │
│ │ Messages
│ ▼
│ │ │
│ │ Messages │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Core Services │ │
│ │ Core Services │ │
│ ├────────────┬────────────┬────────────┬───────────────────────┤ │
│ │ Tools │ Browser │ MCP │ Code Index │ │
│ │ Service │ Session │ Servers │ Service │ │
│ └────────────┴────────────┴────────────┴───────────────────────┘ │
│ │
│ │ API Calls
│ ▼
│ │ │
│ │ API Calls │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ API Provider Layer │ │
│ │ API Provider Layer │ │
│ ├────────────┬────────────┬────────────┬───────────────────────┤ │
│ │ Anthropic │ OpenAI │ Kilo │ OpenRouter │ │
│ │ API │ API │ Provider │ API │ │
│ └────────────┴────────────┴────────────┴───────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
```

## Key Components
### Features

### Extension Host (`src/`)
These pages document the architecture and design of a current or planned feature, as well as any unique development patterns.

The extension host runs in Node.js within VS Code and contains:
| Feature | Description |
| ------------------------------------------------------------------ | ------------------------------------------ |
| [Annual Billing](./annual-billing.md) | Annual subscription billing |
| [Enterprise MCP Controls](./enterprise-mcp-controls.md) | Admin controls for MCP server allowlists |
| [Onboarding Improvements](./onboarding-engagement-improvements.md) | User onboarding and engagement features |
| [Organization Modes Library](./organization-modes-library.md) | Shared modes for teams and enterprise |
| [Agentic Security Reviews](./security-reviews.md) | AI-powered security vulnerability analysis |
| [Track Repo URL](./track-repo-url.md) | Usage tracking by repository/project |
| [Vercel AI Gateway](./vercel-ai-gateway.md) | Vercel AI Gateway integration |
| [Voice Transcription](./voice-transcription.md) | Live voice input for chat |

- **`src/core/`** - The agent loop and core logic
- `Kilo.ts` - Main agent class that orchestrates interactions
- `prompts/` - System prompts and prompt construction
- `tools/` - Tool implementations (file operations, search, etc.)
- **`src/services/`** - Service implementations

- `browser/` - Puppeteer-based browser automation
- `checkpoints/` - Git-based state checkpoints
- `code-index/` - Codebase indexing and semantic search
- `mcp/` - Model Context Protocol server integration
- `commit-message/` - Git commit message generation

- **`src/api/`** - API provider implementations

- Handles communication with AI providers
- Manages streaming responses
- Implements provider-specific features

- **`src/activate/`** - Extension activation and command registration

### Webview UI (`webview-ui/`)

A React-based frontend that provides the chat interface:

- Built with React and TypeScript
- Uses VS Code's webview API
- Communicates with extension host via message passing
- Styled with Tailwind CSS

### Shared Packages (`packages/`)

Shared code used across the monorepo:

- `@kilocode/types` - Shared TypeScript types
- `@kilocode/telemetry` - Telemetry utilities

### Applications (`apps/`)

- `kilocode-docs` - This documentation site (Docusaurus)
- `kilocode-website` - Marketing website

### Command-Line Interface (`cli/`)

A standalone CLI for running Kilo Code outside of VS Code.
To propose a new feature design, consider using the [feature template](./feature-template.md).

## Key Concepts

Expand Down Expand Up @@ -191,5 +157,4 @@ The project uses:
## Further Reading

- [Development Environment](/contributing/development-environment) - Setup guide
- [Engineering Specs](/contributing/specs) - Technical specifications
- [Tools Reference](/features/tools/tool-use-overview) - Available tools
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 5
title: "Spec: Improve Onboarding Flow"
title: "Improve Onboarding Flow"
---

# SPEC: Kilo Code Onboarding & User Engagement Improvements
# Kilo Code Onboarding & User Engagement Improvements

# Overview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 6
title: "Spec: Organization Modes Library"
title: "Organization Modes Library"
---

# Spec: Organization Modes Library
# Organization Modes Library

# Overview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 7
title: "Spec: Agentic Security Reviews"
title: "Agentic Security Reviews"
---

# SPEC: Agentic Security Reviews
# Agentic Security Reviews

## Overview

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 8
title: "Spec: Track Usage by Repository URL"
title: "Track Usage by Repository URL"
---

# Spec: Track Usage by Project
# Track Usage by Project

# Overview

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
sidebar_position: 9
title: "Vercel AI Gateway"
---

# OpenRouter and Vercel AI Gateway API compatibility

Both OpenRouter and Vercel AI Gateway provide an OpenAI-compatible API.
They are largely compatible and Vercel even adopted some of OpenRouter's non-standard extensions.

OpenRouter API docs: https://openrouter.ai/docs/api/reference/overview

Vercel AI Gateway API docs: https://vercel.com/docs/ai-gateway/openai-compat

At time of writing, OpenRouter provides beta support for the Responses API, but Vercel does not: https://openrouter.ai/docs/api/reference/responses/overview

## Available models and identifiers

OpenRouter has more models than Vercel. The naming scheme is similar, sometimes identical but not always. For example `x-ai/grok-code-fast-1` (OpenRouter) has a different prefix from `xai/grok-code-fast-1` (Vercel). We will have to come up with a mapping from OpenRouter to Vercel model identifiers.

- https://openrouter.ai/models
- https://vercel.com/ai-gateway/models

## Reasoning

Vercel seems to have adopted OpenRouter's (non-standard) reasoning configuration:

- https://openrouter.ai/docs/api/reference/responses/reasoning#reasoning-configuration
- https://vercel.com/docs/ai-gateway/openai-compat#reasoning-configuration

Both Vercel and OpenRouter use the same `reasoning` property for reasoning content (the standard is `reasoning_content`, although our extension will accept both):

- https://openrouter.ai/docs/api/api-reference/chat/send-chat-completion-request#response.body.choices.message.reasoning
- https://vercel.com/docs/ai-gateway/openai-compat#response-format-with-reasoning

Vercel supports OpenRouter's way of preserving reasoning details in the Chat Completions API:

- https://openrouter.ai/docs/guides/best-practices/reasoning-tokens#preserving-reasoning-blocks
- https://vercel.com/docs/ai-gateway/openai-compat#preserving-reasoning-details-across-providers

Other providers would require use of the Responses API (e.g. xAI) or Anthropic API (e.g. MiniMax)

## Provider configuration

OpenRouter's and Vercel's provider configuration are different:

- https://openrouter.ai/docs/guides/routing/provider-selection
- https://vercel.com/docs/ai-gateway/openai-compat#provider-options

We will likely support OpenRouter's and convert between the two.

Inference provider identifiers appear similar at first glance, but they may not always be identical.

## Cost calculation

Whether Vercel includes cost in the response (like OpenRouter) is unclear. In the docs there's an embeddings example, which suggests that it does, but in a different format than OpenRouter:

- https://vercel.com/docs/ai-gateway/openai-compat#embeddings

We may have to estimate the cost in the extension instead.

There's a generation endpoint, which looks very similar to OpenRouter's at first glance:

- https://openrouter.ai/docs/api/api-reference/generations/get-generation
- https://vercel.com/docs/ai-gateway/usage#generation-lookup

# Deciding where to route traffic

We want to route some traffic to Vercel, ideally just enough so we can be first place on both leaderboards. However, we will initially start with a small portion of traffic < 5% and will evaluate whether it make sense to increase volume.

Vercel will also act as fallback if we encounter issues with OpenRouter (such as the issue with Grok Code Fast and OpenRouter recently). We need the ability to route certain providers and / or models to Vercel vs OpenRouter.

Requests from the same user for the same model should go to the same gateway for caching purposes.

We can randomize users to a gateway in a way similar to what was done for autocomplete: https://github.com/Kilo-Org/kilocode/pull/3857

Since not all models are available on Vercel, some traffic will have to go to OpenRouter regardless.
Loading
Loading