Skip to content

Commit 7c985e9

Browse files
authored
1 parent b3f7ce2 commit 7c985e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { ConfigureToolSets } from '../tools/toolSetsContribution.js';
2525

2626

2727
const enum BucketOrdinal { User, BuiltIn, Mcp, Extension }
28-
type BucketPick = IQuickPickItem & { picked: boolean; ordinal: BucketOrdinal; status?: string; children: (ToolPick | ToolSetPick)[] };
28+
type BucketPick = IQuickPickItem & { picked: boolean; ordinal: BucketOrdinal; status?: string; toolset?: ToolSet; children: (ToolPick | ToolSetPick)[] };
2929
type ToolSetPick = IQuickPickItem & { picked: boolean; toolset: ToolSet; parent: BucketPick };
3030
type ToolPick = IQuickPickItem & { picked: boolean; tool: IToolData; parent: BucketPick };
3131
type CallbackPick = IQuickPickItem & { pickable: false; run: () => void };
@@ -199,6 +199,9 @@ export async function showToolsPicker(
199199
indented: true,
200200
buttons
201201
});
202+
} else {
203+
// stash the MCP toolset into the bucket item
204+
bucket.toolset = toolSetOrTool;
202205
}
203206

204207
} else if (toolSetOrTool.canBeReferencedInPrompt) {
@@ -282,6 +285,9 @@ export async function showToolsPicker(
282285
} else if (isToolPick(item)) {
283286
result.set(item.tool, item.picked);
284287
} else if (isBucketPick(item)) {
288+
if (item.toolset) {
289+
result.set(item.toolset, item.picked);
290+
}
285291
for (const child of item.children) {
286292
if (isToolSetPick(child)) {
287293
result.set(child.toolset, item.picked);

0 commit comments

Comments
 (0)