Skip to content

fix: recognize Copilot CLI and App MCP tool calls - #374

Open
alexcastgonz (pcbeingused333) wants to merge 2 commits into
microsoft:mainfrom
pcbeingused333:fix/c2024-copilot-mcp
Open

alexcastgonz (pcbeingused333) wants to merge 2 commits into
microsoft:mainfrom
pcbeingused333:fix/c2024-copilot-mcp

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Part of #333 (gap 3: MCP tools in Copilot CLI/App; gap 1 stays open, so this does not close the issue).

Copilot CLI and App identify MCP calls through tool.execution_start.data.mcpServerName, while context-engineering checks recognize the mcp_ tool-name prefix. The parser discarded the server metadata, so MCP usage was counted as missing.

Normalize server-backed tool names to mcp_<server>_<tool> when recording tools, removing the raw name previously recorded by assistant tool requests so each MCP tool is counted once. Built-in names and already-prefixed MCP names retain their existing representation. Increment the parsed-cache version so existing sessions are reparsed with the corrected MCP signal. This change covers gap 3 only; the custom-agent signal in gap 1 remains separate.

Testing

Add a regression covering Copilot CLI and App through both synchronous and streaming parsers. It checks normalized MCP names, unchanged built-ins, empty server metadata, and one fewer missing context-engineering signal compared with the same requests without MCP usage.

npm test -- src/core/parser-vscode-cli.test.ts: 2 failing without the parser change, 20/20 passing with it. The fixture includes both assistant tool requests and execution events, checks a single normalized name, and verifies that the dashboard extracts the github server ID.

npm run check passed typecheck, lint, spellcheck, knip and lockfile-lint. The full suite finished with 3684 passed, 5 skipped and 8 failures in GitHub App analytics and Xcode tests because the sqlite3 executable is missing from the test environment. git diff --check passed.

AI assistance: this change and its regression tests were prepared using Codex.

@pcbeingused333

Copy link
Copy Markdown
Contributor Author

Friendly ping: this one is approved and CI is in place — happy to rebase or adjust anything if that helps get it merged. Thanks!

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.

2 participants