From 4cd5e20c79a963ce01167c229cb4dc0cce1f2da2 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 16 Sep 2025 23:29:43 +0000 Subject: [PATCH] fix: restore tab-specific mode when loading task from history - Set tabSpecificMode when restoring task with saved mode - Set tabSpecificApiConfigName when restoring associated API config - Ensures tabs maintain independent state even when loading from history --- src/core/webview/ClineProvider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 9d38d8d290..1f77f8759b 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -836,6 +836,10 @@ export class ClineProvider historyItem.mode = defaultModeSlug } + // Update tab-specific mode + this.tabSpecificMode = historyItem.mode + + // Also update global state for backward compatibility await this.updateGlobalState("mode", historyItem.mode) // Load the saved API config for the restored mode if it exists. @@ -851,6 +855,8 @@ export class ClineProvider if (profile?.name) { try { + // Update tab-specific API config name + this.tabSpecificApiConfigName = profile.name await this.activateProviderProfile({ name: profile.name }) } catch (error) { // Log the error but continue with task restoration.