Skip to content
Merged
Changes from all 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
7 changes: 6 additions & 1 deletion src/core/Cline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class Cline extends EventEmitter<ClineEvents> {
readonly rootTask: Cline | undefined = undefined
readonly parentTask: Cline | undefined = undefined
readonly taskNumber: number
readonly workspacePath: string

isPaused: boolean = false
pausedModeSlug: string = defaultModeSlug
Expand Down Expand Up @@ -221,6 +222,10 @@ export class Cline extends EventEmitter<ClineEvents> {
}

this.taskId = historyItem ? historyItem.id : crypto.randomUUID()
// normal use-case is usually retry similar history task with new workspace
this.workspacePath = parentTask
? parentTask.workspacePath
: getWorkspacePath(path.join(os.homedir(), "Desktop"))
this.instanceId = crypto.randomUUID().slice(0, 8)
this.taskNumber = -1

Expand Down Expand Up @@ -288,7 +293,7 @@ export class Cline extends EventEmitter<ClineEvents> {
}

get cwd() {
return getWorkspacePath(path.join(os.homedir(), "Desktop"))
return this.workspacePath
}

// Storing task to disk for history
Expand Down