|
|
@@ -95,6 +95,7 @@ import type { ClineMessage } from "@roo-code/types"
|
|
|
import { readApiMessages, saveApiMessages, saveTaskMessages } from "../task-persistence"
|
|
|
import { getNonce } from "./getNonce"
|
|
|
import { getUri } from "./getUri"
|
|
|
+import { REQUESTY_BASE_URL } from "../../shared/utils/requesty"
|
|
|
|
|
|
/**
|
|
|
* https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
|
|
|
@@ -1470,8 +1471,8 @@ export class ClineProvider
|
|
|
|
|
|
// Requesty
|
|
|
|
|
|
- async handleRequestyCallback(code: string) {
|
|
|
- let { apiConfiguration, currentApiConfigName = "default" } = await this.getState()
|
|
|
+ async handleRequestyCallback(code: string, baseUrl: string | null) {
|
|
|
+ let { apiConfiguration } = await this.getState()
|
|
|
|
|
|
const newConfiguration: ProviderSettings = {
|
|
|
...apiConfiguration,
|
|
|
@@ -1480,7 +1481,16 @@ export class ClineProvider
|
|
|
requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId,
|
|
|
}
|
|
|
|
|
|
- await this.upsertProviderProfile(currentApiConfigName, newConfiguration)
|
|
|
+ // set baseUrl as undefined if we don't provide one
|
|
|
+ // or if it is the default requesty url
|
|
|
+ if (!baseUrl || baseUrl === REQUESTY_BASE_URL) {
|
|
|
+ newConfiguration.requestyBaseUrl = undefined
|
|
|
+ } else {
|
|
|
+ newConfiguration.requestyBaseUrl = baseUrl
|
|
|
+ }
|
|
|
+
|
|
|
+ const profileName = `Requesty (${new Date().toLocaleString()})`
|
|
|
+ await this.upsertProviderProfile(profileName, newConfiguration)
|
|
|
}
|
|
|
|
|
|
// Task history
|