Python: [BREAKING] Renamed AgentRunContext to AgentContext#3714
Queued
dmytrostruk wants to merge 2 commits intomicrosoft:mainfrom
Queued
Python: [BREAKING] Renamed AgentRunContext to AgentContext#3714dmytrostruk wants to merge 2 commits intomicrosoft:mainfrom
dmytrostruk wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements a breaking change that renames AgentRunContext to AgentContext across the Python implementation of the Agent Framework. This change resolves issue #3676 and simplifies the naming convention for the agent middleware context object.
Changes:
- Renamed the
AgentRunContextclass toAgentContextin the core middleware module - Updated all imports, type hints, and references across test files, samples, and documentation
- Updated serialization documentation examples to reflect the new naming
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
python/packages/core/agent_framework/_middleware.py |
Core class rename from AgentRunContext to AgentContext, including class definition, docstrings, type aliases, and __all__ exports |
python/packages/core/agent_framework/_serialization.py |
Updated serialization documentation examples to use AgentContext and agent_context type identifier |
python/packages/core/AGENTS.md |
Updated architecture documentation and code examples to reference AgentContext |
python/packages/core/tests/core/test_middleware.py |
Updated test class name from TestAgentRunContext to TestAgentContext and all type hints |
python/packages/core/tests/core/test_middleware_with_agent.py |
Updated all middleware type hints and docstrings to use AgentContext |
python/packages/core/tests/core/test_middleware_context_result.py |
Updated all imports and type hints to use AgentContext |
python/packages/core/tests/core/test_as_tool_kwargs_propagation.py |
Updated imports and middleware type hints |
python/packages/purview/agent_framework_purview/_middleware.py |
Updated middleware implementation to use AgentContext |
python/packages/purview/tests/test_middleware.py |
Updated all test fixtures and type hints |
python/samples/getting_started/middleware/*.py |
Updated all middleware sample files to use AgentContext in imports, type hints, and comments |
python/samples/getting_started/middleware/README.md |
Updated documentation to reference AgentContext |
python/samples/concepts/tools/README.md |
Updated sequence diagram documentation to use AgentContext |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
moonbox3
approved these changes
Feb 6, 2026
eavanvalkenburg
approved these changes
Feb 6, 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 and Context
Resolves: #3676
Contribution Checklist