From 1d69a2b4424928ae3de7d6c2fe34d0c74ae4fbcb Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 6 Jul 2026 12:33:26 +0200 Subject: [PATCH] feat(gateway): send version headers on notification requests Wire fetchKilocodeNotifications up to the shared header helpers (getDefaultHeaders + buildKiloHeaders) so notification requests carry User-Agent, X-KILOCODE-EDITORNAME, and org headers instead of only Authorization/Content-Type. Also set KILOCODE_VERSION to the extension version when spawning kilo serve so the extension version flows into the User-Agent, letting the backend discriminate on extension version. --- packages/kilo-gateway/src/api/notifications.ts | 4 +++- .../kilo-vscode/src/services/cli-backend/server-manager.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/kilo-gateway/src/api/notifications.ts b/packages/kilo-gateway/src/api/notifications.ts index 0112ccd14c5..669139e1b20 100644 --- a/packages/kilo-gateway/src/api/notifications.ts +++ b/packages/kilo-gateway/src/api/notifications.ts @@ -1,5 +1,6 @@ import { z } from "zod" import { KILO_API_BASE } from "./constants.js" +import { getDefaultHeaders, buildKiloHeaders } from "../headers.js" /** * Kilo notification schema @@ -44,8 +45,9 @@ export async function fetchKilocodeNotifications(options: { try { const response = await fetch(url, { headers: { + ...getDefaultHeaders(), + ...buildKiloHeaders(undefined, { kilocodeOrganizationId: options.kilocodeOrganizationId }), Authorization: `Bearer ${token}`, - "Content-Type": "application/json", }, signal: AbortSignal.timeout(NOTIFICATIONS_TIMEOUT_MS), }) diff --git a/packages/kilo-vscode/src/services/cli-backend/server-manager.ts b/packages/kilo-vscode/src/services/cli-backend/server-manager.ts index d988b5de65b..4280b7094db 100644 --- a/packages/kilo-vscode/src/services/cli-backend/server-manager.ts +++ b/packages/kilo-vscode/src/services/cli-backend/server-manager.ts @@ -142,6 +142,7 @@ export class ServerManager { KILO_MACHINE_ID: vscode.env.machineId, KILO_APP_VERSION: this.context.extension.packageJSON.version, KILO_VSCODE_VERSION: vscode.version, + KILOCODE_VERSION: this.context.extension.packageJSON.version, KILOCODE_EDITOR_NAME: `${vscode.env.appName} ${vscode.version}`, ...(!claudeCompat && { KILO_DISABLE_CLAUDE_CODE: "true" }), ...resolveTreeSitterEnv(this.context.extensionPath),