Skip to content

Commit 2e9c808

Browse files
authored
Merge pull request #1232 from RooVetGit/enable_checkpoints
Graduate checkpoints out of beta
2 parents 0c44241 + 10c6f8f commit 2e9c808

File tree

10 files changed

+80
-79
lines changed

10 files changed

+80
-79
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Graduate checkpoints out of beta

src/core/Cline.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class Cline {
115115
isInitialized = false
116116

117117
// checkpoints
118-
checkpointsEnabled: boolean = false
118+
enableCheckpoints: boolean = false
119119
private checkpointService?: CheckpointService
120120

121121
// streaming
@@ -159,7 +159,7 @@ export class Cline {
159159
this.fuzzyMatchThreshold = fuzzyMatchThreshold ?? 1.0
160160
this.providerRef = new WeakRef(provider)
161161
this.diffViewProvider = new DiffViewProvider(cwd)
162-
this.checkpointsEnabled = enableCheckpoints ?? false
162+
this.enableCheckpoints = enableCheckpoints ?? false
163163

164164
if (historyItem) {
165165
this.taskId = historyItem.id
@@ -3337,7 +3337,7 @@ export class Cline {
33373337
// Checkpoints
33383338

33393339
private async getCheckpointService() {
3340-
if (!this.checkpointsEnabled) {
3340+
if (!this.enableCheckpoints) {
33413341
throw new Error("Checkpoints are disabled")
33423342
}
33433343

@@ -3378,7 +3378,7 @@ export class Cline {
33783378
commitHash: string
33793379
mode: "full" | "checkpoint"
33803380
}) {
3381-
if (!this.checkpointsEnabled) {
3381+
if (!this.enableCheckpoints) {
33823382
return
33833383
}
33843384

@@ -3417,12 +3417,12 @@ export class Cline {
34173417
)
34183418
} catch (err) {
34193419
this.providerRef.deref()?.log("[checkpointDiff] disabling checkpoints for this task")
3420-
this.checkpointsEnabled = false
3420+
this.enableCheckpoints = false
34213421
}
34223422
}
34233423

34243424
public async checkpointSave({ isFirst }: { isFirst: boolean }) {
3425-
if (!this.checkpointsEnabled) {
3425+
if (!this.enableCheckpoints) {
34263426
return
34273427
}
34283428

@@ -3443,7 +3443,7 @@ export class Cline {
34433443
}
34443444
} catch (err) {
34453445
this.providerRef.deref()?.log("[checkpointSave] disabling checkpoints for this task")
3446-
this.checkpointsEnabled = false
3446+
this.enableCheckpoints = false
34473447
}
34483448
}
34493449

@@ -3456,7 +3456,7 @@ export class Cline {
34563456
commitHash: string
34573457
mode: "preview" | "restore"
34583458
}) {
3459-
if (!this.checkpointsEnabled) {
3459+
if (!this.enableCheckpoints) {
34603460
return
34613461
}
34623462

@@ -3511,7 +3511,7 @@ export class Cline {
35113511
this.providerRef.deref()?.cancelTask()
35123512
} catch (err) {
35133513
this.providerRef.deref()?.log("[checkpointRestore] disabling checkpoints for this task")
3514-
this.checkpointsEnabled = false
3514+
this.enableCheckpoints = false
35153515
}
35163516
}
35173517
}

src/core/webview/ClineProvider.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
6464
private cline?: Cline
6565
private workspaceTracker?: WorkspaceTracker
6666
protected mcpHub?: McpHub // Change from private to protected
67-
private latestAnnouncementId = "jan-21-2025-custom-modes" // update to some unique identifier when we add a new announcement
67+
private latestAnnouncementId = "feb-27-2025-automatic-checkpoints" // update to some unique identifier when we add a new announcement
6868
configManager: ConfigManager
6969
customModesManager: CustomModesManager
7070

@@ -317,7 +317,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
317317
apiConfiguration,
318318
customModePrompts,
319319
diffEnabled,
320-
checkpointsEnabled,
320+
enableCheckpoints,
321321
fuzzyMatchThreshold,
322322
mode,
323323
customInstructions: globalInstructions,
@@ -332,7 +332,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
332332
apiConfiguration,
333333
customInstructions: effectiveInstructions,
334334
enableDiff: diffEnabled,
335-
enableCheckpoints: checkpointsEnabled,
335+
enableCheckpoints,
336336
fuzzyMatchThreshold,
337337
task,
338338
images,
@@ -347,7 +347,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
347347
apiConfiguration,
348348
customModePrompts,
349349
diffEnabled,
350-
checkpointsEnabled,
350+
enableCheckpoints,
351351
fuzzyMatchThreshold,
352352
mode,
353353
customInstructions: globalInstructions,
@@ -362,7 +362,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
362362
apiConfiguration,
363363
customInstructions: effectiveInstructions,
364364
enableDiff: diffEnabled,
365-
enableCheckpoints: checkpointsEnabled,
365+
enableCheckpoints,
366366
fuzzyMatchThreshold,
367367
historyItem,
368368
experiments,
@@ -1017,9 +1017,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
10171017
await this.updateGlobalState("diffEnabled", diffEnabled)
10181018
await this.postStateToWebview()
10191019
break
1020-
case "checkpointsEnabled":
1021-
const checkpointsEnabled = message.bool ?? false
1022-
await this.updateGlobalState("checkpointsEnabled", checkpointsEnabled)
1020+
case "enableCheckpoints":
1021+
const enableCheckpoints = message.bool ?? true
1022+
await this.updateGlobalState("enableCheckpoints", enableCheckpoints)
10231023
await this.postStateToWebview()
10241024
break
10251025
case "browserViewportSize":
@@ -1939,11 +1939,11 @@ export class ClineProvider implements vscode.WebviewViewProvider {
19391939
await fs.unlink(legacyMessagesFilePath)
19401940
}
19411941

1942-
const { checkpointsEnabled } = await this.getState()
1942+
const { enableCheckpoints } = await this.getState()
19431943
const baseDir = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0)
19441944

19451945
// Delete checkpoints branch.
1946-
if (checkpointsEnabled && baseDir) {
1946+
if (enableCheckpoints && baseDir) {
19471947
const branchSummary = await simpleGit(baseDir)
19481948
.branch(["-D", `roo-code-checkpoints-${id}`])
19491949
.catch(() => undefined)
@@ -1999,7 +1999,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
19991999
alwaysAllowModeSwitch,
20002000
soundEnabled,
20012001
diffEnabled,
2002-
checkpointsEnabled,
2002+
enableCheckpoints,
20032003
taskHistory,
20042004
soundVolume,
20052005
browserViewportSize,
@@ -2048,7 +2048,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
20482048
.sort((a: HistoryItem, b: HistoryItem) => b.ts - a.ts),
20492049
soundEnabled: soundEnabled ?? false,
20502050
diffEnabled: diffEnabled ?? true,
2051-
checkpointsEnabled: checkpointsEnabled ?? false,
2051+
enableCheckpoints: enableCheckpoints ?? true,
20522052
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
20532053
allowedCommands,
20542054
soundVolume: soundVolume ?? 0.5,
@@ -2181,7 +2181,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21812181
allowedCommands,
21822182
soundEnabled,
21832183
diffEnabled,
2184-
checkpointsEnabled,
2184+
enableCheckpoints,
21852185
soundVolume,
21862186
browserViewportSize,
21872187
fuzzyMatchThreshold,
@@ -2265,7 +2265,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
22652265
this.getGlobalState("allowedCommands") as Promise<string[] | undefined>,
22662266
this.getGlobalState("soundEnabled") as Promise<boolean | undefined>,
22672267
this.getGlobalState("diffEnabled") as Promise<boolean | undefined>,
2268-
this.getGlobalState("checkpointsEnabled") as Promise<boolean | undefined>,
2268+
this.getGlobalState("enableCheckpoints") as Promise<boolean | undefined>,
22692269
this.getGlobalState("soundVolume") as Promise<number | undefined>,
22702270
this.getGlobalState("browserViewportSize") as Promise<string | undefined>,
22712271
this.getGlobalState("fuzzyMatchThreshold") as Promise<number | undefined>,
@@ -2376,7 +2376,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
23762376
allowedCommands,
23772377
soundEnabled: soundEnabled ?? false,
23782378
diffEnabled: diffEnabled ?? true,
2379-
checkpointsEnabled: checkpointsEnabled ?? false,
2379+
enableCheckpoints: enableCheckpoints ?? true,
23802380
soundVolume,
23812381
browserViewportSize: browserViewportSize ?? "900x600",
23822382
screenshotQuality: screenshotQuality ?? 75,

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ describe("ClineProvider", () => {
369369
uriScheme: "vscode",
370370
soundEnabled: false,
371371
diffEnabled: false,
372-
checkpointsEnabled: false,
372+
enableCheckpoints: false,
373373
writeDelayMs: 1000,
374374
browserViewportSize: "900x600",
375375
fuzzyMatchThreshold: 1.0,
@@ -677,7 +677,7 @@ describe("ClineProvider", () => {
677677
},
678678
mode: "code",
679679
diffEnabled: true,
680-
checkpointsEnabled: false,
680+
enableCheckpoints: false,
681681
fuzzyMatchThreshold: 1.0,
682682
experiments: experimentDefault,
683683
} as any)

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface ExtensionState {
111111
soundEnabled?: boolean
112112
soundVolume?: number
113113
diffEnabled?: boolean
114-
checkpointsEnabled: boolean
114+
enableCheckpoints: boolean
115115
browserViewportSize?: string
116116
screenshotQuality?: number
117117
fuzzyMatchThreshold?: number

src/shared/WebviewMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface WebviewMessage {
5252
| "soundEnabled"
5353
| "soundVolume"
5454
| "diffEnabled"
55-
| "checkpointsEnabled"
55+
| "enableCheckpoints"
5656
| "browserViewportSize"
5757
| "screenshotQuality"
5858
| "openMcpSettings"

src/shared/globalState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type GlobalStateKey =
5353
| "soundEnabled"
5454
| "soundVolume"
5555
| "diffEnabled"
56-
| "checkpointsEnabled"
56+
| "enableCheckpoints"
5757
| "browserViewportSize"
5858
| "screenshotQuality"
5959
| "fuzzyMatchThreshold"

webview-ui/src/components/chat/Announcement.tsx

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
22
import { memo } from "react"
3-
// import VSCodeButtonLink from "./VSCodeButtonLink"
4-
// import { getOpenRouterAuthUrl } from "./ApiOptions"
5-
// import { vscode } from "../utils/vscode"
63

74
interface AnnouncementProps {
85
version: string
@@ -29,36 +26,38 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
2926
style={{ position: "absolute", top: "8px", right: "8px" }}>
3027
<span className="codicon codicon-close"></span>
3128
</VSCodeButton>
32-
<h2 style={{ margin: "0 0 8px" }}>🎉{" "}Introducing Roo Code 3.2</h2>
29+
<h2 style={{ margin: "0 0 8px" }}>🎉{" "}Automatic Checkpoints Now Enabled</h2>
3330

3431
<p style={{ margin: "5px 0px" }}>
35-
Our biggest update yet is here - we're officially changing our name from Roo Cline to Roo Code! After
36-
growing beyond 50,000 installations, we're ready to chart our own course. Our heartfelt thanks to
37-
everyone in the Cline community who helped us reach this milestone.
32+
We're thrilled to announce that our experimental Checkpoints feature is now enabled by default for all
33+
users. This powerful feature automatically tracks your project changes during a task, allowing you to
34+
quickly review or revert to earlier states if needed.
3835
</p>
3936

40-
<h3 style={{ margin: "12px 0 8px" }}>Custom Modes: Celebrating Our New Identity</h3>
37+
<h3 style={{ margin: "12px 0 8px" }}>What's New</h3>
4138
<p style={{ margin: "5px 0px" }}>
42-
To mark this new chapter, we're introducing the power to shape Roo Code into any role you need! Create
43-
specialized personas and create an entire team of agents with deeply customized prompts:
39+
Automatic Checkpoints provide you with:
4440
<ul style={{ margin: "4px 0 6px 20px", padding: 0 }}>
45-
<li>QA Engineers who write thorough test cases and catch edge cases</li>
46-
<li>Product Managers who excel at user stories and feature prioritization</li>
47-
<li>UI/UX Designers who craft beautiful, accessible interfaces</li>
48-
<li>Code Reviewers who ensure quality and maintainability</li>
41+
<li>Peace of mind when making significant changes</li>
42+
<li>Ability to visually inspect changes between steps</li>
43+
<li>Easy rollback if you're not satisfied with certain code modifications</li>
44+
<li>Improved navigation through complex task execution</li>
4945
</ul>
50-
Just click the <span className="codicon codicon-notebook" style={{ fontSize: "10px" }}></span> icon to
51-
get started with Custom Modes!
5246
</p>
5347

54-
<h3 style={{ margin: "12px 0 8px" }}>Join Us for the Next Chapter</h3>
48+
<h3 style={{ margin: "12px 0 8px" }}>Customize Your Experience</h3>
5549
<p style={{ margin: "5px 0px" }}>
56-
We can't wait to see how you'll push Roo Code's potential even further! Share your custom modes and join
57-
the discussion at{" "}
58-
<VSCodeLink href="https://www.reddit.com/r/RooCode" style={{ display: "inline" }}>
59-
reddit.com/r/RooCode
60-
</VSCodeLink>
61-
.
50+
While we recommend keeping this feature enabled, you can disable it if needed.{" "}
51+
<VSCodeLink
52+
href="#"
53+
onClick={(e) => {
54+
e.preventDefault()
55+
window.postMessage({ type: "action", action: "settingsButtonClicked" }, "*")
56+
}}
57+
style={{ display: "inline", padding: "0 2px" }}>
58+
Open Settings
59+
</VSCodeLink>{" "}
60+
and look for the "Enable automatic checkpoints" option in the Advanced Settings section.
6261
</p>
6362
</div>
6463
)

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
5252
alwaysAllowWrite,
5353
alwaysApproveResubmit,
5454
browserViewportSize,
55-
checkpointsEnabled,
55+
enableCheckpoints,
5656
diffEnabled,
5757
experiments,
5858
fuzzyMatchThreshold,
@@ -143,7 +143,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
143143
vscode.postMessage({ type: "soundEnabled", bool: soundEnabled })
144144
vscode.postMessage({ type: "soundVolume", value: soundVolume })
145145
vscode.postMessage({ type: "diffEnabled", bool: diffEnabled })
146-
vscode.postMessage({ type: "checkpointsEnabled", bool: checkpointsEnabled })
146+
vscode.postMessage({ type: "enableCheckpoints", bool: enableCheckpoints })
147147
vscode.postMessage({ type: "browserViewportSize", text: browserViewportSize })
148148
vscode.postMessage({ type: "fuzzyMatchThreshold", value: fuzzyMatchThreshold ?? 1.0 })
149149
vscode.postMessage({ type: "writeDelayMs", value: writeDelayMs })
@@ -706,6 +706,25 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
706706
</p>
707707
</div>
708708

709+
<div style={{ marginBottom: 15 }}>
710+
<VSCodeCheckbox
711+
checked={enableCheckpoints}
712+
onChange={(e: any) => {
713+
setCachedStateField("enableCheckpoints", e.target.checked)
714+
}}>
715+
<span style={{ fontWeight: "500" }}>Enable automatic checkpoints</span>
716+
</VSCodeCheckbox>
717+
<p
718+
style={{
719+
fontSize: "12px",
720+
marginTop: "5px",
721+
color: "var(--vscode-descriptionForeground)",
722+
}}>
723+
When enabled, Roo will automatically create checkpoints during task execution, making it
724+
easy to review changes or revert to earlier states.
725+
</p>
726+
</div>
727+
709728
<div style={{ marginBottom: 15 }}>
710729
<VSCodeCheckbox
711730
checked={diffEnabled}
@@ -779,28 +798,6 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone },
779798
</div>
780799
)}
781800

782-
<div style={{ marginBottom: 15 }}>
783-
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
784-
<span style={{ color: "var(--vscode-errorForeground)" }}>⚠️</span>
785-
<VSCodeCheckbox
786-
checked={checkpointsEnabled}
787-
onChange={(e: any) => {
788-
setCachedStateField("checkpointsEnabled", e.target.checked)
789-
}}>
790-
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
791-
</VSCodeCheckbox>
792-
</div>
793-
<p
794-
style={{
795-
fontSize: "12px",
796-
marginTop: "5px",
797-
color: "var(--vscode-descriptionForeground)",
798-
}}>
799-
When enabled, Roo will save a checkpoint whenever a file in the workspace is modified,
800-
added or deleted, letting you easily revert to a previous state.
801-
</p>
802-
</div>
803-
804801
{Object.entries(experimentConfigsMap)
805802
.filter((config) => config[0] !== "DIFF_STRATEGY")
806803
.map((config) => (

0 commit comments

Comments
 (0)