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.
This commit is contained in:
Mark IJbema
2026-07-06 12:33:26 +02:00
parent 1fc8f066fd
commit 1d69a2b442
2 changed files with 4 additions and 1 deletions
@@ -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),
})
@@ -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),