File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ export class Cline extends EventEmitter<ClineEvents> {
133133 readonly rootTask : Cline | undefined = undefined
134134 readonly parentTask : Cline | undefined = undefined
135135 readonly taskNumber : number
136+ readonly workspacePath : string
136137
137138 isPaused : boolean = false
138139 pausedModeSlug : string = defaultModeSlug
@@ -221,6 +222,10 @@ export class Cline extends EventEmitter<ClineEvents> {
221222 }
222223
223224 this . taskId = historyItem ? historyItem . id : crypto . randomUUID ( )
225+ // normal use-case is usually retry similar history task with new workspace
226+ this . workspacePath = parentTask
227+ ? parentTask . workspacePath
228+ : getWorkspacePath ( path . join ( os . homedir ( ) , "Desktop" ) )
224229 this . instanceId = crypto . randomUUID ( ) . slice ( 0 , 8 )
225230 this . taskNumber = - 1
226231
@@ -288,7 +293,7 @@ export class Cline extends EventEmitter<ClineEvents> {
288293 }
289294
290295 get cwd ( ) {
291- return getWorkspacePath ( path . join ( os . homedir ( ) , "Desktop" ) )
296+ return this . workspacePath
292297 }
293298
294299 // Storing task to disk for history
You can’t perform that action at this time.
0 commit comments