Skip to content

chat: remove unused mcpServerByTool map from tools picker - #334230

Closed
유민호 (yoominho91) wants to merge 1 commit into
microsoft:mainfrom
yoominho91:chore/remove-unused-mcp-server-map
Closed

유민호 (yoominho91) wants to merge 1 commit into
microsoft:mainfrom
yoominho91:chore/remove-unused-mcp-server-map

Conversation

@yoominho91

Copy link
Copy Markdown

Details

showToolsPicker builds a mcpServerByTool map (tool id → IMcpServer) on every invocation, but nothing reads it.

The last reader was removed in #249448 ("Add support for tool sets", 2025-05-21): the old mcpServerByTool.get(tool.id) lookup in chatToolActions.ts was replaced by keying buckets through ToolDataSource.toKey(source), and the map was left behind. #249556 then moved the picker into chatToolPicker.ts with the map still unused, and it survived the QuickTree rewrite (#257748) and the removal of the old Quick Pick picker (#260414).

Change

  • Remove the map and the loop over mcpService.servers.get() / server.tools.get() that filled it.
  • Drop the now-unused IMcpServer import.

mcpService is still used further down to build the mcpServers map for bucket actions, so that stays.

How to test

No behavior change: the picker never read from this map, so the rendered items, enablement, and MCP bucket actions are unaffected. npm run eslint, npm run hygiene, and tsc --noEmit pass locally on the touched file.

Disclosure

This was found with a static check for collections that are written but never read; the history above and the change were verified by hand. An LLM-based assistant was used to help draft this PR.

https://claude.ai/code/session_01B8NGgDp1aqKyL2KMwMzWAv

The map has had no reader since tool sets were introduced in microsoft#249448;
the picker now resolves MCP buckets through ToolDataSource.toKey.

Claude-Session: https://claude.ai/code/session_01B8NGgDp1aqKyL2KMwMzWAv
Copilot AI balanced review requested due to automatic review settings September 3, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The redundant code is safely removed with no unresolved issues.

Pull request overview

Removes unused MCP server lookup work from the chat tools picker.

Changes:

  • Removes the unused mcpServerByTool map and population loops.
  • Removes the now-unused IMcpServer import.
File summaries
File Description
src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.ts Eliminates unused MCP lookup logic while retaining active MCP service usage.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yoominho91

Copy link
Copy Markdown
Author

Friendly ping — this is a small cleanup: chatToolPicker.ts builds mcpServerByTool and nothing reads it afterwards, so this removes the map and its two writes. No behaviour change, and the only review so far is the automated one. Happy to rebase if that helps.

@yoominho91

Copy link
Copy Markdown
Author

Closing this to keep my open PR count down — it has been sitting well past this repo's usual review turnaround with no maintainer feedback, and I would rather not leave unsolicited changes cluttering the queue. The change is self-contained (removes a map that is written but never read) and still applies; happy to reopen if a maintainer wants to take a look.

유민호 (yoominho91) added a commit to m1kapp/fixearly that referenced this pull request Sep 15, 2026
…#79)

All three were pinged on 2026-09-12 and had no human review at all — every
reaction on them came from bots. Closed on 2026-09-15 with the same short note
used for earlier withdrawals, following the Ghost precedent of reclaiming the
slot rather than leaving unsolicited changes in someone's queue.

- nrwl/nx#36633 — 34 days open
- typeorm/typeorm#12746 — 46 days open
- microsoft/vscode#334230 — 12 days open

Open 7 -> 4, closed 17 -> 20. Merges unchanged at 14.

Claude-Session: https://claude.ai/code/session_01ABuXgtVFhvgie5kXCPcBja

Co-authored-by: irontaek <13810291+irontaek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants