Skip to content

Proactive Improvements#350

Merged
axelsrz merged 11 commits intomainfrom
users/axsuarez/proactive-improvements
Apr 14, 2026
Merged

Proactive Improvements#350
axelsrz merged 11 commits intomainfrom
users/axsuarez/proactive-improvements

Conversation

@axelsrz
Copy link
Copy Markdown
Member

@axelsrz axelsrz commented Apr 2, 2026

This pull request introduces a new "proactive messaging" subsystem to the Microsoft Agents Hosting Core library, allowing the application to store conversation references and initiate proactive (out-of-band) conversations. The changes add new types and configuration options, integrate the subsystem into the AgentApplication, and expose a new API for managing proactive messaging.

The most important changes are:

Proactive Messaging Subsystem Integration:

  • Added a new proactive package with types like Proactive, ProactiveOptions, Conversation, ConversationBuilder, and related helpers, enabling the storage and creation of conversation references for proactive messaging. ([[1]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-ab0b620edce9ae748d8a4beaa059710084153346388f3baeb0c87fd77b61868eR1-R20), [[2]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-3b51491b418dffd0f7cd4a6ceef3da178085d86dc0b3aaa36101837b35f41ba0R1-R142), [[3]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-b0081ee5fb63a260f726e092191d0efd4d6d750683fcac49c23a00b64a9cc196R1-R235))
  • Updated the AgentApplication class to optionally initialize and expose a proactive messaging manager when ProactiveOptions are provided in the application options, including error handling if accessed when not configured. ([[1]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-a0c0028a01efc798e89b84f1bca0d4323b71753bd6f43d02800f29e66bc766a6R71), [[2]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-a0c0028a01efc798e89b84f1bca0d4323b71753bd6f43d02800f29e66bc766a6R150-R155), [[3]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-a0c0028a01efc798e89b84f1bca0d4323b71753bd6f43d02800f29e66bc766a6R225-R244))

Configuration and Public API:

  • Extended ApplicationOptions to include an optional proactive field for configuring proactive messaging. ([libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_options.pyR93-R99](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-52c9390d176de19f2e6ecb00591186c7c3b271d30ff66eb41f3b72093a181e89R93-R99))
  • Exposed all new proactive messaging types in the public API via __init__.py files and the __all__ lists, making them available for import from the main app package. ([[1]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-65135729f0818c154cc80932e3046c5c437aa0d3c029abfdcba4b2f27ab4c122R24-R33), [[2]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-65135729f0818c154cc80932e3046c5c437aa0d3c029abfdcba4b2f27ab4c122R60-R66), [[3]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-ab0b620edce9ae748d8a4beaa059710084153346388f3baeb0c87fd77b61868eR1-R20), [[4]](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-52c9390d176de19f2e6ecb00591186c7c3b271d30ff66eb41f3b72093a181e89R20))

Internal Usage:

  • Updated internal imports to use the new proactive messaging types where needed in the application core. ([libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.pyR46](https://github.com/microsoft/Agents-for-python/pull/350/files#diff-a0c0028a01efc798e89b84f1bca0d4323b71753bd6f43d02800f29e66bc766a6R46))

These changes lay the foundation for enabling bots to initiate conversations with users outside the context of an immediate incoming message, a common requirement for enterprise bots and notification scenarios.

Copilot AI review requested due to automatic review settings April 2, 2026 02:04
Copy link
Copy Markdown
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

Adds a new proactive messaging subsystem to microsoft-agents-hosting-core, enabling conversation reference persistence and out-of-band/proactive turns (continue existing conversations, send one-off activities, and create new conversations), and includes a runnable sample demonstrating the flows.

Changes:

  • Introduces core.app.proactive package (Proactive, Conversation, builders, options) and wires it into AgentApplication via ApplicationOptions.proactive.
  • Exposes proactive types via package __init__.py exports for public consumption.
  • Adds a test_samples/proactive sample app + docs + environment template.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test_samples/proactive/requirements.txt Sample dependencies for running the proactive agent.
test_samples/proactive/README.md End-to-end instructions and usage patterns for proactive flows.
test_samples/proactive/proactive_agent.py Runnable aiohttp sample demonstrating store/continue/notify and OAuth-guarded continuations.
test_samples/proactive/env.TEMPLATE Environment template for the proactive sample (AAD + OAuth connection).
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/proactive.py Core proactive manager: persist conversations, continue/send proactively, create new conversations.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/proactive_options.py Configuration options for proactive subsystem.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py Options model + validation for proactive conversation creation.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/conversation.py Persisted conversation reference + filtered claims serialization/validation.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py Fluent builder for ConversationReference.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/conversation_builder.py Fluent builder for Conversation objects.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/proactive/init.py Public exports for proactive package.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/app_options.py Adds ApplicationOptions.proactive configuration hook.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.py Initializes and exposes AgentApplication.proactive.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/init.py Re-exports proactive types from the main app package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_samples/proactive/proactive_agent.py Outdated
Comment thread test_samples/proactive/proactive_agent.py
Copilot AI review requested due to automatic review settings April 3, 2026 20:08
Copy link
Copy Markdown
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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_samples/proactive/README.md
Copilot AI review requested due to automatic review settings April 9, 2026 23:11
…into users/axsuarez/proactive-improvements
@axelsrz axelsrz changed the title Proactive testing WIP Proactive Improvements Apr 9, 2026
@axelsrz axelsrz marked this pull request as ready for review April 9, 2026 23:11
@axelsrz axelsrz requested a review from a team as a code owner April 9, 2026 23:11
Copy link
Copy Markdown
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

Copilot reviewed 19 out of 21 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_samples/proactive/proactive_agent.py
Comment thread test_samples/proactive/README.md
Copilot AI review requested due to automatic review settings April 13, 2026 19:07
Copy link
Copy Markdown
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

Copilot reviewed 19 out of 21 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_samples/proactive/proactive_agent.py
Comment thread test_samples/proactive/proactive_agent.py
Comment thread test_samples/proactive/proactive_agent.py
Comment thread test_samples/proactive/proactive_agent.py
Comment thread test_samples/proactive/README.md
@axelsrz axelsrz requested a review from Copilot April 13, 2026 21:13
Copy link
Copy Markdown
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

Copilot reviewed 19 out of 21 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_samples/proactive/README.md
@axelsrz axelsrz merged commit 9d098c2 into main Apr 14, 2026
12 checks passed
@axelsrz axelsrz deleted the users/axsuarez/proactive-improvements branch April 14, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants