Skip to content

Python: [BREAKING] Renamed AgentRunContext to AgentContext#3714

Queued
dmytrostruk wants to merge 2 commits intomicrosoft:mainfrom
dmytrostruk:agent-context-rename
Queued

Python: [BREAKING] Renamed AgentRunContext to AgentContext#3714
dmytrostruk wants to merge 2 commits intomicrosoft:mainfrom
dmytrostruk:agent-context-rename

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

Resolves: #3676

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@dmytrostruk dmytrostruk self-assigned this Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 00:18
@markwallace-microsoft markwallace-microsoft added the documentation Improvements or additions to documentation label Feb 6, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 6, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _middleware.py3291695%80, 83, 88, 797, 799, 801, 922, 949, 951, 976, 1057, 1061, 1185, 1189, 1250, 1324
   _serialization.py105496%516, 532, 542, 610
packages/purview/agent_framework_purview
   _middleware.py950100% 
TOTAL16515200887% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3911 225 💤 0 ❌ 0 🔥 1m 5s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AgentRunContext class to AgentContext in 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>
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: RenameAgentRunContext to just AgentContext.

4 participants