Python: Add Python feature lifecycle decorators for released APIs#4975
Open
eavanvalkenburg wants to merge 4 commits intomicrosoft:mainfrom
Open
Python: Add Python feature lifecycle decorators for released APIs#4975eavanvalkenburg wants to merge 4 commits intomicrosoft:mainfrom
eavanvalkenburg wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Introduce reusable experimental and release-candidate decorators for released packages, migrate the Skills APIs to the new staged metadata and warning system, and add lifecycle guidance plus samples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a standardized Python “feature lifecycle” mechanism for marking released APIs as experimental or release candidate, including docstring injection, optional introspection metadata, and (for experimental features) runtime warnings. It migrates the existing Skills surface to the new decorators and updates samples/tests accordingly, aligning with the lifecycle guidance requested in #904.
Changes:
- Add
agent_framework._feature_stagewith@experimental(...)/@release_candidate(...), plus stage enums, docstring block injection, metadata, and experimental runtime warnings. - Migrate Skills APIs in
agent_framework._skillsto use@experimental(feature_id=ExperimentalFeature.SKILLS)and add/adjust tests around docstrings/metadata/warnings. - Update Python samples and documentation to reflect the new warning behavior and provide a feature-stage introspection sample.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/core/agent_framework/_feature_stage.py | Adds lifecycle decorators, warning behavior, and stage metadata/enums. |
| python/packages/core/agent_framework/_skills.py | Migrates Skills APIs to the shared @experimental(...) decorator. |
| python/packages/core/agent_framework/_docstrings.py | Adds insert_docstring_block() to inject lifecycle blocks into docstrings. |
| python/packages/core/agent_framework/init.py | Re-exports ExperimentalFeature / ReleaseCandidateFeature from the root module. |
| python/packages/core/tests/core/test_feature_stage.py | Adds focused tests for metadata/docstrings/warnings behavior. |
| python/packages/core/tests/core/test_skills.py | Adds Skills experimental-stage assertions; adjusts imports and warning filtering. |
| python/packages/core/tests/core/test_docstrings.py | Adds tests for insert_docstring_block() placement behavior. |
| python/packages/core/tests/core/conftest.py | Globally filters Skills experimental warnings in core tests. |
| python/samples/02-agents/feature_stage_introspection.py | Adds a sample showing how to introspect __feature_stage__ / __feature_id__. |
| python/samples/02-agents/skills/* | Adds commented warning-filter snippets; updates one sample callsite for new kwargs forwarding. |
| python/samples/02-agents/skills/README.md | Documents how to suppress the experimental warning in the Skills samples. |
| python/AGENTS.md | Links the new python-feature-lifecycle guidance skill doc. |
| python/.github/skills/python-feature-lifecycle/SKILL.md | Adds repository guidance for package vs feature lifecycle and promotion. |
python/samples/02-agents/skills/code_defined_skill/code_defined_skill.py
Outdated
Show resolved
Hide resolved
python/samples/02-agents/skills/code_defined_skill/code_defined_skill.py
Show resolved
Hide resolved
python/samples/02-agents/skills/file_based_skill/file_based_skill.py
Outdated
Show resolved
Hide resolved
python/samples/02-agents/skills/script_approval/script_approval.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
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 and Context
This change adds a reusable way to mark APIs in released Python packages as experimental or release candidate without relying on hand-written docstring notes. It implements the lifecycle guidance requested in #904 and uses the Skills APIs in
agent_framework._skillsas the first migrated feature surface.Closes #904
Description
experimental(...)andrelease_candidate(...)decorators inagent_framework._feature_stageContribution Checklist