Skip to content

Python: Warn when advertised MCP archives are rejected - #7622

Open
Ruiming Zhao (uuzzrm) wants to merge 1 commit into
microsoft:mainfrom
uuzzrm:uuzzrm/core/warn-rejected-mcp-archives
Open

Python: Warn when advertised MCP archives are rejected#7622
Ruiming Zhao (uuzzrm) wants to merge 1 commit into
microsoft:mainfrom
uuzzrm:uuzzrm/core/warn-rejected-mcp-archives

Conversation

@uuzzrm

Copy link
Copy Markdown

Motivation & Context

MCPSkillsSource can advertise an archive skill in skill://index.json and then return fewer skills when that archive is rejected during download or materialization. The refusal was only logged at DEBUG, so operators could not distinguish a missing skill from one that was never published.

This change makes refusals of well-formed, advertised archive entries visible at WARNING. It keeps malformed index entries and MCP -32002 missing-resource responses at DEBUG because those cases can be expected during capability discovery.

Description & Review Guide

  • What are the major changes?
    • Promote archive refusal logs for empty/non-binary content, download-size limits, unsupported formats, missing SKILL.md, invalid UTF-8, and frontmatter name mismatches from DEBUG to WARNING.
    • Add a regression test covering the frontmatter name mismatch path.
  • What is the impact of these changes?
    • There is no API or behavior change: rejected archives are still skipped, but the reason is visible at the default operational log level.
    • Archive safety limits and validation remain unchanged.
  • What do you want reviewers to focus on?
    • Whether the WARNING/DEBUG boundary is appropriate for advertised archive entries versus malformed or unavailable index resources.

AI assistance was used to help draft the patch and regression test; I reviewed the resulting diff and ran the relevant test suites.

Related Issue

Fixes #7619

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 is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings August 11, 2026 22:31
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Aug 11, 2026
@uuzzrm
Ruiming Zhao (uuzzrm) marked this pull request as ready for review August 11, 2026 22:32

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.

Pull request overview

Promotes rejected advertised MCP archive logs to WARNING without changing skill-loading behavior.

Changes:

  • Raises archive refusal visibility from DEBUG to WARNING.
  • Adds regression coverage for frontmatter name mismatches.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/packages/core/agent_framework/_skills.py Promotes archive rejection logs.
python/packages/core/tests/core/test_mcp_skills.py Verifies mismatch warnings.

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

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.

.NET: Python: [Bug]: MCPSkillsSource drops archive skills the index advertised, and every refusal is DEBUG-only

2 participants