Add disable checkpoints setting (#1450)

* disable checkpoints

* reverse setting boolean
This commit is contained in:
Evan Fannin 2025-01-26 08:40:19 +08:00 committed by GitHub
parent a0e7bf60c2
commit 4f0e3a6f87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -156,6 +156,11 @@
],
"default": "enabled",
"description": "Control MCP server functionality and its inclusion in AI prompts. When disabled, Cline will not be aware of MCP capabilities, saving model context window tokens."
},
"cline.enableCheckpoints": {
"type": "boolean",
"default": true,
"description": "Enable checkpoint creation during task execution"
}
}
}

View file

@ -21,12 +21,18 @@ class CheckpointTracker {
this.cwd = cwd
}
public static async create(taskId: string, provider?: ClineProvider): Promise<CheckpointTracker> {
public static async create(taskId: string, provider?: ClineProvider): Promise<CheckpointTracker | undefined> {
try {
if (!provider) {
throw new Error("Provider is required to create a checkpoint tracker")
}
// Check if checkpoints are disabled in VS Code settings
const enableCheckpoints = vscode.workspace.getConfiguration("cline").get<boolean>("enableCheckpoints") ?? true
if (!enableCheckpoints) {
return undefined // Don't create tracker when disabled
}
// Check if git is installed by attempting to get version
try {
await simpleGit().version()