Disable checkpoints on Windows

This commit is contained in:
cte 2025-02-09 23:53:47 -08:00
parent 60ea3c25c0
commit f447356d81
3 changed files with 28 additions and 30 deletions

View file

@ -143,7 +143,7 @@ export class Cline {
this.fuzzyMatchThreshold = fuzzyMatchThreshold ?? 1.0
this.providerRef = new WeakRef(provider)
this.diffViewProvider = new DiffViewProvider(cwd)
this.checkpointsEnabled = enableCheckpoints ?? false
this.checkpointsEnabled = process.platform !== "win32" && !!enableCheckpoints
if (historyItem) {
this.taskId = historyItem.id
@ -3240,6 +3240,7 @@ export class Cline {
this.checkpointService = await CheckpointService.create({
taskId: this.taskId,
baseDir: vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? "",
log: (message) => this.providerRef.deref()?.log(message),
})
}

View file

@ -2,7 +2,6 @@ import fs from "fs/promises"
import { existsSync } from "fs"
import path from "path"
import debug from "debug"
import simpleGit, { SimpleGit, CleanOptions } from "simple-git"
export type CheckpointServiceOptions = {
@ -246,15 +245,11 @@ export class CheckpointService {
}
public static async create({ taskId, git, baseDir, log = console.log }: CheckpointServiceOptions) {
git =
git ||
simpleGit({
baseDir,
binary: "git",
maxConcurrentProcesses: 1,
config: [],
trimmed: true,
})
if (process.platform === "win32") {
throw new Error("Checkpoints are not supported on Windows.")
}
git = git || simpleGit({ baseDir })
const version = await git.version()

View file

@ -701,27 +701,29 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
</div>
)}
<div style={{ marginBottom: 15 }}>
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
<span style={{ color: "var(--vscode-errorForeground)" }}></span>
<VSCodeCheckbox
checked={checkpointsEnabled}
onChange={(e: any) => {
setCheckpointsEnabled(e.target.checked)
{process.platform !== "win32" && (
<div style={{ marginBottom: 15 }}>
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
<span style={{ color: "var(--vscode-errorForeground)" }}></span>
<VSCodeCheckbox
checked={checkpointsEnabled}
onChange={(e: any) => {
setCheckpointsEnabled(e.target.checked)
}}>
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
</VSCodeCheckbox>
</div>
<p
style={{
fontSize: "12px",
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
}}>
<span style={{ fontWeight: "500" }}>Enable experimental checkpoints</span>
</VSCodeCheckbox>
When enabled, Roo will save a checkpoint whenever a file in the workspace is
modified, added or deleted, letting you easily revert to a previous state.
</p>
</div>
<p
style={{
fontSize: "12px",
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
}}>
When enabled, Roo will save a checkpoint whenever a file in the workspace is modified,
added or deleted, letting you easily revert to a previous state.
</p>
</div>
)}
{Object.entries(experimentConfigsMap)
.filter((config) => config[0] !== "DIFF_STRATEGY")