Revert #4097 until we have a better solution (#4123)

This commit is contained in:
canvrno authored and GitHub committed 2025-06-09 16:00:08 -07:00
1 parent aaa03a37a4
commit 983d14bdcd
1 file changed
+2 -19
+2 -19
View File
@@ -166,7 +166,6 @@ export class Task {
checkpointTrackerErrorMessage?: string
conversationHistoryDeletedRange?: [number, number]
isInitialized = false
private initTaskPromise?: Promise<void>
isAwaitingPlanResponse = false
didRespondToPlanAskBySwitchingMode = false
@@ -298,9 +297,9 @@ export class Task {
// Continue with task initialization
if (historyItem) {
this.initTaskPromise = this.resumeTaskFromHistory()
this.resumeTaskFromHistory()
} else if (task || images || files) {
this.initTaskPromise = this.startTask(task, images, files)
this.startTask(task, images, files)
}
// initialize telemetry
@@ -389,10 +388,6 @@ export class Task {
}
async restoreCheckpoint(messageTs: number, restoreType: ClineCheckpointRestore, offset?: number) {
if (this.initTaskPromise && !this.isInitialized) {
await this.initTaskPromise
}
const messageIndex = this.clineMessages.findIndex((m) => m.ts === messageTs) - (offset || 0)
// Find the last message before messageIndex that has a lastCheckpointHash
const lastHashIndex = findLastIndex(this.clineMessages.slice(0, messageIndex), (m) => m.lastCheckpointHash !== undefined)
@@ -527,10 +522,6 @@ export class Task {
}
async presentMultifileDiff(messageTs: number, seeNewChangesSinceLastTaskCompletion: boolean) {
if (this.initTaskPromise && !this.isInitialized) {
await this.initTaskPromise
}
const relinquishButton = () => {
sendRelinquishControlEvent()
}
@@ -660,10 +651,6 @@ export class Task {
}
async doesLatestTaskCompletionHaveNewChanges() {
if (this.initTaskPromise && !this.isInitialized) {
await this.initTaskPromise
}
if (!this.enableCheckpoints) {
return false
}
@@ -1214,10 +1201,6 @@ export class Task {
// Checkpoints
async saveCheckpoint(isAttemptCompletionMessage: boolean = false) {
if (this.initTaskPromise && !this.isInitialized) {
await this.initTaskPromise
}
if (!this.enableCheckpoints) {
// If checkpoints are disabled, do nothing.
return