From 1d2124c34429217fcb310b0a3f6f9005cd3634ea Mon Sep 17 00:00:00 2001 From: Santiago Sainz Date: Fri, 27 Mar 2026 20:48:13 -0600 Subject: [PATCH] fix(sdk): sync default agent nullability Follow-up for #7835 bot review --- packages/kilo-vscode/src/KiloProvider.ts | 8 ++------ packages/sdk/js/src/v2/gen/types.gen.ts | 2 +- packages/sdk/openapi.json | 11 +++++++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 05116b5e5f5..ba24906f0f9 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -87,10 +87,6 @@ type KiloProviderOptions = { slimEditMetadata?: boolean } -type ConfigPatch = Partial & { - default_agent?: string | null -} - export class KiloProvider implements vscode.WebviewViewProvider, TelemetryPropertiesProvider { public static readonly viewType = "kilo-code.SidebarProvider" @@ -1898,7 +1894,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper * Applies a partial config update via the global config endpoint, then pushes * the full merged config back to the webview. */ - private async handleUpdateConfig(partial: ConfigPatch): Promise { + private async handleUpdateConfig(partial: Partial): Promise { if (!this.client || this.connectionState !== "connected") { this.postMessage({ type: "error", message: "Not connected to CLI backend" }) return @@ -1914,7 +1910,7 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper // races with the async config.update() write on the CLI backend). this.pending++ try { - await this.client.global.config.update({ config: partial as Config }, { throwOnError: true }) + await this.client.global.config.update({ config: partial }, { throwOnError: true }) // Re-fetch the full merged config (global + project + all layers) so the // webview receives the complete resolved config, not just global-only data. diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index af5ae1d6b6d..6928101b137 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -1412,7 +1412,7 @@ export type Config = { /** * Default agent to use when none is specified. Must be a primary agent. Falls back to 'code' if not set or if the specified agent is invalid. */ - default_agent?: string + default_agent?: string | null /** * Custom username to display in conversations instead of system username */ diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 8393d52605d..62b3f4c921d 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -13033,7 +13033,14 @@ }, "default_agent": { "description": "Default agent to use when none is specified. Must be a primary agent. Falls back to 'code' if not set or if the specified agent is invalid.", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "username": { "description": "Custom username to display in conversations instead of system username", @@ -14882,4 +14889,4 @@ } } } -} \ No newline at end of file +}