|
@@ -64,7 +64,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
private clineStack: Cline[] = []
|
|
private clineStack: Cline[] = []
|
|
|
private workspaceTracker?: WorkspaceTracker
|
|
private workspaceTracker?: WorkspaceTracker
|
|
|
protected mcpHub?: McpHub // Change from private to protected
|
|
protected mcpHub?: McpHub // Change from private to protected
|
|
|
- private latestAnnouncementId = "jan-21-2025-custom-modes" // update to some unique identifier when we add a new announcement
|
|
|
|
|
|
|
+ private latestAnnouncementId = "feb-27-2025-automatic-checkpoints" // update to some unique identifier when we add a new announcement
|
|
|
configManager: ConfigManager
|
|
configManager: ConfigManager
|
|
|
customModesManager: CustomModesManager
|
|
customModesManager: CustomModesManager
|
|
|
private lastTaskNumber = -1
|
|
private lastTaskNumber = -1
|
|
@@ -402,7 +402,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
customModePrompts,
|
|
customModePrompts,
|
|
|
diffEnabled,
|
|
diffEnabled,
|
|
|
- checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
mode,
|
|
mode,
|
|
|
customInstructions: globalInstructions,
|
|
customInstructions: globalInstructions,
|
|
@@ -417,7 +417,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
customInstructions: effectiveInstructions,
|
|
customInstructions: effectiveInstructions,
|
|
|
enableDiff: diffEnabled,
|
|
enableDiff: diffEnabled,
|
|
|
- enableCheckpoints: checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
task,
|
|
task,
|
|
|
images,
|
|
images,
|
|
@@ -433,7 +433,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
customModePrompts,
|
|
customModePrompts,
|
|
|
diffEnabled,
|
|
diffEnabled,
|
|
|
- checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
mode,
|
|
mode,
|
|
|
customInstructions: globalInstructions,
|
|
customInstructions: globalInstructions,
|
|
@@ -448,7 +448,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
apiConfiguration,
|
|
apiConfiguration,
|
|
|
customInstructions: effectiveInstructions,
|
|
customInstructions: effectiveInstructions,
|
|
|
enableDiff: diffEnabled,
|
|
enableDiff: diffEnabled,
|
|
|
- enableCheckpoints: checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
|
historyItem,
|
|
historyItem,
|
|
|
experiments,
|
|
experiments,
|
|
@@ -1110,9 +1110,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
await this.updateGlobalState("diffEnabled", diffEnabled)
|
|
await this.updateGlobalState("diffEnabled", diffEnabled)
|
|
|
await this.postStateToWebview()
|
|
await this.postStateToWebview()
|
|
|
break
|
|
break
|
|
|
- case "checkpointsEnabled":
|
|
|
|
|
- const checkpointsEnabled = message.bool ?? false
|
|
|
|
|
- await this.updateGlobalState("checkpointsEnabled", checkpointsEnabled)
|
|
|
|
|
|
|
+ case "enableCheckpoints":
|
|
|
|
|
+ const enableCheckpoints = message.bool ?? true
|
|
|
|
|
+ await this.updateGlobalState("enableCheckpoints", enableCheckpoints)
|
|
|
await this.postStateToWebview()
|
|
await this.postStateToWebview()
|
|
|
break
|
|
break
|
|
|
case "browserViewportSize":
|
|
case "browserViewportSize":
|
|
@@ -1751,7 +1751,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
lmStudioModelId,
|
|
lmStudioModelId,
|
|
|
lmStudioBaseUrl,
|
|
lmStudioBaseUrl,
|
|
|
anthropicBaseUrl,
|
|
anthropicBaseUrl,
|
|
|
- anthropicThinking,
|
|
|
|
|
geminiApiKey,
|
|
geminiApiKey,
|
|
|
openAiNativeApiKey,
|
|
openAiNativeApiKey,
|
|
|
deepSeekApiKey,
|
|
deepSeekApiKey,
|
|
@@ -1771,6 +1770,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
requestyModelId,
|
|
requestyModelId,
|
|
|
requestyModelInfo,
|
|
requestyModelInfo,
|
|
|
modelTemperature,
|
|
modelTemperature,
|
|
|
|
|
+ modelMaxTokens,
|
|
|
|
|
+ modelMaxThinkingTokens,
|
|
|
} = apiConfiguration
|
|
} = apiConfiguration
|
|
|
await Promise.all([
|
|
await Promise.all([
|
|
|
this.updateGlobalState("apiProvider", apiProvider),
|
|
this.updateGlobalState("apiProvider", apiProvider),
|
|
@@ -1799,7 +1800,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.updateGlobalState("lmStudioModelId", lmStudioModelId),
|
|
this.updateGlobalState("lmStudioModelId", lmStudioModelId),
|
|
|
this.updateGlobalState("lmStudioBaseUrl", lmStudioBaseUrl),
|
|
this.updateGlobalState("lmStudioBaseUrl", lmStudioBaseUrl),
|
|
|
this.updateGlobalState("anthropicBaseUrl", anthropicBaseUrl),
|
|
this.updateGlobalState("anthropicBaseUrl", anthropicBaseUrl),
|
|
|
- this.updateGlobalState("anthropicThinking", anthropicThinking),
|
|
|
|
|
this.storeSecret("geminiApiKey", geminiApiKey),
|
|
this.storeSecret("geminiApiKey", geminiApiKey),
|
|
|
this.storeSecret("openAiNativeApiKey", openAiNativeApiKey),
|
|
this.storeSecret("openAiNativeApiKey", openAiNativeApiKey),
|
|
|
this.storeSecret("deepSeekApiKey", deepSeekApiKey),
|
|
this.storeSecret("deepSeekApiKey", deepSeekApiKey),
|
|
@@ -1819,6 +1819,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.updateGlobalState("requestyModelId", requestyModelId),
|
|
this.updateGlobalState("requestyModelId", requestyModelId),
|
|
|
this.updateGlobalState("requestyModelInfo", requestyModelInfo),
|
|
this.updateGlobalState("requestyModelInfo", requestyModelInfo),
|
|
|
this.updateGlobalState("modelTemperature", modelTemperature),
|
|
this.updateGlobalState("modelTemperature", modelTemperature),
|
|
|
|
|
+ this.updateGlobalState("modelMaxTokens", modelMaxTokens),
|
|
|
|
|
+ this.updateGlobalState("anthropicThinking", modelMaxThinkingTokens),
|
|
|
])
|
|
])
|
|
|
if (this.getCurrentCline()) {
|
|
if (this.getCurrentCline()) {
|
|
|
this.getCurrentCline()!.api = buildApiHandler(apiConfiguration)
|
|
this.getCurrentCline()!.api = buildApiHandler(apiConfiguration)
|
|
@@ -2023,12 +2025,13 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
await this.deleteTaskFromState(id)
|
|
await this.deleteTaskFromState(id)
|
|
|
|
|
|
|
|
// check if checkpoints are enabled
|
|
// check if checkpoints are enabled
|
|
|
- const { checkpointsEnabled } = await this.getState()
|
|
|
|
|
|
|
+ const { enableCheckpoints } = await this.getState()
|
|
|
// get the base directory of the project
|
|
// get the base directory of the project
|
|
|
const baseDir = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0)
|
|
const baseDir = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0)
|
|
|
|
|
|
|
|
// delete checkpoints branch from project git repo
|
|
// delete checkpoints branch from project git repo
|
|
|
- if (checkpointsEnabled && baseDir) {
|
|
|
|
|
|
|
+ if (enableCheckpoints && baseDir) {
|
|
|
|
|
+
|
|
|
const branchSummary = await simpleGit(baseDir)
|
|
const branchSummary = await simpleGit(baseDir)
|
|
|
.branch(["-D", `roo-code-checkpoints-${id}`])
|
|
.branch(["-D", `roo-code-checkpoints-${id}`])
|
|
|
.catch(() => undefined)
|
|
.catch(() => undefined)
|
|
@@ -2077,7 +2080,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
alwaysAllowModeSwitch,
|
|
alwaysAllowModeSwitch,
|
|
|
soundEnabled,
|
|
soundEnabled,
|
|
|
diffEnabled,
|
|
diffEnabled,
|
|
|
- checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
taskHistory,
|
|
taskHistory,
|
|
|
soundVolume,
|
|
soundVolume,
|
|
|
browserViewportSize,
|
|
browserViewportSize,
|
|
@@ -2126,7 +2129,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
.sort((a: HistoryItem, b: HistoryItem) => b.ts - a.ts),
|
|
.sort((a: HistoryItem, b: HistoryItem) => b.ts - a.ts),
|
|
|
soundEnabled: soundEnabled ?? false,
|
|
soundEnabled: soundEnabled ?? false,
|
|
|
diffEnabled: diffEnabled ?? true,
|
|
diffEnabled: diffEnabled ?? true,
|
|
|
- checkpointsEnabled: checkpointsEnabled ?? false,
|
|
|
|
|
|
|
+ enableCheckpoints: enableCheckpoints ?? true,
|
|
|
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
|
|
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
|
|
|
allowedCommands,
|
|
allowedCommands,
|
|
|
soundVolume: soundVolume ?? 0.5,
|
|
soundVolume: soundVolume ?? 0.5,
|
|
@@ -2230,7 +2233,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
lmStudioModelId,
|
|
lmStudioModelId,
|
|
|
lmStudioBaseUrl,
|
|
lmStudioBaseUrl,
|
|
|
anthropicBaseUrl,
|
|
anthropicBaseUrl,
|
|
|
- anthropicThinking,
|
|
|
|
|
geminiApiKey,
|
|
geminiApiKey,
|
|
|
openAiNativeApiKey,
|
|
openAiNativeApiKey,
|
|
|
deepSeekApiKey,
|
|
deepSeekApiKey,
|
|
@@ -2254,7 +2256,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
allowedCommands,
|
|
allowedCommands,
|
|
|
soundEnabled,
|
|
soundEnabled,
|
|
|
diffEnabled,
|
|
diffEnabled,
|
|
|
- checkpointsEnabled,
|
|
|
|
|
|
|
+ enableCheckpoints,
|
|
|
soundVolume,
|
|
soundVolume,
|
|
|
browserViewportSize,
|
|
browserViewportSize,
|
|
|
fuzzyMatchThreshold,
|
|
fuzzyMatchThreshold,
|
|
@@ -2285,6 +2287,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
requestyModelId,
|
|
requestyModelId,
|
|
|
requestyModelInfo,
|
|
requestyModelInfo,
|
|
|
modelTemperature,
|
|
modelTemperature,
|
|
|
|
|
+ modelMaxTokens,
|
|
|
|
|
+ modelMaxThinkingTokens,
|
|
|
maxOpenTabsContext,
|
|
maxOpenTabsContext,
|
|
|
] = await Promise.all([
|
|
] = await Promise.all([
|
|
|
this.getGlobalState("apiProvider") as Promise<ApiProvider | undefined>,
|
|
this.getGlobalState("apiProvider") as Promise<ApiProvider | undefined>,
|
|
@@ -2313,7 +2317,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.getGlobalState("lmStudioModelId") as Promise<string | undefined>,
|
|
this.getGlobalState("lmStudioModelId") as Promise<string | undefined>,
|
|
|
this.getGlobalState("lmStudioBaseUrl") as Promise<string | undefined>,
|
|
this.getGlobalState("lmStudioBaseUrl") as Promise<string | undefined>,
|
|
|
this.getGlobalState("anthropicBaseUrl") as Promise<string | undefined>,
|
|
this.getGlobalState("anthropicBaseUrl") as Promise<string | undefined>,
|
|
|
- this.getGlobalState("anthropicThinking") as Promise<number | undefined>,
|
|
|
|
|
this.getSecret("geminiApiKey") as Promise<string | undefined>,
|
|
this.getSecret("geminiApiKey") as Promise<string | undefined>,
|
|
|
this.getSecret("openAiNativeApiKey") as Promise<string | undefined>,
|
|
this.getSecret("openAiNativeApiKey") as Promise<string | undefined>,
|
|
|
this.getSecret("deepSeekApiKey") as Promise<string | undefined>,
|
|
this.getSecret("deepSeekApiKey") as Promise<string | undefined>,
|
|
@@ -2337,7 +2340,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.getGlobalState("allowedCommands") as Promise<string[] | undefined>,
|
|
this.getGlobalState("allowedCommands") as Promise<string[] | undefined>,
|
|
|
this.getGlobalState("soundEnabled") as Promise<boolean | undefined>,
|
|
this.getGlobalState("soundEnabled") as Promise<boolean | undefined>,
|
|
|
this.getGlobalState("diffEnabled") as Promise<boolean | undefined>,
|
|
this.getGlobalState("diffEnabled") as Promise<boolean | undefined>,
|
|
|
- this.getGlobalState("checkpointsEnabled") as Promise<boolean | undefined>,
|
|
|
|
|
|
|
+ this.getGlobalState("enableCheckpoints") as Promise<boolean | undefined>,
|
|
|
this.getGlobalState("soundVolume") as Promise<number | undefined>,
|
|
this.getGlobalState("soundVolume") as Promise<number | undefined>,
|
|
|
this.getGlobalState("browserViewportSize") as Promise<string | undefined>,
|
|
this.getGlobalState("browserViewportSize") as Promise<string | undefined>,
|
|
|
this.getGlobalState("fuzzyMatchThreshold") as Promise<number | undefined>,
|
|
this.getGlobalState("fuzzyMatchThreshold") as Promise<number | undefined>,
|
|
@@ -2368,6 +2371,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
this.getGlobalState("requestyModelId") as Promise<string | undefined>,
|
|
this.getGlobalState("requestyModelId") as Promise<string | undefined>,
|
|
|
this.getGlobalState("requestyModelInfo") as Promise<ModelInfo | undefined>,
|
|
this.getGlobalState("requestyModelInfo") as Promise<ModelInfo | undefined>,
|
|
|
this.getGlobalState("modelTemperature") as Promise<number | undefined>,
|
|
this.getGlobalState("modelTemperature") as Promise<number | undefined>,
|
|
|
|
|
+ this.getGlobalState("modelMaxTokens") as Promise<number | undefined>,
|
|
|
|
|
+ this.getGlobalState("anthropicThinking") as Promise<number | undefined>,
|
|
|
this.getGlobalState("maxOpenTabsContext") as Promise<number | undefined>,
|
|
this.getGlobalState("maxOpenTabsContext") as Promise<number | undefined>,
|
|
|
])
|
|
])
|
|
|
|
|
|
|
@@ -2413,7 +2418,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
lmStudioModelId,
|
|
lmStudioModelId,
|
|
|
lmStudioBaseUrl,
|
|
lmStudioBaseUrl,
|
|
|
anthropicBaseUrl,
|
|
anthropicBaseUrl,
|
|
|
- anthropicThinking,
|
|
|
|
|
geminiApiKey,
|
|
geminiApiKey,
|
|
|
openAiNativeApiKey,
|
|
openAiNativeApiKey,
|
|
|
deepSeekApiKey,
|
|
deepSeekApiKey,
|
|
@@ -2433,6 +2437,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
requestyModelId,
|
|
requestyModelId,
|
|
|
requestyModelInfo,
|
|
requestyModelInfo,
|
|
|
modelTemperature,
|
|
modelTemperature,
|
|
|
|
|
+ modelMaxTokens,
|
|
|
|
|
+ modelMaxThinkingTokens,
|
|
|
},
|
|
},
|
|
|
lastShownAnnouncementId,
|
|
lastShownAnnouncementId,
|
|
|
customInstructions,
|
|
customInstructions,
|
|
@@ -2446,7 +2452,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|
|
allowedCommands,
|
|
allowedCommands,
|
|
|
soundEnabled: soundEnabled ?? false,
|
|
soundEnabled: soundEnabled ?? false,
|
|
|
diffEnabled: diffEnabled ?? true,
|
|
diffEnabled: diffEnabled ?? true,
|
|
|
- checkpointsEnabled: checkpointsEnabled ?? false,
|
|
|
|
|
|
|
+ enableCheckpoints: enableCheckpoints ?? true,
|
|
|
soundVolume,
|
|
soundVolume,
|
|
|
browserViewportSize: browserViewportSize ?? "900x600",
|
|
browserViewportSize: browserViewportSize ?? "900x600",
|
|
|
screenshotQuality: screenshotQuality ?? 75,
|
|
screenshotQuality: screenshotQuality ?? 75,
|