Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dac1da2
feat(accessibility): Improves screen reader accessibility for indexin…
adamhill Aug 13, 2025
540ba29
Adjust position within context menus to be near Copilot
gerardbalaoro Aug 7, 2025
8605b76
Update famous-crabs-think.md
kevinvandijk Aug 19, 2025
a1a78d9
Make the organization selector look better
kevinvandijk Aug 13, 2025
d03c07c
Remove unnecessary local state
kevinvandijk Aug 17, 2025
3258252
Tweak organization selector so it can be displayed on chat view as well
kevinvandijk Aug 17, 2025
f80e2a2
Add organization selector to kilocode provider section
kevinvandijk Aug 17, 2025
8600535
Small tweaks too visual style
kevinvandijk Aug 17, 2025
f98934a
Changed py from 2 to 1.5 for OrganizationSelector
beatlevic Aug 18, 2025
4f1d5fc
Add hover effect
kevinvandijk Aug 17, 2025
580246a
Set organization back to personal if organization is no longer part o…
kevinvandijk Aug 18, 2025
f85a423
Add organization header to fetch models call for kilocode provider
kevinvandijk Aug 18, 2025
2c94c14
Fix Qwen Code link
chrarnoldus Aug 18, 2025
4d08ddb
Re-enable cache breakpoints for Gemini 2.5 Pro
chrarnoldus Aug 18, 2025
1407ea1
Update approval test
chrarnoldus Aug 18, 2025
ddd065b
feat(ollama): add API key support, enabling usage of Ollama Turbo
mcowgeratsigma Aug 19, 2025
0aaeeb7
Add translations
chrarnoldus Aug 19, 2025
90a11bb
Fix notifications overlap with organization selector (#2014)
kevinvandijk Aug 18, 2025
308a3c0
Changeset version bump (#2002)
kilocode-bot Aug 18, 2025
4c264f3
Add qwenCode.oauthLoadFailed error
chrarnoldus Aug 19, 2025
d4c58bf
Check delta defined
chrarnoldus Aug 19, 2025
b3ecf22
Expose reasoning for Sonic
chrarnoldus Aug 19, 2025
6ebda10
Set default headers
chrarnoldus Aug 19, 2025
d18c081
Kilo markers
chrarnoldus Aug 19, 2025
89b4ad7
Ignore providers that have a context window smaller than the advertis…
chrarnoldus Aug 19, 2025
f7f62ca
Add more telemetry
chrarnoldus Aug 19, 2025
f55292b
Simplify
chrarnoldus Aug 19, 2025
01e90dd
Create eleven-cougars-tap.md
chrarnoldus Aug 19, 2025
ec60458
Update eleven-cougars-tap.md
chrarnoldus Aug 19, 2025
0aa1bca
Update eleven-cougars-tap.md
chrarnoldus Aug 19, 2025
325809c
Add kilocode_change markers
chrarnoldus Aug 19, 2025
40046e6
Create nasty-rats-begin.md
chrarnoldus Aug 19, 2025
ba859a8
Skip Turbo Cache on VSIX Publish Workflow (#2011)
catrielmuller Aug 19, 2025
b66f058
Make provider list searchable and alphabetically sorted (#2029)
kevinvandijk Aug 19, 2025
fc40864
Changeset version bump (#2027)
kilocode-bot Aug 19, 2025
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: 5 additions & 0 deletions .changeset/famous-crabs-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Adjust position within context menus to be below default items
34 changes: 0 additions & 34 deletions .changeset/social-times-march.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/marketplace-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Package Extension
run: |
current_package_version=$(node -p "require('./src/package.json').version")
pnpm build
pnpm vsix:production

# Save VSIX contents to a temporary file to avoid broken pipe issues.
unzip -l bin/kilo-code-${current_package_version}.vsix > /tmp/kilo-code-vsix-contents.txt
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# kilo-code

## [v4.82.1]

- [#2021](https://github.com/Kilo-Org/kilocode/pull/2021) [`02adf7c`](https://github.com/Kilo-Org/kilocode/commit/02adf7c4780170125e0f54beaeb5a3cbbd972669) Thanks [@chrarnoldus](https://github.com/chrarnoldus)! - OpenRouter inference providers whose context window is smaller than that of the top provider for a particular model are now automatically ignored by default. They can still be used by selecting them specifically in the Provider Routing settings.

- [#2015](https://github.com/Kilo-Org/kilocode/pull/2015) [`e5c7641`](https://github.com/Kilo-Org/kilocode/commit/e5c76411cc3ff6f5aae53e5d1e39775d6830e03e) Thanks [@mcowger](https://github.com/mcowger)! - Add API key support to the Ollama provider, enabling usage of Ollama Turbo

- [#2029](https://github.com/Kilo-Org/kilocode/pull/2029) [`64c6955`](https://github.com/Kilo-Org/kilocode/commit/64c695517dd8a5556c418d88c8338ea090ea09a9) Thanks [@kevinvandijk](https://github.com/kevinvandijk)! - Add search to provider list and sort it alphabetically

## [v4.82.0]

- [#1974](https://github.com/Kilo-Org/kilocode/pull/1974) [`ec18e51`](https://github.com/Kilo-Org/kilocode/commit/ec18e51d7f38c2f5ee21a02cf2290be21223119b) Thanks [@kevinvandijk](https://github.com/kevinvandijk)! - Include changes from Roo Code 3.25.14

- Fix: Only include verbosity parameter for models that support it (#7054 by @eastonmeth, PR by @app/roomote)
- Fix: AWS Bedrock 1M context - Move anthropic_beta to additionalModelRequestFields (thanks @daniel-lxs!)
- Fix: Make cancelling requests more responsive by reverting recent changes
- Add Sonnet 1M context checkbox to Bedrock
- Fix: add --no-messages flag to ripgrep to suppress file access errors (#6756 by @R-omk, PR by @app/roomote)
- Add support for AGENT.md alongside AGENTS.md (#6912 by @Brendan-Z, PR by @app/roomote)
- Remove deprecated GPT-4.5 Preview model (thanks @PeterDaveHello!)
- Update: Claude Sonnet 4 context window configurable to 1 million tokens in Anthropic provider (thanks @daniel-lxs!)
- Add: Minimal reasoning support to OpenRouter (thanks @daniel-lxs!)
- Fix: Add configurable API request timeout for local providers (#6521 by @dabockster, PR by @app/roomote)
- Fix: Add --no-sandbox flag to browser launch options (#6632 by @QuinsZouls, PR by @QuinsZouls)
- Fix: Ensure JSON files respect .kilocodeignore during indexing (#6690 by @evermoving, PR by @app/roomote)
- Add: New Chutes provider models (#6698 by @fstandhartinger, PR by @app/roomote)
- Add: OpenAI gpt-oss models to Amazon Bedrock dropdown (#6752 by @josh-clanton-powerschool, PR by @app/roomote)
- Fix: Correct tool repetition detector to not block first tool call when limit is 1 (#6834 by @NaccOll, PR by @app/roomote)
- Fix: Improve checkpoint service initialization handling (thanks @NaccOll!)
- Update: Improve zh-TW Traditional Chinese locale (thanks @PeterDaveHello!)
- Add: Task expand and collapse translations (thanks @app/roomote!)
- Update: Exclude GPT-5 models from 20% context window output token cap (thanks @app/roomote!)
- Fix: Truncate long model names in model selector to prevent overflow (thanks @app/roomote!)
- Add: Requesty base url support (thanks @requesty-JohnCosta27!)
- Add: Native OpenAI provider support for Codex Mini model (#5386 by @KJ7LNW, PR by @daniel-lxs)
- Add: IO Intelligence Provider support (thanks @ertan2002!)
- Fix: MCP startup issues and remove refresh notifications (thanks @hannesrudolph!)
- Fix: Improvements to GPT-5 OpenAI provider configuration (thanks @hannesrudolph!)
- Fix: Clarify codebase_search path parameter as optional and improve tool descriptions (thanks @app/roomote!)
- Fix: Bedrock provider workaround for LiteLLM passthrough issues (thanks @jr!)
- Fix: Token usage and cost being underreported on cancelled requests (thanks @chrarnoldus!)

## [v4.81.0]

- [#1868](https://github.com/Kilo-Org/kilocode/pull/1868) [`50638b4`](https://github.com/Kilo-Org/kilocode/commit/50638b4226aa3de24f5a9b825a8ef7f1e4d376f6) Thanks [@Toukaiteio](https://github.com/Toukaiteio)! - Add Support For Qwen Code
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build": "pnpm vsix",
"bundle": "turbo bundle --log-order grouped --output-logs new-only",
"bundle:nightly": "turbo bundle:nightly --log-order grouped --output-logs new-only",
"vsix:production": "turbo vsix --log-order grouped --output-logs new-only --force",
"vsix": "turbo vsix --log-order grouped --output-logs new-only",
"vsix:nightly": "turbo vsix:nightly --log-order grouped --output-logs new-only",
"clean": "turbo clean --log-order grouped --output-logs new-only && rimraf dist out bin .vite-port .turbo",
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const openAiSchema = baseProviderSettingsSchema.extend({
const ollamaSchema = baseProviderSettingsSchema.extend({
ollamaModelId: z.string().optional(),
ollamaBaseUrl: z.string().optional(),
ollamaApiKey: z.string().optional(), // kilocode_change
})

const vsCodeLmSchema = baseProviderSettingsSchema.extend({
Expand Down
4 changes: 4 additions & 0 deletions packages/types/src/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export const OPEN_ROUTER_PROMPT_CACHING_MODELS = new Set([
"anthropic/claude-sonnet-4",
"anthropic/claude-opus-4",
"anthropic/claude-opus-4.1",
// kilocode_change start
"google/gemini-2.5-pro",
"google/gemini-2.5-pro-preview",
// kilocode_change end
"google/gemini-2.5-flash-preview",
"google/gemini-2.5-flash-preview:thinking",
"google/gemini-2.5-flash-preview-05-20",
Expand Down
1 change: 1 addition & 0 deletions src/api/providers/fetchers/__tests__/openrouter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe("OpenRouter API", () => {

// Define models that are intentionally excluded
const excludedModels = new Set([
"google/gemini-2.5-pro", // kilocode_change: not included in mock response
"google/gemini-2.5-pro-preview", // Excluded due to lag issue (#4487)
"google/gemini-2.5-flash", // OpenRouter doesn't report this as supporting prompt caching
"google/gemini-2.5-flash-lite-preview-06-17", // OpenRouter doesn't report this as supporting prompt caching
Expand Down
3 changes: 3 additions & 0 deletions src/api/providers/fetchers/modelCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export const getModels = async (options: GetModelsOptions): Promise<ModelRecord>
case "kilocode-openrouter":
models = await getOpenRouterModels({
openRouterBaseUrl: getKiloBaseUriFromToken(options.kilocodeToken ?? "") + "/api/openrouter",
headers: options.kilocodeOrganizationId
? { "X-KiloCode-OrganizationId": options.kilocodeOrganizationId }
: undefined,
Comment on lines +85 to +87
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Models cache can bleed across organizations — key the memory cache by organization.

You’re now varying the response via X-KiloCode-OrganizationId, but the memory cache key is still just provider. If a user switches orgs within the TTL, they’ll see the prior org’s models. That’s the kind of subtle bug that makes people think the cosmos is conspiring.

Recommend deriving a cacheKey that includes org context (and optionally baseUrl), e.g.:

// inside getModels(...)
const { provider, kilocodeOrganizationId, baseUrl } = options
const cacheKey =
  provider === "kilocode-openrouter"
    ? `${provider}:${kilicodeOrganizationId ?? "personal"}:${baseUrl ?? ""}`
    : `${provider}:${baseUrl ?? ""}`

let models = memoryCache.get<ModelRecord>(cacheKey)
if (models) return models

// ...
memoryCache.set(cacheKey, models)

If you want to keep the existing exports unchanged, implement the cacheKey locally in getModels and keep the public getModelsFromCache/flushModels untouched for now.

🤖 Prompt for AI Agents
In src/api/providers/fetchers/modelCache.ts around lines 85-87, the memory cache
key currently uses only the provider, allowing models to bleed across
organizations when X-KiloCode-OrganizationId varies; derive a local cacheKey
inside getModels that includes provider plus organization context
(kilocodeOrganizationId, using a fallback like "personal") and optionally
baseUrl for uniqueness, then use memoryCache.get(cacheKey) and
memoryCache.set(cacheKey, models) instead of the provider-only key; keep
existing exported helpers (getModelsFromCache/flushModels) unchanged if you want
to preserve public API.

})
break
case "cerebras":
Expand Down
3 changes: 2 additions & 1 deletion src/api/providers/fetchers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {

import type { ApiHandlerOptions } from "../../../shared/api"
import { parseApiPrice } from "../../../shared/cost"
import { DEFAULT_HEADERS } from "../constants" // kilocode_change

/**
* OpenRouterBaseModel
Expand Down Expand Up @@ -103,7 +104,7 @@ export async function getOpenRouterModels(

try {
const response = await axios.get<OpenRouterModelsResponse>(`${baseURL}/models`, {
headers: options?.headers, // kilocode_change: added headers
headers: { ...DEFAULT_HEADERS, ...(options?.headers ?? {}) }, // kilocode_change: added headers
})
const result = openRouterModelsResponseSchema.safeParse(response.data)
const data = result.success ? result.data.data : response.data.data
Expand Down
8 changes: 7 additions & 1 deletion src/api/providers/kilocode-ollama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const OLLAMA_TIMEOUT_MS = 3_600_000
interface OllamaHandlerOptions {
ollamaBaseUrl?: string
ollamaModelId?: string
ollamaApiKey?: string
}

export class KilocodeOllamaHandler extends BaseProvider {
Expand All @@ -140,9 +141,14 @@ export class KilocodeOllamaHandler extends BaseProvider {
private ensureClient(): Ollama {
if (!this.client) {
try {
const headers = this.options.ollamaApiKey
? { Authorization: this.options.ollamaApiKey } //Yes, this is weird, its not a Bearer token
: undefined

this.client = new Ollama({
host: this.options.ollamaBaseUrl || "http://localhost:11434",
fetch: fetchWithTimeout(OLLAMA_TIMEOUT_MS),
fetch: fetchWithTimeout(OLLAMA_TIMEOUT_MS, headers),
headers: headers,
})
} catch (error) {
throw new Error(`Error creating Ollama client: ${error.message}`)
Expand Down
1 change: 1 addition & 0 deletions src/api/providers/kilocode-openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class KilocodeOpenrouterHandler extends OpenRouterHandler {
getModels({
provider: "kilocode-openrouter",
kilocodeToken: this.options.kilocodeToken,
kilocodeOrganizationId: this.options.kilocodeOrganizationId,
}),
getModelEndpoints({
router: "openrouter",
Expand Down
15 changes: 11 additions & 4 deletions src/api/providers/kilocode/fetchWithTimeout.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import * as undici from "undici"

export function fetchWithTimeout(timeoutMs: number): typeof fetch {
export function fetchWithTimeout(timeoutMs: number, headers?: Record<string, string>): typeof fetch {
const agent = new undici.Agent({ headersTimeout: timeoutMs, bodyTimeout: timeoutMs })
return (input, init) =>
undici.fetch(
return async (input, init) => {
const mergedHeaders = {
...headers, // Persistent headers from function parameter
...(init?.headers || {}), // Request-specific headers (can override persistent ones)
}
const response = (await undici.fetch(
input as undici.RequestInfo,
{
...init,
headers: mergedHeaders,
dispatcher: agent,
} as undici.RequestInit,
) as unknown as Promise<Response>
)) as unknown as Response
return response
}
}
48 changes: 42 additions & 6 deletions src/api/providers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
OPENROUTER_DEFAULT_PROVIDER_NAME,
OPEN_ROUTER_PROMPT_CACHING_MODELS,
DEEP_SEEK_DEFAULT_TEMPERATURE,
ModelInfo, // kilocode_change
} from "@roo-code/types"

import type { ApiHandlerOptions, ModelRecord } from "../../shared/api"
Expand All @@ -33,6 +34,7 @@ import type {
type OpenRouterProviderParams = {
order?: string[]
only?: string[]
ignore?: string[] // kilocode_change
allow_fallbacks?: boolean
data_collection?: "allow" | "deny"
sort?: "price" | "throughput" | "latency"
Expand Down Expand Up @@ -94,7 +96,18 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
return (lastUsage.cost_details?.upstream_inference_cost || 0) + (lastUsage.cost || 0)
}

getProviderParams(): { provider?: OpenRouterProviderParams } {
getIgnoredProviders(model: ModelInfo): string[] | undefined {
const endpoints = Object.entries(this.endpoints)
const ignoredProviders = endpoints
.filter((endpoint) => endpoint[1].contextWindow < model.contextWindow)
.map((endpoint) => endpoint[0])
if (ignoredProviders.length > 0 && ignoredProviders.length < endpoints.length) {
return ignoredProviders
}
return undefined
}

getProviderParams(model: ModelInfo): { provider?: OpenRouterProviderParams } {
if (this.options.openRouterSpecificProvider && this.endpoints[this.options.openRouterSpecificProvider]) {
return {
provider: {
Expand All @@ -104,9 +117,15 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
},
}
}
if (this.options.openRouterProviderDataCollection || this.options.openRouterProviderSort) {
const ignoredProviders = this.getIgnoredProviders(model)
if (
(ignoredProviders?.length ?? 0) > 0 ||
this.options.openRouterProviderDataCollection ||
this.options.openRouterProviderSort
) {
return {
provider: {
ignore: ignoredProviders,
data_collection: this.options.openRouterProviderDataCollection,
sort: this.options.openRouterProviderSort,
},
Expand Down Expand Up @@ -169,7 +188,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
messages: openAiMessages,
stream: true,
stream_options: { include_usage: true },
...this.getProviderParams(), // kilocode_change: original expression was moved into function
...this.getProviderParams(model.info), // kilocode_change: original expression was moved into function
...(transforms && { transforms }),
...(reasoning && { reasoning }),
}
Expand All @@ -192,10 +211,21 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH

const delta = chunk.choices[0]?.delta

if ("reasoning" in delta && delta.reasoning && typeof delta.reasoning === "string") {
if (
delta /* kilocode_change */ &&
"reasoning" in delta &&
delta.reasoning &&
typeof delta.reasoning === "string"
) {
yield { type: "reasoning", text: delta.reasoning }
}

// kilocode_change start
if (delta && "reasoning_content" in delta && typeof delta.reasoning_content === "string") {
yield { type: "reasoning", text: delta.reasoning_content }
}
// kilocode_change end

if (delta?.content) {
yield { type: "text", text: delta.content }
}
Expand Down Expand Up @@ -260,15 +290,21 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
}

async completePrompt(prompt: string) {
let { id: modelId, maxTokens, temperature, reasoning } = await this.fetchModel()
let {
id: modelId,
maxTokens,
temperature,
reasoning,
info: modelInfo, // kilocode_change
} = await this.fetchModel()

const completionParams: OpenRouterChatCompletionParams = {
model: modelId,
max_tokens: maxTokens,
temperature,
messages: [{ role: "user", content: prompt }],
stream: false,
...this.getProviderParams(), // kilocode_change: original expression was moved into function
...this.getProviderParams(modelInfo), // kilocode_change: original expression was moved into function
...(reasoning && { reasoning }),
}

Expand Down
17 changes: 17 additions & 0 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,22 @@ export class ClineProvider
}
}

function getOpenRouter() {
if (
apiConfiguration &&
(apiConfiguration.apiProvider === "openrouter" || apiConfiguration.apiProvider === "kilocode")
) {
return {
openRouter: {
sort: apiConfiguration.openRouterProviderSort,
dataCollection: apiConfiguration.openRouterProviderDataCollection,
specificProvider: apiConfiguration.openRouterSpecificProvider,
},
}
}
return {}
}

function getMemory() {
try {
return { memory: { ...process.memoryUsage() } }
Expand Down Expand Up @@ -2388,6 +2404,7 @@ export class ClineProvider
...(await getModelId()),
...getMemory(),
...getFastApply(),
...getOpenRouter(),
// kilocode_change end
diffStrategy: task?.diffStrategy?.getName(),
isSubtask: task ? !!task.parentTask : undefined,
Expand Down
Loading
Loading