Skip to content

Commit 0ca7554

Browse files
authored
fix: dont autoload kilo (anomalyco#14052)
1 parent 572a037 commit 0ca7554

File tree

2 files changed

+1
-176
lines changed

2 files changed

+1
-176
lines changed

packages/opencode/src/provider/provider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,8 @@ export namespace Provider {
580580
},
581581
kilo: async () => {
582582
return {
583-
autoload: true,
583+
autoload: false,
584584
options: {
585-
baseURL: "https://api.kilo.ai/api/gateway",
586585
headers: {
587586
"HTTP-Referer": "https://opencode.ai/",
588587
"X-Title": "opencode",

packages/opencode/test/provider/provider.test.ts

Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,177 +2218,3 @@ test("Google Vertex: supports OpenAI compatible models", async () => {
22182218
},
22192219
})
22202220
})
2221-
2222-
test("kilo provider loaded from config with env var", async () => {
2223-
await using tmp = await tmpdir({
2224-
init: async (dir) => {
2225-
await Bun.write(
2226-
path.join(dir, "opencode.json"),
2227-
JSON.stringify({
2228-
$schema: "https://opencode.ai/config.json",
2229-
provider: {
2230-
kilo: {
2231-
name: "Kilo",
2232-
npm: "@ai-sdk/openai-compatible",
2233-
env: ["KILO_API_KEY"],
2234-
api: "https://api.kilo.ai/api/gateway",
2235-
models: {
2236-
"anthropic/claude-sonnet-4-20250514": {
2237-
name: "Claude Sonnet 4 (via Kilo)",
2238-
tool_call: true,
2239-
attachment: true,
2240-
temperature: true,
2241-
limit: { context: 200000, output: 16384 },
2242-
},
2243-
},
2244-
},
2245-
},
2246-
}),
2247-
)
2248-
},
2249-
})
2250-
await Instance.provide({
2251-
directory: tmp.path,
2252-
init: async () => {
2253-
Env.set("KILO_API_KEY", "test-kilo-key")
2254-
},
2255-
fn: async () => {
2256-
const providers = await Provider.list()
2257-
expect(providers["kilo"]).toBeDefined()
2258-
expect(providers["kilo"].source).toBe("config")
2259-
expect(providers["kilo"].options.baseURL).toBe("https://api.kilo.ai/api/gateway")
2260-
expect(providers["kilo"].options.headers).toBeDefined()
2261-
expect(providers["kilo"].options.headers["HTTP-Referer"]).toBe("https://opencode.ai/")
2262-
expect(providers["kilo"].options.headers["X-Title"]).toBe("opencode")
2263-
const model = providers["kilo"].models["anthropic/claude-sonnet-4-20250514"]
2264-
expect(model).toBeDefined()
2265-
expect(model.name).toBe("Claude Sonnet 4 (via Kilo)")
2266-
},
2267-
})
2268-
})
2269-
2270-
test("kilo provider loaded from config without env var still has custom loader options", async () => {
2271-
await using tmp = await tmpdir({
2272-
init: async (dir) => {
2273-
await Bun.write(
2274-
path.join(dir, "opencode.json"),
2275-
JSON.stringify({
2276-
$schema: "https://opencode.ai/config.json",
2277-
provider: {
2278-
kilo: {
2279-
name: "Kilo",
2280-
npm: "@ai-sdk/openai-compatible",
2281-
env: ["KILO_API_KEY"],
2282-
api: "https://api.kilo.ai/api/gateway",
2283-
models: {
2284-
"anthropic/claude-sonnet-4-20250514": {
2285-
name: "Claude Sonnet 4 (via Kilo)",
2286-
tool_call: true,
2287-
attachment: true,
2288-
temperature: true,
2289-
limit: { context: 200000, output: 16384 },
2290-
},
2291-
},
2292-
},
2293-
},
2294-
}),
2295-
)
2296-
},
2297-
})
2298-
await Instance.provide({
2299-
directory: tmp.path,
2300-
fn: async () => {
2301-
const providers = await Provider.list()
2302-
expect(providers["kilo"]).toBeDefined()
2303-
expect(providers["kilo"].source).toBe("config")
2304-
expect(providers["kilo"].options.baseURL).toBe("https://api.kilo.ai/api/gateway")
2305-
expect(providers["kilo"].options.headers["HTTP-Referer"]).toBe("https://opencode.ai/")
2306-
expect(providers["kilo"].options.headers["X-Title"]).toBe("opencode")
2307-
},
2308-
})
2309-
})
2310-
2311-
test("kilo provider config options deeply merged with custom loader", async () => {
2312-
await using tmp = await tmpdir({
2313-
init: async (dir) => {
2314-
await Bun.write(
2315-
path.join(dir, "opencode.json"),
2316-
JSON.stringify({
2317-
$schema: "https://opencode.ai/config.json",
2318-
provider: {
2319-
kilo: {
2320-
name: "Kilo",
2321-
npm: "@ai-sdk/openai-compatible",
2322-
env: ["KILO_API_KEY"],
2323-
api: "https://api.kilo.ai/api/gateway",
2324-
options: {
2325-
apiKey: "custom-key-from-config",
2326-
},
2327-
models: {
2328-
"openai/gpt-4o": {
2329-
name: "GPT-4o (via Kilo)",
2330-
tool_call: true,
2331-
limit: { context: 128000, output: 16384 },
2332-
},
2333-
},
2334-
},
2335-
},
2336-
}),
2337-
)
2338-
},
2339-
})
2340-
await Instance.provide({
2341-
directory: tmp.path,
2342-
init: async () => {
2343-
Env.set("KILO_API_KEY", "test-kilo-key")
2344-
},
2345-
fn: async () => {
2346-
const providers = await Provider.list()
2347-
expect(providers["kilo"]).toBeDefined()
2348-
expect(providers["kilo"].options.headers["HTTP-Referer"]).toBe("https://opencode.ai/")
2349-
expect(providers["kilo"].options.apiKey).toBe("custom-key-from-config")
2350-
expect(providers["kilo"].models["openai/gpt-4o"]).toBeDefined()
2351-
expect(providers["kilo"].models["openai/gpt-4o"].name).toBe("GPT-4o (via Kilo)")
2352-
},
2353-
})
2354-
})
2355-
2356-
test("kilo provider with api key set via config apiKey", async () => {
2357-
await using tmp = await tmpdir({
2358-
init: async (dir) => {
2359-
await Bun.write(
2360-
path.join(dir, "opencode.json"),
2361-
JSON.stringify({
2362-
$schema: "https://opencode.ai/config.json",
2363-
provider: {
2364-
kilo: {
2365-
name: "Kilo",
2366-
npm: "@ai-sdk/openai-compatible",
2367-
env: ["KILO_API_KEY"],
2368-
api: "https://api.kilo.ai/api/gateway",
2369-
options: {
2370-
apiKey: "config-api-key",
2371-
},
2372-
models: {
2373-
"anthropic/claude-sonnet-4-20250514": {
2374-
name: "Claude Sonnet 4 (via Kilo)",
2375-
tool_call: true,
2376-
limit: { context: 200000, output: 16384 },
2377-
},
2378-
},
2379-
},
2380-
},
2381-
}),
2382-
)
2383-
},
2384-
})
2385-
await Instance.provide({
2386-
directory: tmp.path,
2387-
fn: async () => {
2388-
const providers = await Provider.list()
2389-
expect(providers["kilo"]).toBeDefined()
2390-
expect(providers["kilo"].source).toBe("config")
2391-
expect(providers["kilo"].options.apiKey).toBe("config-api-key")
2392-
},
2393-
})
2394-
})

0 commit comments

Comments
 (0)