Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/core/Cline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1680,9 +1680,11 @@ export class Cline extends EventEmitter<ClineEvents> {
}

const recentlyModifiedFiles = this.fileContextTracker.getAndClearCheckpointPossibleFile()

if (recentlyModifiedFiles.length > 0) {
// TODO: we can track what file changes were made and only checkpoint those files, this will be save storage
this.checkpointSave()
// TODO: We can track what file changes were made and only
// checkpoint those files, this will be save storage.
await this.checkpointSave()
}

/*
Expand Down Expand Up @@ -2508,6 +2510,7 @@ export class Cline extends EventEmitter<ClineEvents> {
},
{ interval, timeout },
)

return service
} catch (err) {
return undefined
Expand Down Expand Up @@ -2569,7 +2572,7 @@ export class Cline extends EventEmitter<ClineEvents> {
}
}

public checkpointSave() {
public async checkpointSave() {
const service = this.getCheckpointService()

if (!service) {
Expand All @@ -2580,14 +2583,15 @@ export class Cline extends EventEmitter<ClineEvents> {
this.providerRef
.deref()
?.log("[checkpointSave] checkpoints didn't initialize in time, disabling checkpoints for this task")

this.enableCheckpoints = false
return
}

telemetryService.captureCheckpointCreated(this.taskId)

// Start the checkpoint process in the background.
service.saveCheckpoint(`Task: ${this.taskId}, Time: ${Date.now()}`).catch((err) => {
return service.saveCheckpoint(`Task: ${this.taskId}, Time: ${Date.now()}`).catch((err) => {
console.error("[Cline#checkpointSave] caught unexpected error, disabling checkpoints", err)
this.enableCheckpoints = false
})
Expand Down