Skip to content

Python: Use message cache in agent orchestrations #12618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Jun 27, 2025

Motivation and Context

Some agent threads don't support adding messages. An example of this is the copilot studio agent.

In an agent orchestration, an agent may receive multiple messages before it is asked to generate a response. The currently approach in the orchestrations would add new messages to an agent thread whenever an agent receives a message, making the copilot studio agent not compatible with some orchestrations.

Description

Instead of adding messages to the agent thread, this PR introduces a message cache to store messages temporarily before the agent is invoked.

Contribution Checklist

@TaoChenOSU TaoChenOSU self-assigned this Jun 27, 2025
@TaoChenOSU TaoChenOSU added python Pull requests for the Python Semantic Kernel agents labels Jun 27, 2025
@github-actions github-actions bot changed the title Use message cache in agent orchestrations Python: Use message cache in agent orchestrations Jun 27, 2025
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
agents/orchestration
   agent_actor_base.py67691%33, 79, 96, 132, 158, 175
   group_chat.py179994%111–113, 115, 286–288, 290, 355
   handoffs.py1861393%254–256, 258, 270, 285, 296–297, 302, 314–317
   magentic.py2879766%122–124, 256, 379, 447, 450, 457, 461, 463, 490–495, 497, 502, 504, 510, 512, 517–518, 520–521, 527, 529–530, 533–534, 540, 548–549, 558, 561–562, 564–567, 570–571, 575–578, 580–581, 583, 585–591, 594–595, 602, 611–613, 615, 617, 625–626, 628, 633, 637–638, 640, 642–643, 647–648, 650, 653, 658–660, 663, 665, 679–680, 684–685, 687, 689, 691, 693, 702–706, 773–774
TOTAL26423450982% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3639 22 💤 0 ❌ 0 🔥 1m 49s ⏱️

@TaoChenOSU TaoChenOSU marked this pull request as ready for review June 27, 2025 20:58
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner June 27, 2025 20:58
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Jul 1, 2025
Merged via the queue into main with commit ba000c3 Jul 1, 2025
31 checks passed
@TaoChenOSU TaoChenOSU deleted the taochen/python-use-message-cache-in-agent-orchestration branch July 1, 2025 19:08
@github-project-automation github-project-automation bot moved this to Sprint: Done in Semantic Kernel Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

4 participants