mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-30 19:32:39 +08:00
fix(sdk): sync default agent nullability
Follow-up for #7835 bot review
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user