Skip to content

Conversation

@DJ2695
Copy link

@DJ2695 DJ2695 commented Oct 24, 2025

_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

#1679

Motivation and Context

The run() function calls the _prepare_thread_and_messages and _notify_thread_of_new_messages. The problem is caused by not passing through the kwargs from the run, 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:

  • adjust _prepare_thread_and_messages to take **kwargs from run
  • adjust _notify_thread_of_new_messages to take **kwargs from run
  • invoke context_provider with **kwargs in both functions

Description

_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

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.

`_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
Copilot AI review requested due to automatic review settings October 24, 2025 10:10
@github-actions github-actions bot changed the title feat: pass agent run kwargs through to context providers Python: feat: pass agent run kwargs through to context providers Oct 24, 2025
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 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_messages and _notify_thread_of_new_messages to accept and forward **kwargs
  • Updated context provider invocations to include the forwarded kwargs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants