diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index f8c89d53aa..4857d4f99d 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -917,7 +917,12 @@ export class ClineProvider // The task will continue with the current/default configuration. } } catch (error) { - // The task will continue with the current/default configuration. + // Log the error but continue with task restoration. + this.log( + `Failed to restore API configuration for mode '${historyItem.mode}': ${ + error instanceof Error ? error.message : String(error) + }. Continuing with default configuration.`, + ) } } } diff --git a/src/core/webview/__tests__/ClineProvider.spec.ts b/src/core/webview/__tests__/ClineProvider.spec.ts index 18cabb4fb7..882cb7f3c1 100644 --- a/src/core/webview/__tests__/ClineProvider.spec.ts +++ b/src/core/webview/__tests__/ClineProvider.spec.ts @@ -889,6 +889,7 @@ describe("ClineProvider", () => { listConfig: vi.fn().mockResolvedValue([profile]), activateProfile: vi.fn().mockResolvedValue(profile), setModeConfig: vi.fn(), + getProfile: vi.fn().mockResolvedValue(profile), } as any // Switch to architect mode @@ -1610,6 +1611,7 @@ describe("ClineProvider", () => { listConfig: vi.fn().mockResolvedValue([profile]), activateProfile: vi.fn().mockResolvedValue(profile), setModeConfig: vi.fn(), + getProfile: vi.fn().mockResolvedValue(profile), } as any // Switch to architect mode