Python: Fix read_skill_resource instruction dropping .md extension#7031
Merged
Merged
Conversation
The RESOURCE_INSTRUCTIONS example told the model to use eferences/FAQ instead of eferences/FAQ.md, contradicting the actual exact-match resource lookup (which lists and matches names including the extension). This caused read_skill_resource to fail with 'Resource not found'. Align the example with the .NET original. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a misleading example in the Python skills system prompt (RESOURCE_INSTRUCTIONS) so that read_skill_resource is called with the exact resource name as listed in <available_resources>, including the .md extension for file-based resources (aligning Python with the .NET prompt).
Changes:
- Update the
RESOURCE_INSTRUCTIONSexample fromreferences/FAQtoreferences/FAQ.mdto match exact-name lookup behavior. - Preserve the existing rule text (“use the name exactly as listed”) while correcting the file-resource example that previously contradicted lookup semantics.
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
TaoChenOSU
approved these changes
Jul 9, 2026
moonbox3
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Microsoft Agent Framework Skills expose a
read_skill_resourcetool that resolves resources by their exact listed name. For file-based skills, resource names include their relative path and file extension (e.g.references/output-schema.md), and the<available_resources>block advertises them that way. Lookup (get_resource) matches on that exact name.However, the generated
RESOURCE_INSTRUCTIONSprompt contained a misleading example that told the model to strip the extension:The second example (
references/FAQinstead ofreferences/FAQ.md) demonstrates dropping the.mdextension, which directly contradicts the exact-match behavior. This nudges the model into callingread_skill_resource(resource_name="references/output-schema"), which then fails withResource '...' not found in skill '...'.This is a Python-only transcription defect: the .NET original (
AgentSkillsProvider.cs) correctly reads"references/FAQ.md"not"FAQ.md".Description & Review Guide
RESOURCE_INSTRUCTIONSexample inpython/packages/core/agent_framework/_skills.py:"references/FAQ"->"references/FAQ.md", restoring exact parity with the .NET prompt. The unifying rule ("use the name exactly as listed") is unchanged; the file-resource example now keeps its extension.read_skill_resourcewith the full listed name (including.md), so resource loading no longer fails. Prompt-text only; no API or behavioral code changes.Related Issue
Fixes #7008
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.