Skip to content

Commit e2adae3

Browse files
committed
Eliminate kilocode-openrouter strings
1 parent 7370100 commit e2adae3

File tree

18 files changed

+37
-54
lines changed

18 files changed

+37
-54
lines changed

cli/src/commands/__tests__/model.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("/model command", () => {
3737
glama: {},
3838
unbound: {},
3939
requesty: {},
40-
"kilocode-openrouter": {},
40+
kilocode: {},
4141
"io-intelligence": {},
4242
deepinfra: {},
4343
"vercel-ai-gateway": {},
@@ -400,7 +400,7 @@ describe("/model command", () => {
400400
glama: {},
401401
unbound: {},
402402
requesty: {},
403-
"kilocode-openrouter": {},
403+
kilocode: {},
404404
"io-intelligence": {},
405405
deepinfra: {},
406406
"vercel-ai-gateway": {},

cli/src/constants/providers/__tests__/models.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe("Static Provider Models", () => {
210210
glama: {},
211211
unbound: {},
212212
requesty: {},
213-
"kilocode-openrouter": {},
213+
kilocode: {},
214214
"io-intelligence": {},
215215
deepinfra: {},
216216
"vercel-ai-gateway": {},

cli/src/constants/providers/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type RouterName =
5656
| "glama"
5757
| "unbound"
5858
| "litellm"
59-
| "kilocode-openrouter"
59+
| "kilocode"
6060
| "ollama"
6161
| "lmstudio"
6262
| "io-intelligence"
@@ -94,7 +94,7 @@ export type RouterModels = Record<RouterName, ModelRecord>
9494
* Mapping from ProviderName to RouterName for model fetching
9595
*/
9696
export const PROVIDER_TO_ROUTER_NAME: Record<ProviderName, RouterName | null> = {
97-
kilocode: "kilocode-openrouter",
97+
kilocode: "kilocode",
9898
openrouter: "openrouter",
9999
ollama: "ollama",
100100
lmstudio: "lmstudio",

cli/src/utils/__tests__/context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe("context utilities", () => {
9999
}
100100

101101
const routerModels: Partial<RouterModels> = {
102-
"kilocode-openrouter": {
102+
kilocode: {
103103
"anthropic/claude-sonnet-4.5": {
104104
contextWindow: 200000,
105105
supportsPromptCache: true,

packages/types/src/provider-settings.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const dynamicProviders = [
4848
"huggingface",
4949
"litellm",
5050
// kilocode_change start
51-
"kilocode-openrouter",
51+
"kilocode",
5252
"ovhcloud",
5353
"chutes",
5454
"gemini",
@@ -665,7 +665,7 @@ export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
665665
"claude-code": "apiModelId",
666666
glama: "glamaModelId",
667667
openrouter: "openRouterModelId",
668-
"kilocode-openrouter": "openRouterModelId",
668+
kilocode: "kilocodeModel",
669669
bedrock: "apiModelId",
670670
vertex: "apiModelId",
671671
"openai-native": "openAiModelId",
@@ -696,7 +696,6 @@ export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
696696
"io-intelligence": "ioIntelligenceModelId",
697697
roo: "apiModelId",
698698
"vercel-ai-gateway": "vercelAiGatewayModelId",
699-
kilocode: "kilocodeModel",
700699
"virtual-quota-fallback": "apiModelId",
701700
ovhcloud: "ovhCloudAiEndpointsModelId", // kilocode_change
702701
inception: "inceptionLabsModelId", // kilocode_change
@@ -841,7 +840,6 @@ export const MODELS_BY_PROVIDER: Record<
841840
ovhcloud: { id: "ovhcloud", label: "OVHcloud AI Endpoints", models: [] },
842841
inception: { id: "inception", label: "Inception", models: [] },
843842
kilocode: { id: "kilocode", label: "Kilocode", models: [] },
844-
"kilocode-openrouter": { id: "kilocode-openrouter", label: "Kilocode", models: [] }, // temporarily needed to satisfy because we're using 2 inconsistent names apparently
845843
"virtual-quota-fallback": { id: "virtual-quota-fallback", label: "Virtual Quota Fallback", models: [] },
846844
// kilocode_change end
847845
deepinfra: { id: "deepinfra", label: "DeepInfra", models: [] },

src/api/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
121121
// kilocode_change start
122122
case "kilocode":
123123
return new KilocodeOpenrouterHandler(options)
124-
case "kilocode-openrouter": // temp typing fix
125-
return new KilocodeOpenrouterHandler(options)
126124
case "gemini-cli":
127125
return new GeminiCliHandler(options)
128126
case "virtual-quota-fallback":

src/api/providers/fetchers/modelCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const getModels = async (options: GetModelsOptions): Promise<ModelRecord>
9696
models = await getLiteLLMModels(options.apiKey, options.baseUrl)
9797
break
9898
// kilocode_change start
99-
case "kilocode-openrouter": {
99+
case "kilocode": {
100100
const backendUrl = options.kilocodeOrganizationId
101101
? `https://api.kilocode.ai/api/organizations/${options.kilocodeOrganizationId}`
102102
: "https://api.kilocode.ai/api/openrouter"

src/api/providers/kilocode-openrouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class KilocodeOpenrouterHandler extends OpenRouterHandler {
113113

114114
const [models, endpoints, defaultModel] = await Promise.all([
115115
getModels({
116-
provider: "kilocode-openrouter",
116+
provider: "kilocode",
117117
kilocodeToken: this.options.kilocodeToken,
118118
kilocodeOrganizationId: this.options.kilocodeOrganizationId,
119119
}),

src/core/webview/__tests__/ClineProvider.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ describe("ClineProvider - Router Models", () => {
27802780
roo: mockModels,
27812781
chutes: mockModels,
27822782
litellm: mockModels,
2783-
"kilocode-openrouter": mockModels,
2783+
kilocode: mockModels,
27842784
ollama: mockModels, // kilocode_change
27852785
lmstudio: {},
27862786
"vercel-ai-gateway": mockModels,
@@ -2855,7 +2855,7 @@ describe("ClineProvider - Router Models", () => {
28552855
ollama: {},
28562856
lmstudio: {},
28572857
litellm: {},
2858-
"kilocode-openrouter": {},
2858+
kilocode: {},
28592859
"vercel-ai-gateway": mockModels,
28602860
ovhcloud: mockModels, // kilocode_change
28612861
inception: mockModels, // kilocode_change
@@ -2893,7 +2893,7 @@ describe("ClineProvider - Router Models", () => {
28932893
type: "singleRouterModelFetchResponse",
28942894
success: false,
28952895
error: "Kilocode-OpenRouter API error",
2896-
values: { provider: "kilocode-openrouter" },
2896+
values: { provider: "kilocode" },
28972897
})
28982898

28992899
expect(mockPostMessage).toHaveBeenCalledWith({
@@ -3005,7 +3005,7 @@ describe("ClineProvider - Router Models", () => {
30053005
roo: mockModels,
30063006
chutes: mockModels,
30073007
litellm: {},
3008-
"kilocode-openrouter": mockModels,
3008+
kilocode: mockModels,
30093009
ollama: mockModels, // kilocode_change
30103010
lmstudio: {},
30113011
"vercel-ai-gateway": mockModels,

src/core/webview/__tests__/webviewMessageHandler.autoSwitch.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ describe("webviewMessageHandler - Automatic Organization Switching", () => {
149149
expect(refreshOrganizationModes).toHaveBeenCalled()
150150

151151
// Verify models were flushed and refetched (via upsertApiConfiguration handler)
152-
expect(flushModels).toHaveBeenCalledWith("kilocode-openrouter")
152+
expect(flushModels).toHaveBeenCalledWith("kilocode")
153153
expect(getModels).toHaveBeenCalledWith({
154-
provider: "kilocode-openrouter",
154+
provider: "kilocode",
155155
kilocodeOrganizationId: "org-1",
156156
kilocodeToken: "test-token",
157157
})
@@ -217,19 +217,19 @@ describe("webviewMessageHandler - Automatic Organization Switching", () => {
217217
})
218218

219219
// Verify flushModels was called (via upsertApiConfiguration)
220-
expect(flushModels).toHaveBeenCalledWith("kilocode-openrouter")
220+
expect(flushModels).toHaveBeenCalledWith("kilocode")
221221

222222
// Verify getModels was called with organization ID (via upsertApiConfiguration)
223223
expect(getModels).toHaveBeenCalledWith({
224-
provider: "kilocode-openrouter",
224+
provider: "kilocode",
225225
kilocodeOrganizationId: "org-1",
226226
kilocodeToken: "test-token",
227227
})
228228

229229
// Verify models were sent to webview (via upsertApiConfiguration)
230230
expect(mockPostMessageToWebview).toHaveBeenCalledWith({
231231
type: "routerModels",
232-
routerModels: { "kilocode-openrouter": { "model-1": {}, "model-2": {} } },
232+
routerModels: { kilocode: { "model-1": {}, "model-2": {} } },
233233
})
234234
})
235235
})

0 commit comments

Comments
 (0)