From bf648856baf5e2da333aad953245725a1d14e633 Mon Sep 17 00:00:00 2001 From: Sam Hoang Van Date: Sat, 5 Apr 2025 19:23:10 +0700 Subject: [PATCH] feat: add workspace tracking to history items (#2054) Track the current workspace path in history items to enable filtering and organization of history by workspace. This change adds the workspace property to the history schema and ensures it's saved with each history entry. --- src/core/Cline.ts | 1 + src/exports/roo-code.d.ts | 1 + src/exports/types.ts | 1 + src/schemas/index.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index b8f7f9ae9e..7f5ef949da 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -397,6 +397,7 @@ export class Cline extends EventEmitter { cacheReads: apiMetrics.totalCacheReads, totalCost: apiMetrics.totalCost, size: taskDirSize, + workspace: this.cwd, }) } catch (error) { console.error("Failed to save cline messages:", error) diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index fbd18ab6b3..7b6f19a31d 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -228,6 +228,7 @@ type GlobalSettings = { cacheReads?: number | undefined totalCost: number size?: number | undefined + workspace?: string | undefined }[] | undefined autoApprovalEnabled?: boolean | undefined diff --git a/src/exports/types.ts b/src/exports/types.ts index 3a7a96998a..1cd4df7e57 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -231,6 +231,7 @@ type GlobalSettings = { cacheReads?: number | undefined totalCost: number size?: number | undefined + workspace?: string | undefined }[] | undefined autoApprovalEnabled?: boolean | undefined diff --git a/src/schemas/index.ts b/src/schemas/index.ts index a5c060e2d6..bd45b99667 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -146,6 +146,7 @@ export const historyItemSchema = z.object({ cacheReads: z.number().optional(), totalCost: z.number(), size: z.number().optional(), + workspace: z.string().optional(), }) export type HistoryItem = z.infer