Python: feat: pass agent run kwargs through to context providers#1681
Merged
markwallace-microsoft merged 7 commits intomicrosoft:mainfrom Dec 2, 2025
Merged
Python: feat: pass agent run kwargs through to context providers#1681markwallace-microsoft merged 7 commits intomicrosoft:mainfrom
markwallace-microsoft merged 7 commits intomicrosoft:mainfrom
Conversation
`_prepare_thread_and_messages` and `_notify_thread_of_new_messages` now are passing through the agent's `run` kwargs, sothat they can provide the context_provider with said kwargs microsoft#1679
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Agent Framework's context provider functionality by propagating agent run() kwargs through the execution pipeline. This enables context providers to receive and utilize additional runtime parameters beyond just messages.
Key Changes:
- Modified
_prepare_thread_and_messagesand_notify_thread_of_new_messagesto accept and forward**kwargs - Updated context provider invocations to include the forwarded kwargs
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
eavanvalkenburg
approved these changes
Nov 20, 2025
markwallace-microsoft
approved these changes
Dec 1, 2025
dmytrostruk
approved these changes
Dec 1, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
) `_prepare_thread_and_messages` and `_notify_thread_of_new_messages` now are passing through the agent's `run` kwargs, sothat they can provide the context_provider with said kwargs microsoft#1679 Co-authored-by: David Jadczyk <david.jadczyk@lht.dlh.de> Co-authored-by: Chris <66376200+crickman@users.noreply.github.com> Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
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.
_prepare_thread_and_messagesand_notify_thread_of_new_messagesnow are passing through the agent'srunkwargs, sothat they can provide the context_provider with said kwargs#1679
Motivation and Context
The run() function calls the
_prepare_thread_and_messagesand_notify_thread_of_new_messages. The problem is caused by not passing through the kwargs from therun, hindering using the **kwargs in the ContextProvider.Consequently the context_provider is invoked only with messages, but not **kwargs making it unusable in that sense.
Suggested Fix:
Description
_prepare_thread_and_messagesand_notify_thread_of_new_messagesnow are passing through the agent'srunkwargs, sothat they can provide the context_provider with said kwargsContribution Checklist