Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/vs/workbench/contrib/chat/browser/chatTipService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ export interface ITipDefinition {
/** If true, exclude the tip until the async file check completes. Default: false. */
readonly excludeUntilChecked?: boolean;
};
/**
* Setting keys that, if changed from their default value, make this tip ineligible.
* The tip won't be shown if the user has already customized the setting it describes.
*/
readonly excludeWhenSettingsChanged?: string[];
/**
* Command IDs that dismiss this tip when clicked from the tip markdown
* while the tip is currently shown.
*/
readonly dismissWhenCommandsClicked?: string[];
}

/**
Expand Down Expand Up @@ -268,6 +278,18 @@ const TIP_CATALOG: ITipDefinition[] = [
ContextKeyExpr.notEquals('config.chat.tools.global.autoApprove', true),
),
enabledCommands: ['workbench.action.openSettings'],
dismissWhenCommandsClicked: ['workbench.action.openSettings'],
},
{
id: 'tip.agenticBrowser',
message: localize('tip.agenticBrowser', "Tip: Enable [agentic browser integration](command:workbench.action.openSettings?%5B%22workbench.browser.enableChatTools%22%5D) to let the agent open and interact with pages in the Integrated Browser."),
when: ContextKeyExpr.and(
ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent),
ContextKeyExpr.notEquals('config.workbench.browser.enableChatTools', true),
),
enabledCommands: ['workbench.action.openSettings'],
excludeWhenSettingsChanged: ['workbench.browser.enableChatTools'],
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The excludeWhenSettingsChanged field is defined in the tip definition but there is no implementation to actually check this field and exclude tips based on it. Currently, the code only has hardcoded checks for specific tip IDs (see lines 970-973 for tip.thinkingPhrases). You need to either:

  1. Add a generic implementation in the _isEligible method that checks the excludeWhenSettingsChanged field for all tips, OR
  2. Add a specific hardcoded check for tip.agenticBrowser similar to the existing check for tip.thinkingPhrases

Without this implementation, the test at line 983-990 in chatTipService.test.ts will fail because the tip will still be shown even after the setting has been changed.

Copilot uses AI. Check for mistakes.
Comment thread
meganrogge marked this conversation as resolved.
dismissWhenCommandsClicked: ['workbench.action.openSettings'],
},
{
id: 'tip.mermaid',
Expand All @@ -286,6 +308,8 @@ const TIP_CATALOG: ITipDefinition[] = [
message: localize('tip.thinkingPhrases', "Tip: Customize the loading messages shown while the agent works with [thinking phrases](command:workbench.action.openSettings?%5B%22chat.agent.thinking.phrases%22%5D)."),
when: ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Agent),
enabledCommands: ['workbench.action.openSettings'],
excludeWhenSettingsChanged: ['chat.agent.thinking.phrases'],
dismissWhenCommandsClicked: ['workbench.action.openSettings'],
},
];

Expand Down Expand Up @@ -1035,9 +1059,13 @@ export class ChatTipService extends Disposable implements IChatTipService {
return;
}
const enabledCommandSet = new Set(tip.enabledCommands);
const dismissCommandSet = new Set(tip.dismissWhenCommandsClicked);
this._tipCommandListener.value = this._commandService.onDidExecuteCommand(e => {
if (enabledCommandSet.has(e.commandId) && this._shownTip?.id === tip.id) {
this._logTipTelemetry(tip.id, 'commandClicked', e.commandId);
if (dismissCommandSet.has(e.commandId)) {
this.dismissTip();
}
}
});
}
Expand Down
27 changes: 27 additions & 0 deletions src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ suite('ChatTipService', () => {

for (const { tipId, settingKey } of [
{ tipId: 'tip.thinkingPhrases', settingKey: 'chat.agent.thinking.phrases' },
{ tipId: 'tip.agenticBrowser', settingKey: 'workbench.browser.enableChatTools' },
]) {
test(`shows ${tipId} with correct setting link when setting is at default`, async () => {
const service = createService();
Expand All @@ -989,6 +990,32 @@ suite('ChatTipService', () => {
});
}

for (const tipId of [
'tip.yoloMode',
'tip.thinkingStyle',
Comment thread
meganrogge marked this conversation as resolved.
Outdated
'tip.thinkingPhrases',
'tip.agenticBrowser',
]) {
test(`dismisses ${tipId} after clicking its settings link`, async () => {
const service = createService();
contextKeyService.createKey(ChatContextKeys.chatModeKind.key, ChatModeKind.Agent);
await new Promise<void>(r => queueMicrotask(r));

const tip = findTipById(service, tipId);
assert.ok(tip, `Should show ${tipId} before command click`);

let dismissed = false;
testDisposables.add(service.onDidDismissTip(() => {
dismissed = true;
}));

commandExecutedEmitter.fire({ commandId: 'workbench.action.openSettings', args: [] });

assert.strictEqual(dismissed, true, `${tipId} should dismiss when its settings command is clicked`);
assertTipNeverShown(service, tipId);
});
}

test('logs telemetry when tip is shown', () => {
const events: { eventName: string; data: Record<string, unknown> }[] = [];
instantiationService.stub(ITelemetryService, {
Expand Down
Loading