diff --git a/src/vs/workbench/contrib/chat/common/chatModel.ts b/src/vs/workbench/contrib/chat/common/chatModel.ts index 2aee47bf2a31c..ecfb7415dee42 100644 --- a/src/vs/workbench/contrib/chat/common/chatModel.ts +++ b/src/vs/workbench/contrib/chat/common/chatModel.ts @@ -1715,7 +1715,7 @@ export class ChatModel extends Disposable implements IChatModel { // Retain a reference to itself when a request is in progress, so the ChatModel stays alive in the background // only while running a request. TODO also keep it alive for 5min or so so we don't have to dispose/restore too often? - if (this.initialLocation === ChatAgentLocation.Chat && configurationService.getValue('chat.localBackgroundSessions') && !initialModelProps.disableBackgroundKeepAlive) { + if (this.initialLocation === ChatAgentLocation.Chat && !initialModelProps.disableBackgroundKeepAlive) { const selfRef = this._register(new MutableDisposable()); this._register(autorun(r => { const inProgress = this.requestInProgress.read(r); diff --git a/src/vs/workbench/contrib/chat/test/common/chatModel.test.ts b/src/vs/workbench/contrib/chat/test/common/chatModel.test.ts index 03e0ec08b697c..fd0ce567622f4 100644 --- a/src/vs/workbench/contrib/chat/test/common/chatModel.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/chatModel.test.ts @@ -24,8 +24,9 @@ import { TestExtensionService, TestStorageService } from '../../../../test/commo import { ChatAgentService, IChatAgentService } from '../../common/chatAgents.js'; import { ChatModel, ISerializableChatData1, ISerializableChatData2, ISerializableChatData3, normalizeSerializableChatData, Response } from '../../common/chatModel.js'; import { ChatRequestTextPart } from '../../common/chatParserTypes.js'; -import { IChatToolInvocation } from '../../common/chatService.js'; +import { IChatService, IChatToolInvocation } from '../../common/chatService.js'; import { ChatAgentLocation } from '../../common/constants.js'; +import { MockChatService } from './mockChatService.js'; suite('ChatModel', () => { const testDisposables = ensureNoDisposablesAreLeakedInTestSuite(); @@ -40,6 +41,7 @@ suite('ChatModel', () => { instantiationService.stub(IContextKeyService, new MockContextKeyService()); instantiationService.stub(IChatAgentService, testDisposables.add(instantiationService.createInstance(ChatAgentService))); instantiationService.stub(IConfigurationService, new TestConfigurationService()); + instantiationService.stub(IChatService, new MockChatService()); }); test('removeRequest', async () => { @@ -267,6 +269,7 @@ suite('ChatResponseModel', () => { instantiationService.stub(IContextKeyService, new MockContextKeyService()); instantiationService.stub(IChatAgentService, testDisposables.add(instantiationService.createInstance(ChatAgentService))); instantiationService.stub(IConfigurationService, new TestConfigurationService()); + instantiationService.stub(IChatService, new MockChatService()); }); test('timestamp and confirmationAdjustedTimestamp', async () => {