Skip to content

Python: .Net: Magentic orchestration to return the last agent message when limits reached#12839

Merged
TaoChenOSU merged 4 commits into
mainfrom
taochen/dotnet-magentic-return-last-agent-message
Aug 4, 2025
Merged

Python: .Net: Magentic orchestration to return the last agent message when limits reached#12839
TaoChenOSU merged 4 commits into
mainfrom
taochen/dotnet-magentic-return-last-agent-message

Conversation

@TaoChenOSU

@TaoChenOSU TaoChenOSU commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

Related to #12687
Related to #12656

Currently, the Magentic orchestration returns a static message if the max reset limit or the max invocation limit is reached.

Description

Return the last agent response if either of the limit is reached.

Contribution Checklist

@TaoChenOSU TaoChenOSU requested a review from crickman July 31, 2025 04:23
@TaoChenOSU TaoChenOSU self-assigned this Jul 31, 2025
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner July 31, 2025 04:23
@TaoChenOSU TaoChenOSU added .NET Issue or Pull requests regarding .NET code multi-agent Issues for multi-agent orchestration labels Jul 31, 2025
@github-actions github-actions Bot changed the title Magentic orchestration to return the last agent message when limits reached .Net: Magentic orchestration to return the last agent message when limits reached Jul 31, 2025
Comment thread dotnet/src/Agents/Magentic/MagenticManagerActor.cs

@crickman crickman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an opportunity to validate this update in StandardMagenticManagerTests (unit-test)

@crickman crickman moved this to Sprint: In Review in Semantic Kernel Aug 1, 2025
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner August 3, 2025 21:01
@moonbox3 moonbox3 added the python Pull requests for the Python Semantic Kernel label Aug 3, 2025
@github-actions github-actions Bot changed the title .Net: Magentic orchestration to return the last agent message when limits reached Python: .Net: Magentic orchestration to return the last agent message when limits reached Aug 3, 2025
@moonbox3

moonbox3 commented Aug 3, 2025

Copy link
Copy Markdown
Collaborator

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
agents/orchestration
   magentic.py2945680%122–124, 256, 379, 447, 450, 457, 461, 463, 521–522, 524–525, 531, 533–534, 538, 566, 570, 580–582, 585, 590–595, 617, 629–630, 632, 637, 641–642, 644, 646–647, 652, 662–663, 666, 670–671, 677–678, 680, 708, 710, 719–723
TOTAL26693459682% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3659 22 💤 0 ❌ 0 🔥 1m 56s ⏱️

Comment thread python/semantic_kernel/agents/orchestration/magentic.py
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Aug 4, 2025
Merged via the queue into main with commit 358b0f3 Aug 4, 2025
33 checks passed
@TaoChenOSU TaoChenOSU deleted the taochen/dotnet-magentic-return-last-agent-message branch August 4, 2025 18:33
@github-project-automation github-project-automation Bot moved this from Sprint: In Review to Sprint: Done in Semantic Kernel Aug 4, 2025
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
… when limits reached (microsoft#12839)

### 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.
-->
Related to microsoft#12687
Related to microsoft#12656 

Currently, the Magentic orchestration returns a static message if the
max reset limit or the max invocation limit is reached.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Return the last agent response if either of the limit is reached.

### 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 😄

---------

Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multi-agent Issues for multi-agent orchestration .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants