From 220600785a33c84ceb509e91e6349548605d9a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Paulus=20=F0=9F=A5=AA?= Date: Mon, 27 Apr 2026 11:50:15 -0700 Subject: [PATCH] fix: implement exportTaskWithId and fix openDiskConversationHistory - Replace exportTaskWithId stub in SdkController with real implementation that opens the task directory in the file manager (matching classic behavior) - Fix openDiskConversationHistory to await openFileIntegration and move path construction inside the null check Closes ENG-1828 --- .../controller/file/openDiskConversationHistory.ts | 10 +++++----- src/sdk/SdkController.ts | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/controller/file/openDiskConversationHistory.ts b/src/core/controller/file/openDiskConversationHistory.ts index 157a090958..8db4231e70 100644 --- a/src/core/controller/file/openDiskConversationHistory.ts +++ b/src/core/controller/file/openDiskConversationHistory.ts @@ -4,16 +4,16 @@ import path from "path" import { HostProvider } from "@/hosts/host-provider" import { Controller } from ".." /** - * Opens a file in the editor + * Opens the api_conversation_history.json file for a task in the editor * @param controller The controller instance - * @param request The request message containing the file path in the 'value' field + * @param request The request message containing the task ID in the 'value' field * @returns Empty response */ export async function openDiskConversationHistory(_controller: Controller, request: StringRequest): Promise { - const globalStoragePath = HostProvider.get().globalStorageFsPath - const taskConversationHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json") if (request.value) { - openFileIntegration(taskConversationHistoryPath) + const globalStoragePath = HostProvider.get().globalStorageFsPath + const taskConversationHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json") + await openFileIntegration(taskConversationHistoryPath) } return Empty.create() } diff --git a/src/sdk/SdkController.ts b/src/sdk/SdkController.ts index b3a89fa22e..09762b7fa5 100644 --- a/src/sdk/SdkController.ts +++ b/src/sdk/SdkController.ts @@ -617,8 +617,11 @@ export class Controller { return this.taskHistory.getTaskWithId(id) } - async exportTaskWithId(_id: string): Promise { - stubWarn("exportTaskWithId") + async exportTaskWithId(id: string): Promise { + const taskDirPath = path.join(HostProvider.get().globalStorageFsPath, "tasks", id) + Logger.log(`[EXPORT] Opening task directory: ${taskDirPath}`) + const open = (await import("open")).default + await open(taskDirPath) } async deleteTaskFromState(id: string): Promise {