fix(sdk): sync default agent nullability

Follow-up for #7835 bot review
This commit is contained in:
Santiago Sainz
2026-03-27 20:48:13 -06:00
parent c9152865da
commit 1d2124c344
3 changed files with 12 additions and 9 deletions
+2 -6
View File
@@ -87,10 +87,6 @@ type KiloProviderOptions = {
slimEditMetadata?: boolean
}
type ConfigPatch = Partial<Config> & {
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<void> {
private async handleUpdateConfig(partial: Partial<Config>): Promise<void> {
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.
+1 -1
View File
@@ -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
*/
+9 -2
View File
@@ -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 @@
}
}
}
}
}