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
This commit is contained in:
Max Paulus 🥪
2026-04-27 12:13:21 -07:00
parent ef24078c32
commit 220600785a
2 changed files with 10 additions and 7 deletions
@@ -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<Empty> {
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()
}
+5 -2
View File
@@ -617,8 +617,11 @@ export class Controller {
return this.taskHistory.getTaskWithId(id)
}
async exportTaskWithId(_id: string): Promise<void> {
stubWarn("exportTaskWithId")
async exportTaskWithId(id: string): Promise<void> {
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<HistoryItem[]> {