diff --git a/src/core/controller/file/openTaskHistory.ts b/src/core/controller/file/openTaskHistory.ts index 0335f9aa..df1c2ae4 100644 --- a/src/core/controller/file/openTaskHistory.ts +++ b/src/core/controller/file/openTaskHistory.ts @@ -1,6 +1,7 @@ import { openFile as openFileIntegration } from "@integrations/misc/open-file" import { Empty, StringRequest } from "@shared/proto/cline/common" import path from "path" +import { HostProvider } from "@/hosts/host-provider" import { Controller } from ".." /** * Opens a file in the editor @@ -8,8 +9,8 @@ import { Controller } from ".." * @param request The request message containing the file path in the 'value' field * @returns Empty response */ -export async function openTaskHistory(controller: Controller, request: StringRequest): Promise { - const globalStoragePath = controller.context.globalStorageUri.fsPath +export async function openTaskHistory(_controller: Controller, request: StringRequest): Promise { + const globalStoragePath = HostProvider.get().globalStorageFsPath const taskHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json") if (request.value) { openFileIntegration(taskHistoryPath) diff --git a/src/core/controller/index.ts b/src/core/controller/index.ts index e7bbad47..9cd915c6 100644 --- a/src/core/controller/index.ts +++ b/src/core/controller/index.ts @@ -593,7 +593,7 @@ export class Controller { const history = this.stateManager.getGlobalStateKey("taskHistory") const historyItem = history.find((item) => item.id === id) if (historyItem) { - const taskDirPath = path.join(this.context.globalStorageUri.fsPath, "tasks", id) + const taskDirPath = path.join(HostProvider.get().globalStorageFsPath, "tasks", id) const apiConversationHistoryFilePath = path.join(taskDirPath, GlobalFileNames.apiConversationHistory) const uiMessagesFilePath = path.join(taskDirPath, GlobalFileNames.uiMessages) const contextHistoryFilePath = path.join(taskDirPath, GlobalFileNames.contextHistory) diff --git a/src/core/controller/task/deleteAllTaskHistory.ts b/src/core/controller/task/deleteAllTaskHistory.ts index 1b891c04..e54ad708 100644 --- a/src/core/controller/task/deleteAllTaskHistory.ts +++ b/src/core/controller/task/deleteAllTaskHistory.ts @@ -51,7 +51,7 @@ export async function deleteAllTaskHistory(controller: Controller): Promise task.id) - await cleanupTaskFiles(controller, preserveTaskIds) + await cleanupTaskFiles(preserveTaskIds) // Update webview try { @@ -91,13 +91,13 @@ export async function deleteAllTaskHistory(controller: Controller): Promise