Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/light-birds-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": minor
---

send x-kilocode-mode header
8 changes: 8 additions & 0 deletions src/api/providers/__tests__/kilocode-openrouter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
X_KILOCODE_ORGANIZATIONID,
X_KILOCODE_PROJECTID,
X_KILOCODE_EDITORNAME,
X_KILOCODE_MODE,
} from "../../../shared/kilocode/headers"
import { streamSse } from "../../../services/continuedev/core/fetch/stream"

Expand Down Expand Up @@ -81,6 +82,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
},
Expand All @@ -96,6 +98,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
Expand All @@ -116,6 +119,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
Expand All @@ -137,6 +141,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
Expand All @@ -154,6 +159,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
Expand All @@ -172,6 +178,7 @@ describe("KilocodeOpenrouterHandler", () => {

expect(result).toEqual({
headers: {
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_EDITORNAME]: "Visual Studio Code 1.85.0",
},
Expand Down Expand Up @@ -229,6 +236,7 @@ describe("KilocodeOpenrouterHandler", () => {
// kilocode_change start
expect.objectContaining({
headers: expect.objectContaining({
[X_KILOCODE_MODE]: "code",
[X_KILOCODE_TASKID]: "test-task-id",
[X_KILOCODE_PROJECTID]: "https://github.com/user/repo.git",
[X_KILOCODE_ORGANIZATIONID]: "test-org-id",
Expand Down
5 changes: 5 additions & 0 deletions src/api/providers/kilocode-openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
X_KILOCODE_ORGANIZATIONID,
X_KILOCODE_TASKID,
X_KILOCODE_PROJECTID,
X_KILOCODE_MODE,
X_KILOCODE_TESTER,
X_KILOCODE_EDITORNAME,
} from "../../shared/kilocode/headers"
Expand Down Expand Up @@ -59,6 +60,10 @@ export class KilocodeOpenrouterHandler extends OpenRouterHandler {
[X_KILOCODE_EDITORNAME]: getEditorNameHeader(),
}

if (metadata?.mode) {
headers[X_KILOCODE_MODE] = metadata.mode
}

if (metadata?.taskId) {
headers[X_KILOCODE_TASKID] = metadata.taskId
}
Expand Down
1 change: 1 addition & 0 deletions src/shared/kilocode/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export const X_KILOCODE_ORGANIZATIONID = "X-KiloCode-OrganizationId"
export const X_KILOCODE_TASKID = "X-KiloCode-TaskId"
export const X_KILOCODE_PROJECTID = "X-KiloCode-ProjectId"
export const X_KILOCODE_EDITORNAME = "X-KiloCode-EditorName"
export const X_KILOCODE_MODE = "X-KiloCode-Mode"
export const X_KILOCODE_TESTER = "X-KILOCODE-TESTER"
Loading