Skip to content

Python: Expand optional MCP tool regression coverage - #9937

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ssccinng:openfix/e3936aa5-d634-4ffc-911e-6ef0f880a3e8
Nov 2, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ssccinng:openfix/e3936aa5-d634-4ffc-911e-6ef0f880a3e8

Conversation

@ssccinng

@ssccinng ssccinng commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

Tools declaring optional MCP task support can also be called normally. The production fix is already in #9746; this contribution preserves additional regression coverage for arguments, metadata, and successful results.

Description & Review Guide

  • Add a non-empty query argument and call metadata to the optional-tool case, and verify they reach the MCP session with the expected result.
  • Verify that only task-required tools are omitted and produce the skip warning; ordinary and task-forbidden tools remain callable.
  • Preserve the upstream implementation and all existing tests. The change is limited to MCP regression coverage.

Supersedes #9680.

Validation coverage: the MCP tests, core package checks, all five configured core test type checkers, and workspace package checks passed with the pinned tools on Python 3.12 and Python 3.11.

Validation: The additional regression coverage passes on the current target branch. The listed validation commands passed. The same configured checks also passed with Python 3.11.

Related Issue

Fixes #9675.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Implementation, regression coverage, and review were AI-assisted.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or documents the applicable exception
  • This is not a breaking change.

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

No active review issues are reported for this test-only expansion of optional-task MCP regression coverage.

No open issues 🎉

What changed in this PR

This PR strengthens Python MCP regression coverage for the optional-task tool behavior restored in #9746. It changes tests only, leaving production behavior unchanged.

Changes:

  • Verify that optional tools forward a non-empty query argument and tool metadata and return the expected result.
  • Check exact parameter mappings and confirm required-task tools remain excluded.
  • Assert that only required-task tools produce a skip warning, while forbidden-task and ordinary tools remain callable.
File Description
python/​packages/​core/​tests/​core/​test_mcp.py Expands assertions for MCP tool discovery, argument and metadata forwarding, warnings, and successful invocation.

Review effort: Balanced

Merged via the queue into microsoft:main with commit 93c346f Nov 2, 2026
55 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 54358d64 Deployed Nov 1, 2026 by ssccinng via team_check #8259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: MCP tools with execution.taskSupport "optional" are skipped, although they can be called without Tasks

3 participants