From db8faee5ffd6ffe016bca0ae439db3c862709e79 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:13:36 +0000 Subject: [PATCH] Show `/create-*` chat tip only in local sessions (#297016) --- .../contrib/chat/browser/chatTipService.ts | 5 ++++- .../chat/test/browser/chatTipService.test.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatTipService.ts b/src/vs/workbench/contrib/chat/browser/chatTipService.ts index a2a7c065c6c..d6c1702645b 100644 --- a/src/vs/workbench/contrib/chat/browser/chatTipService.ts +++ b/src/vs/workbench/contrib/chat/browser/chatTipService.ts @@ -182,7 +182,10 @@ const TIP_CATALOG: ITipDefinition[] = [ 'tip.createSlashCommands', "Tip: Use [/create-instruction](command:workbench.action.chat.generateInstruction), [/create-prompt](command:workbench.action.chat.generatePrompt), [/create-agent](command:workbench.action.chat.generateAgent), or [/create-skill](command:workbench.action.chat.generateSkill) to generate reusable agent customization files." ), - when: ChatContextKeys.hasUsedCreateSlashCommands.negate(), + when: ContextKeyExpr.and( + ChatContextKeys.chatSessionType.isEqualTo(localChatSessionType), + ChatContextKeys.hasUsedCreateSlashCommands.negate(), + ), enabledCommands: [ 'workbench.action.chat.generateInstruction', 'workbench.action.chat.generatePrompt', diff --git a/src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts b/src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts index b1c79a5e6e6..831a6292bae 100644 --- a/src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts +++ b/src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts @@ -33,6 +33,7 @@ import { OffsetRange } from '../../../../../editor/common/core/ranges/offsetRang import { Range } from '../../../../../editor/common/core/range.js'; import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; +import { localChatSessionType } from '../../common/chatSessionsService.js'; class MockContextKeyServiceWithRulesMatching extends MockContextKeyService { override contextMatchesRules(rules: ContextKeyExpression): boolean { @@ -769,6 +770,7 @@ suite('ChatTipService', () => { test('shows tip.createSlashCommands when context key is false', () => { const service = createService(); contextKeyService.createKey(ChatContextKeys.hasUsedCreateSlashCommands.key, false); + contextKeyService.createKey(ChatContextKeys.chatSessionType.key, localChatSessionType); // Dismiss tips until we find createSlashCommands or run out let found = false; @@ -787,6 +789,21 @@ suite('ChatTipService', () => { assert.ok(found, 'Should eventually show tip.createSlashCommands when context key is false'); }); + test('does not show tip.createSlashCommands in non-local chat sessions', () => { + const service = createService(); + contextKeyService.createKey(ChatContextKeys.hasUsedCreateSlashCommands.key, false); + contextKeyService.createKey(ChatContextKeys.chatSessionType.key, 'cloud'); + + for (let i = 0; i < 100; i++) { + const tip = service.getWelcomeTip(contextKeyService); + if (!tip) { + break; + } + assert.notStrictEqual(tip.id, 'tip.createSlashCommands', 'Should not show tip.createSlashCommands in non-local sessions'); + service.dismissTip(); + } + }); + test('does not show tip.createSlashCommands when context key is true', () => { storageService.store('chat.tips.usedCreateSlashCommands', true, StorageScope.APPLICATION, StorageTarget.MACHINE); const service = createService();