Files
semantic-kernel/python/semantic_kernel
Tao Chen ba000c3368 Python: Use message cache in agent orchestrations (#12618)
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
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

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
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

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
2025-07-01 19:00:05 +00:00
..
2024-10-10 22:33:42 +00:00
2024-03-28 15:10:28 +00:00