Skip to content

Commit 55466c9

Browse files
authored
Merge pull request RooCodeInc#1268 from feifei325/optimize-task-id-init
Optimize Task ID Initialization Order
2 parents 21b883b + 0a81853 commit 55466c9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/core/Cline.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export class Cline {
148148
throw new Error("Either historyItem or task/images must be provided")
149149
}
150150

151-
this.taskId = crypto.randomUUID()
151+
this.taskId = historyItem ? historyItem.id : crypto.randomUUID()
152+
152153
this.apiConfiguration = apiConfiguration
153154
this.api = buildApiHandler(apiConfiguration)
154155
this.terminalManager = new TerminalManager()
@@ -161,10 +162,6 @@ export class Cline {
161162
this.diffViewProvider = new DiffViewProvider(cwd)
162163
this.enableCheckpoints = enableCheckpoints ?? false
163164

164-
if (historyItem) {
165-
this.taskId = historyItem.id
166-
}
167-
168165
// Initialize diffStrategy based on current state
169166
this.updateDiffStrategy(Experiments.isEnabled(experiments ?? {}, EXPERIMENT_IDS.DIFF_STRATEGY))
170167

0 commit comments

Comments
 (0)