Fix options to buildApiHandler (#5064)
* add missing taskId to buildApiHandler * remove console log
This commit is contained in:
1 parent
8d5985c8fd
commit
c040db6d71
3 files changed
+5
-4
No files matched your search
@@ -258,7 +258,7 @@ export class Controller {
|
||||
// Update API handler with new mode (buildApiHandler now selects provider based on mode)
|
||||
if (this.task) {
|
||||
const { apiConfiguration } = await getAllExtensionState(this.context)
|
||||
this.task.api = buildApiHandler(apiConfiguration, chatSettings.mode)
|
||||
this.task.api = buildApiHandler({ ...apiConfiguration, taskId: this.task.taskId }, chatSettings.mode)
|
||||
}
|
||||
|
||||
// Save only non-mode properties to global storage
|
||||
@@ -353,7 +353,7 @@ export class Controller {
|
||||
await updateGlobalState(this.context, "welcomeViewCompleted", true)
|
||||
|
||||
if (this.task) {
|
||||
this.task.api = buildApiHandler(updatedConfig, currentMode)
|
||||
this.task.api = buildApiHandler({ ...updatedConfig, taskId: this.task.taskId }, currentMode)
|
||||
}
|
||||
|
||||
await this.postStateToWebview()
|
||||
@@ -521,6 +521,7 @@ export class Controller {
|
||||
const updatedConfig = {
|
||||
...apiConfiguration,
|
||||
openRouterApiKey: apiKey,
|
||||
taskId: this.task.taskId,
|
||||
}
|
||||
this.task.api = buildApiHandler(updatedConfig, currentMode)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function updateApiConfigurationProto(
|
||||
// Update the task's API handler if there's an active task
|
||||
if (controller.task) {
|
||||
const currentMode = await controller.getCurrentMode()
|
||||
controller.task.api = buildApiHandler(appApiConfiguration, currentMode)
|
||||
controller.task.api = buildApiHandler({ ...appApiConfiguration, taskId: controller.task.taskId }, currentMode)
|
||||
}
|
||||
|
||||
// Post updated state to webview
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function updateSettings(controller: Controller, request: UpdateSett
|
||||
|
||||
if (controller.task) {
|
||||
const currentMode = await controller.getCurrentMode()
|
||||
controller.task.api = buildApiHandler(apiConfiguration, currentMode)
|
||||
controller.task.api = buildApiHandler({ ...apiConfiguration, taskId: controller.task.taskId }, currentMode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user