Skip to content

Commit 7b87b70

Browse files
authored
Enable chat "move" commands on empty sessions (microsoft#183895)
* Enable chat "move" commands on empty sessions and also imported sessions * Fix command name
1 parent f6758df commit 7b87b70

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatImportExport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function registerChatExportActions() {
7373
id: 'workbench.action.chat.import',
7474
title: {
7575
value: localize('chat.import.label', "Import Session") + '...',
76-
original: 'Export Session...'
76+
original: 'Import Session...'
7777
},
7878
category: CHAT_CATEGORY,
7979
precondition: CONTEXT_PROVIDER_EXISTS,

src/vs/workbench/contrib/chat/common/chatServiceImpl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ export class ChatService extends Disposable implements IChatService {
218218
}
219219

220220
getHistory(): IChatDetail[] {
221-
const sessions = Object.values(this._persistedSessions);
221+
const sessions = Object.values(this._persistedSessions)
222+
.filter(session => session.requests.length > 0);
222223
sessions.sort((a, b) => (b.creationDate ?? 0) - (a.creationDate ?? 0));
223224

224225
return sessions
225226
.filter(session => !this._sessionModels.has(session.sessionId))
227+
.filter(session => !session.isImported)
226228
.map(item => {
227229
return <IChatDetail>{
228230
sessionId: item.sessionId,
@@ -547,9 +549,7 @@ export class ChatService extends Disposable implements IChatService {
547549
throw new Error(`Unknown session: ${sessionId}`);
548550
}
549551

550-
if (model.getRequests().length && !model.isImported) {
551-
this._persistedSessions[sessionId] = model.toJSON();
552-
}
552+
this._persistedSessions[sessionId] = model.toJSON();
553553

554554
model.dispose();
555555
this._sessionModels.delete(sessionId);

0 commit comments

Comments
 (0)