Skip to content

Commit eca9bc2

Browse files
authored
tools: link the threshold setting in the validation message (microsoft#258861)
Closes microsoft#258464
1 parent c0d3b65 commit eca9bc2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ThemeIcon } from '../../../../../base/common/themables.js';
1111
import { assertType } from '../../../../../base/common/types.js';
1212
import { generateUuid } from '../../../../../base/common/uuid.js';
1313
import { localize } from '../../../../../nls.js';
14-
import { ICommandService } from '../../../../../platform/commands/common/commands.js';
14+
import { CommandsRegistry, ICommandService } from '../../../../../platform/commands/common/commands.js';
1515
import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js';
1616
import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js';
1717
import { IQuickInputButton, IQuickInputService, IQuickPickItem, IQuickPickSeparator, IQuickTreeItem } from '../../../../../platform/quickinput/common/quickInput.js';
@@ -28,6 +28,7 @@ import { IContextKeyService } from '../../../../../platform/contextkey/common/co
2828
import { ChatContextKeys } from '../../common/chatContextKeys.js';
2929
import { Iterable } from '../../../../../base/common/iterator.js';
3030
import Severity from '../../../../../base/common/severity.js';
31+
import { markdownCommandLink } from '../../../../../base/common/htmlContent.js';
3132

3233
/**
3334
* Chat Tools Picker - Dual Implementation
@@ -459,7 +460,7 @@ async function showToolsPickerTree(
459460
if (toolLimit) {
460461
if (count > toolLimit) {
461462
treePicker.severity = Severity.Warning;
462-
treePicker.validationMessage = localize('toolLimitExceeded', "{0} tools are enabled. You may experience degraded tool calling above {1} tools.", count, toolLimit);
463+
treePicker.validationMessage = localize('toolLimitExceeded', "{0} tools are enabled. You may experience degraded tool calling above {1} tools.", count, markdownCommandLink({ title: String(toolLimit), id: '_chat.toolPicker.closeAndOpenVirtualThreshold' }));
463464
} else {
464465
treePicker.severity = Severity.Ignore;
465466
treePicker.validationMessage = undefined;
@@ -476,6 +477,15 @@ async function showToolsPickerTree(
476477
};
477478
collectResults();
478479

480+
// Temporary command to close the picker and open settings, for use in the validation message
481+
store.add(CommandsRegistry.registerCommand({
482+
id: '_chat.toolPicker.closeAndOpenVirtualThreshold',
483+
handler: () => {
484+
treePicker.hide();
485+
commandService.executeCommand('workbench.action.openSettings', 'github.copilot.chat.virtualTools.threshold');
486+
}
487+
}));
488+
479489
// Handle checkbox state changes
480490
store.add(treePicker.onDidChangeCheckedLeafItems(() => {
481491
collectResults();

0 commit comments

Comments
 (0)