From 90eb044e6c016f805660f726c203b6bcb3328a81 Mon Sep 17 00:00:00 2001 From: Eamon Nerbonne Date: Tue, 10 Jun 2025 17:55:25 +0200 Subject: [PATCH 1/2] Add version header --- src/api/providers/constants.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/providers/constants.ts b/src/api/providers/constants.ts index 07eb8176665..e87ad80551a 100644 --- a/src/api/providers/constants.ts +++ b/src/api/providers/constants.ts @@ -1,4 +1,7 @@ +import { Package } from "../../shared/package" + export const DEFAULT_HEADERS = { "HTTP-Referer": "https://kilocode.ai", "X-Title": "Kilo Code", + "X-KiloCode-Version": Package.version, } From 4c5f8721538e642efb2fe12f5ada6fb7b66ee9c2 Mon Sep 17 00:00:00 2001 From: Kilo Code Date: Tue, 10 Jun 2025 11:11:46 -0700 Subject: [PATCH 2/2] test(api): add version header to API request tests Adds a test case to verify that the `X-KiloCode-Version` header is included in default headers for OpenAI and Requesty API calls. This ensures the version header is correctly passed in API requests. --- src/api/providers/__tests__/openai.spec.ts | 1 + src/api/providers/__tests__/requesty.test.ts | 1 + src/api/providers/constants.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/providers/__tests__/openai.spec.ts b/src/api/providers/__tests__/openai.spec.ts index b3c48f61a18..30ae7009dfb 100644 --- a/src/api/providers/__tests__/openai.spec.ts +++ b/src/api/providers/__tests__/openai.spec.ts @@ -104,6 +104,7 @@ describe("OpenAiHandler", () => { defaultHeaders: { "HTTP-Referer": "https://kilocode.ai", "X-Title": "Kilo Code", + "X-KiloCode-Version": expect.any(String), // kilocode_change }, }) }) diff --git a/src/api/providers/__tests__/requesty.test.ts b/src/api/providers/__tests__/requesty.test.ts index 7ca37b07238..c13cf7f782e 100644 --- a/src/api/providers/__tests__/requesty.test.ts +++ b/src/api/providers/__tests__/requesty.test.ts @@ -47,6 +47,7 @@ describe("RequestyHandler", () => { defaultHeaders: { "HTTP-Referer": "https://kilocode.ai", "X-Title": "Kilo Code", + "X-KiloCode-Version": expect.any(String), // kilocode_change }, }) }) diff --git a/src/api/providers/constants.ts b/src/api/providers/constants.ts index e87ad80551a..c63141b268c 100644 --- a/src/api/providers/constants.ts +++ b/src/api/providers/constants.ts @@ -3,5 +3,5 @@ import { Package } from "../../shared/package" export const DEFAULT_HEADERS = { "HTTP-Referer": "https://kilocode.ai", "X-Title": "Kilo Code", - "X-KiloCode-Version": Package.version, + "X-KiloCode-Version": Package.version, // kilocode_change }